datepicker parsing date issue

I've the next problem: when I recieve date from server, I want to format it via datepicker, but datepicker throws exceptions, cause it can't parse the date. here is my date, whcih comes from server(obj.value): 08.20.2012 19:01:32 and here is code via which I try to parse this date: $.datepicker.formatDate('dd.MM.yy', new Date(obj.value)); I use MM cause I need the full name of the month. and here is output after parsing: NaN.NaN.NaN so how to get rid of this exception?

Answers


You need to change you date (obj.value) to a valid JavaScript date format. Best if you can do on the server side.

If you want to do it on client side you need to replace . with / so you get 08/20/2012 19:01:32 instead of 08.20.2012 19:01:32.

new Date(obj.value.replace(/\./g, '/'))

Need Your Help

Fast matrix exponential of a complex symmetric tridiagonal matrix

c++ c matrix blas

Basically I need the above. I have trawled the Googles and cannot find a way of implementing this.

Build multiple solution platforms at once?

c# .net vb.net visual-studio visual-studio-2013

I have created in my project two additional solution platforms:

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.