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?
I’ve the next problem: when I recieve date from server, I want to format
Share
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 get08/20/2012 19:01:32instead of08.20.2012 19:01:32.