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?
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, '/'))