简体   繁体   English

jquery.timepicker DST问题?

[英]jquery.timepicker DST issue?

I am using the jQuery plugin jquery.timepicker 我正在使用jQuery插件jquery.timepicker

var dateObj = new Date("Mon, 05 Nov 2012 06:30:00 -0600");
$('#my_start_time_id').timepicker('setTime', dateObj);

But the time set is shifting back by one hour. 但是设定的时间向后移了一个小时。 That is, the time set to $('#my_start_time_id') is 5.30am instead of 6.30am . 也就是说,设定的时间$('#my_start_time_id')5.30am ,而不是6.30am

I am seeing this issue after today's DST changes. 今天的DST更改后,我看到了这个问题。 Could you please give some hints to fix this issue? 您能否提供一些解决此问题的提示?

Note : I checked the value of 'dateObj' it is Mon Nov 05 2012 06:30:00 GMT-0600 (CST) 注意 :我检查了“ dateObj”的值,它是Mon Nov 05 2012 06:30:00 GMT-0600 (CST)

This was due to a bug in jquery.timepicker plugin on DST transition day. 这是由于DST过渡日jquery.timepicker插件中的错误。 Inside this plugin, it uses a variable called '_baseDate' which is set to starting a day.The _baseDate should be adjusted on DST transition day(Like Nov 4th 2012 in US timezones) 在此插件内部,它使用名为“ _baseDate”的变量,该变量设置为开始一天。_baseDate应该在DST转换日(如美国时区的2012年11月4日)进行调整。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM