Closed krasi-georgiev closed 9 years ago
Can you demonstrate how the current behavior results in an error?
Here is an example:
https://jsfiddle.net/bg9pxut2/
the second input is always one day behind
and here is a short video what happens http://screencast.com/t/n9fz6XF7
You're overriding the parseDate
function in your example and introducing some sort of UTC based offset - that's what's causing the error. This isn't a Datepair bug.
my point here was that in your Readme the example shows this code which is not right
https://github.com/jonthornton/Datepair.js/blob/master/README.md
The code in the jsFiddle you provided is different from the readme example.
how about this one: https://jsfiddle.net/4hckgkxb/
I thought you were talking about the examples on this page - I'm sorry. You're right about the bug. I've updated the example.
the exmaple with overwriting the update funciton doesn't take into account the UTC
I think it should be:
updateDate: function (el, v) { var utc = new Date(); v.setMilliseconds(v.getMilliseconds()-(utc.getTimezoneOffset()* 60000)) $(el).datepicker('setDate',v); }