Open andriiash opened 8 years ago
I updated dev branch with this fix. Note that this completely kills the partial support that existed for custom alpha timezones (it was a use at your own risk anyway).
Thanks a lot!
I found that this issue is actually coming from _onTimeChange
which sets the timepicker timezone as a string:
Line 828 of jquery-ui-timepicker-addon.js version v1.6.1
if (timezone !== false) {
timezone = timezone.toString();
}
I would suggest to change to:
if (timezone !== false) {
timezone = parseInt(timezone);
}
In order to keep the user-defined timezones.
Use the next to reproduce:
To reproduce:
For example, after the button click the "now" variable has value eqals "Mon Nov 16 2015 15:05:28 GMT+0200". The result of "now.getMinutes() + now.getTimezoneOffset() + tzoffset" will be [5(int) + -120(int) + "120"(string)] equls "-115120" instead of 5 as expected, since "tzoffset" will have a string value for the default Timezone. Thus, after the now.setMinutes(-115120) call the date value will be elqual: "Fri Aug 28 2015 16:20:28 GMT+0300".
Fix: The jquery-ui-timepicker-addon.js code:
should be replaced by: