I have a datetime of the form:
var myDate = "2013-06-07T00:00:00.000Z"
I wish to do
jQuery.datepicker.parseDate( "yy-mm-dd", myDate);
I don't care about the time part.
I get:
"Extra/unparsed characters found in date: T00:00:00.000Z"
Best I got so far is:
myDate = myDate.replace('T00:00:00.000Z', '');
myDate = jQuery.datepicker.parseDate("yy-mm-dd", myDate).toUTCString();
Please help.
As it is ISO date format, I think you can call new Date(myDate)
directly there is no need to parse it I think
var date = new Date(myDate);
If you don't care about the time part, why not simply
jQuery.datepicker.parseDate( "yy-mm-dd", myDate.split("T")[0]);
Perhaps for general DateTime handling, have a look at moment.js
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With