trentrichardson / jQuery-Timepicker-Addon

Adds a timepicker to jQueryUI Datepicker
http://trentrichardson.com/examples/timepicker/
MIT License
2.66k stars 1.05k forks source link

Invalid time timezone diff -0100 #840

Open CrAsH1101 opened 8 years ago

CrAsH1101 commented 8 years ago

Hi,

I have a strange issue with populating time if itmezone is set -1 relative to my local timezone. So, my local browser timezone is +0200, and datetimepicker works fine in all selected timezones, except for +0100. The same problem occurs if is set my computer to -0400 timezone, and then initialize datetimepicker with -0500 timezone.

Example: -local browser timezone: +0200 -timezone param: 60 (+0100)

load page, datetimepicker is loaded. Open datepicker we see selected timezone +0100. That's correct. We set date via $(selector).datetimepicker('setDate', new Date()); Input field is populated correctly. Click on a calendar again and timezone is still +0100. getDate works correctly.

Steps to create bug: load page, datetimepicker is loaded. DO NOT open datepicker, but set date directly with $(selector).datetimepicker('setDate', new Date()); Input field is populated correctly. Click on a calendar and timezone is set to +0200, even we initialized it with +0100. getDate will result with 1 hour offset.

JS Fiddle: http://jsfiddle.net/b78mb9q8/4/

Steps to reprocude error in fiddle:

  1. Run fiddle
  2. Click button "set date"
  3. Click on the (local-1) datepicker
  4. time zone will be set to local timezone
  5. All other datepicker will show correct timezone

Steps to avoid the bug:

  1. Run fiddle
  2. Click on the local-1 datepicker
  3. Close it (DO not select any date)
  4. Click button "set date"
  5. Click on the (local-1) datepicker
  6. time zone will be set to local timezone -1 (correct)
  7. All other datepicker will show correct timezone

Kind regards, Igor