There should be a check to test if the date we are setting is null or undefined and in that case do not try to adjust for the timezone: changing the function to something like:
$.timepicker.timezoneAdjust = function (date, toTimezone) {
if (date) {
var toTz = $.timepicker.timezoneOffsetNumber(toTimezone);
if (!isNaN(toTz)) {
var currTz = date.getTimezoneOffset() * -1,
diff = currTz - toTz; // difference in minutes
date.setMinutes(date.getMinutes() + diff);
}
}
return date;
};
was enough for my case. The problem arose when using a framework that supports two way data-binding like Knockoutjs or Angularjs.
Thanks for your great work, this control has been very helpful for me!
Alessandro
I've the same problem, but i'm using two inputs together for the date controler
with this solution, despite that the error not appear, the value of the first input disapears. What I can do about that ?
There should be a check to test if the date we are setting is null or undefined and in that case do not try to adjust for the timezone: changing the function to something like:
was enough for my case. The problem arose when using a framework that supports two way data-binding like Knockoutjs or Angularjs.
Thanks for your great work, this control has been very helpful for me! Alessandro