Open thuckabay opened 8 years ago
Please, see the issue #843
Issue 843 is different.
I didn't say that the issue is the same instead of the reason (and fix). Now it fixed with parseInt() in the timezoneOffsetNumber() function that returns the tzoffset value.
I'm using v1.6.1 and had the same issue. The suggestion posted by @thuckabay worked fine for me.
@thuckabay 's solution worked fine for me too.
Note this bug also occurs in $.timepicker.timezoneAdjust function.
@thuckabay, excellent job. I was just digging around in the same code hoping to find a solution, but you had already handled that.
I really hope @trentrichardson gets wind of this and pushes an update - it's been quite a while.
I applied the fix in the dev branch just now. Hope this helps out. I will do my best to get this all merged to master soon.
Also, if anyone is interested in participating in this project as a team member see this post: https://github.com/trentrichardson/jQuery-Timepicker-Addon/issues/874 Long story a couple reliable developers willing to spend a few minutes here and there would be a huge help in applying these fixes, helping with testing, documentation, etc. I don't mind putting your name in the docs as a team member so you get recognition as well.
@trentrichardson Good stuff, man. Thanks for chiming in. Really appreciate your work.
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 only had to change it to:
if (timezone !== false) {
timezone = parseInt(timezone);
}
I know there already is a larger commit about fixing this issue, just wanted to add my 2 cents.
Hi Trent,
I love your "date time picker" control, and am new to it. I have found that sometime between version 1.4.5 and 1.6.1, a serious bug was introduced affecting use of the Now button, so that using that button more than once in a control instance results in Na:Na for the time and ALSO may freeze the slider controls to select the hour and minute when those are displayed. This is being caused by a failure to parse a string to an integer:
now.setMinutes(now.getMinutes() + now.getTimezoneOffset() +tzoffset);
The above line should read:
now.setMinutes(now.getMinutes() + now.getTimezoneOffset() + parseInt(tzoffset));
Please correct your latest version to include parseInt() around tzoffset, and that will eliminate the bug.
Thanks, and keep up the great work. (I examined a number of date-time picker controls, some free and some not, and yours is excellent.)
T. Huckabay