umair96 / jquery-datepicker

Automatically exported from code.google.com/p/jquery-datepicker
0 stars 0 forks source link

Duplicate Day in November for Daylight Savings Sunday #250

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?

Any November selected.  All other months are ok.

What is the expected output? 

30 days.  
ie in 2010: 
Sunday the 7th.  
Monday the 8th.  
Tuesday the 9th... Tuesday the 30th

What do you see instead?

30 days with one number repeated. 
ie in 2010: 
Sunday the 7th.  
Monday the 7th.
Tuesday the 8th...  Wednesday the 30th

Please provide a URL to a page displaying the problem.

Unfortunately, my pages are behind log ins, but from reading, I believe output 
is client system dependent.

Although, your demo site works fine even with my system settings.

See "more info" below

What version of the datepicker are you using? On what operating system? And 
Which Browser?

Datepicker 2.1.2
Windows XP SP3
Chrome 7.0.517.44 / IE 8.0.6001.18702

Please provide any additional information below.

After reading the thread #22, Duplicate March 28, this is a similar issue.  
It's all about the system's daylight savings time settings.  I am in GMT + 4 
time zone, and our daylight savings time occurred this past Sunday.  So I 
suppose, the date picker is noticing Sunday the 7th (and all of the first 
Sundays in November) have 25 hours instead of 24, and is translating that into 
an extra day.  I don't know quite enough about your code, but from the other 
thread, this function:

    add("addDays", function(num) {
        //this.setDate(this.getDate() + num);
        this.setTime(this.getTime() + (num*86400000) );
        return this;
    });

could have some sort of hack in place to subtract a day if it is November, or 
calculate the days differently if you can tell how the client system is 
counting hours in the month.

Anyhow, in Windows, if I go to the Date and Time properties, and in the Time 
Zone tab, uncheck "Automatically adjust clock for daylight savings changes", 
the calendar renders properly.  See attached images.

Thanks,
Aaron

Original issue reported on code.google.com by aaronlan...@gmail.com on 9 Nov 2010 at 9:04

Attachments:

GoogleCodeExporter commented 8 years ago
Thanks for the detailed bug report. I believe this bug has been fixed, however. 
Please use the latest version of the date picker code, either from svn or 
direct from my website:
http://www.kelvinluck.com/assets/jquery/datePicker/v2/demo/scripts/jquery.datePi
cker.js

Let me know if that fixes it,

Kelvin :)

Original comment by kelvin.l...@gmail.com on 9 Nov 2010 at 9:11

GoogleCodeExporter commented 8 years ago
Ah, indeed it is fixed now.  Oh well, a good exercise in deductive reasoning 
for me!

Thanks

Original comment by aaronlan...@gmail.com on 9 Nov 2010 at 9:31

GoogleCodeExporter commented 8 years ago
Glad it's fixed :)

Original comment by kelvin.l...@gmail.com on 9 Nov 2010 at 9:51