Closed GoogleCodeExporter closed 8 years ago
We had the same issue. It was because of timezone change during that week. The
addDays method in date.js fails to take timezone change into consideration.
Change the following code in date.js to fix the issue.
From
add("addDays", function(num) {
//this.setDate(this.getDate() + num);
this.setTime(this.getTime() + (num*86400000) );
return this;
});
To
add("addDays", function(num) {
//Get the time zone offset for the time
var diff = (this.getTimezoneOffset());
this.setTime(this.getTime() + (num*86400000) );
//Get the time zone offset for the new time
var diff2 = this.getTimezoneOffset();
//If timezone offset is different, happens when time zone changes for e.g. EST to EDT
if(diff2!=diff){
//Adjust the difference
this.setTime(this.getTime() + ((diff2-diff)*60*1000));
}
return this;
});
Original comment by tnlk...@gmail.com
on 18 Mar 2013 at 6:37
Thanks! That sounds like a good solution to a problem which has been causing
lots of people trouble for a long time. Added to the plugin:
https://github.com/vitch/jquery-methods/commit/e02cfc83280686785b721b58012169cdb
f92d456
https://github.com/vitch/jQuery-datepicker/commit/5ec5b66a683690504bb1205e76cabe
5be93e67aa
Original comment by kelvin.l...@gmail.com
on 24 Mar 2013 at 10:17
Great solution - Thanks for posting it. :-)
Original comment by p...@i2in.com
on 25 Mar 2013 at 12:55
Original issue reported on code.google.com by
philpar...@gmail.com
on 11 Jan 2013 at 9:58Attachments: