Open ghost opened 9 years ago
To avoid timezone problems, my intention was to set the dates using a javascript Date object using an ISO-8601 string:
$('#calendar-container .calendar').datepicker({ startDate: Date.parse("2015-08-06T09:15:19+02:00"), datesDisabled: [ Date.parse("2015-08-07T09:15:19+02:00") ], todayHighlight: true, });
But this fails with this error:
Uncaught TypeError: date.match is not a function
After some research, I think this happens because https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/parse returns the time as timestamp in milliseconds since January 1, 1970, 00:00:00 UTC when giving the ISO-8601 as string to parse.
Could you add support for this format?
Feel free to provide a PR ;-)
maybe we will look into it for 2.0
Glad to hear you might look into it. For now, I revert back to a string, no time to dive into a PR.
To avoid timezone problems, my intention was to set the dates using a javascript Date object using an ISO-8601 string:
But this fails with this error:
After some research, I think this happens because https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/parse returns the time as timestamp in milliseconds since January 1, 1970, 00:00:00 UTC when giving the ISO-8601 as string to parse.
Could you add support for this format?