My favorites | Sign in
Project Logo
                
New issue | Search
for
| Advanced search | Search tips
Issue 22: duplicate 28 date in March any year
15 people starred this issue and may be notified of changes. Back to list
Status:  Accepted
Owner:  kelvin.luck
Type-Defect
Priority-High


Sign in to add a comment
 
Reported by bstdevelopment, Jan 20, 2009
What steps will reproduce the problem?
check March 28 each year

What is the expected output? What do you see instead?
there are 2 28 dates in March

Please provide a URL to a page displaying the problem.
any demo on your datepicker page

What version of the datepicker are you using? On what operating system? And
Which Browser?
version 2 - any os any browser

Please provide any additional information below.
crytical error

Comment 1 by kelvin.luck, Jan 20, 2009
Thanks for the bug report. This has something to do with timezones and daylight
savings but I have been unable to track it down on my computer (I just tried and all
of the examples on my site are working fine for me). Can you please help me to fix
this by giving me some more information...

What operating system are you using?

What timezone are you in? And what location?

Some people reported this issue in October as well but I couldn't replicate with any
timezone I tried. Hopefully with some further details from you I will be able to fix
the bug,

Thanks,

Kelvin :)
Status: Accepted
Owner: kelvin.luck
Labels: -Priority-Medium Priority-High
Comment 2 by bstdevelopment, Jan 21, 2009
Hello,

I am using XP - the problem appears in firefox and google chrome - i will check ie 
too.

I am based in Bucharest, Romania

Thank you.
Comment 3 by kelvin.luck, Jan 24, 2009
Hi,

I am also running Windows XP. I changed my system time zone to "(GMT+02:00) Athens,
Bucharest, Istanbul" and tried with and without "Automatically adjust clock for
daylight saving changes" ticked. But it all worked fine for me (in IE 7 and Firefox 3).

I tested by visiting this page: 

http://www.kelvinluck.com/assets/jquery/datePicker/v2/demo/datePicker.html

Are you still having the problem? Can you think of anything else on your system which
might be different to mine?

Thanks for helping me to isolate this bug,

Cheers,

Kelvin :)
Comment 4 by bstdevelopment, Jan 25, 2009
Hi Kelvin,

I think it's somekind of javascript bug - it's not because of your code.

The problem is when running XP - I have XP sp3 with GMT+02:00 Bucharest. For all other 
GMT+02:00 everything is running fine. The bug is present at least in IE, Firefox and Google 
Chrome.

I solved the problem in the following way:
in date.js from
-----------------------------------------
add("addDays", function(num) {
		this.setDate(this.getDate() + num);
		return this;
	});
-----------------------------------------
to
-----------------------------------------
add("addDays", function(num) {
                old = this.getDate();
		this.setDate(this.getDate() + num);
                new = this.getDate();
                if(old==new) this.setDate(this.getDate() + num);
		return this;
	});
-----------------------------------------

Comment 5 by kelvin.luck, Jan 25, 2009
Hi,

Thanks for the feedback. Can you please do another test for me? Since I can't see the
bug on my system I can't test the solution!

Can you try the following code instead:

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

Thanks,

Kelvin :)
Comment 6 by kelvin.luck, Feb 14, 2009
Hi,

Sorry, there was a typo in the last example... Can you try the attached date.js
instead of the one you edited and tell me if you have the problem please?

Thanks,

Kelvin :)
date.js
11.8 KB   Download
Comment 8 by e.hany85, Apr 01, 2009
I had the same problem, but for April 2009,when I replaced the date.js file the
problem was fixed.

P.S.:
My timezone is Cairo,+2 GMT.

Comment 9 by kelvin.luck, Apr 01, 2009
 Issue 61  has been merged into this issue.
Comment 10 by kelvin.luck, Apr 01, 2009
Thanks for letting me know that the new date.js fixed the issue. It was a hard one
for me to debug because I couldn't reproduce it whatever I set my timezone too... I
have now updated the date.js in the repository.
Status: Fixed
Comment 11 by e.hany85, Apr 02, 2009
The new date.js file fixed the replicated date in April, but I found out that there
is a replicated date in September after adding it. I don't understand what the
problem could be??!!!!!!!!
Comment 12 by kelvin.luck, Apr 03, 2009
D'oh! I don't understand either! It's definitely related to daylight savings in
certain locales... I'm reopening the ticket and will search for a more robust solution,

Thanks,

Kelvin :)
Status: Accepted
Comment 14 by kmarcok, Apr 04, 2009
Hi Kelvin, I have the same problem also with the new file, but in October 25. I'm in
Italy!
thanks
Marco
Comment 15 by kelvin.luck, Apr 04, 2009
Thanks for the info Marco... I'll keep trying to find a solution...
Comment 16 by kelvin.luck, Apr 05, 2009
 Issue 39  has been merged into this issue.
Comment 17 by kelvin.luck, Apr 05, 2009
Hi Marco,

In r70 I implemented a fix for this issue (hopefully). Can you please test the pages
on my site and see if you are still having any problems?

Thanks,

Kelvin :)
Comment 18 by kelvin.luck, Apr 05, 2009
 Issue 4  has been merged into this issue.
Comment 19 by e.hany85, Apr 07, 2009
The problem became worse now.April 2009 from the day 23 to the end of the month
writes 23. April 2010 from the day 22 to the end of the month writes 22. April 2011
from the day 28 to the end of the month writes 28. May 2011 writes only April's days
24, 25, 26, 27 then 28 to the end month, but I haven't checked any further.
Comment 20 by kmarcok, Apr 07, 2009
Hi Kelvin, the problem has been fixed now, from my pc, many thanks.Marco
Comment 21 by kelvin.luck, Apr 08, 2009
Glad to hear it is working for you Marco :)

But sad to hear it's not for you e.hany! So you are seeing those problems on the
examples on my site? Can you try clearing your cache and viewing the examples again
please? Also, what browser are you using?

Thanks,

Kelvin :)
Comment 22 by e.hany85, Apr 21, 2009
The problem persists on both Firefox & IE
Comment 23 by kelvin.luck, Apr 29, 2009
Does the fix suggested in  issue 70  help you?
Comment 24 by camilo.arthur, Jul 13, 2009
Hi Kelvin, I have the same problem here.
October from the day 17 to the end of the month
writes 17
I have tried fix with the path of  issue 70  that you have indicated but unfortunately
this fix don't solve the Issue 22 :(

I'm in Brazil, running Win XP SP3 with a timezone GMT-03:00.
The problem occurs on Firefox 3.0, 3.5 and IE 7.0.

my best regards,

Camilo
october.JPG
7.1 KB   View   Download
Comment 25 by kelvin.luck, Jul 15, 2009
Please download the latest js file from the googlecode svn repository. I just made
some changes in r80 which should fix this problem...

Let me know if it works,

Kelvin :)
Comment 26 by kelvin.luck, Jul 15, 2009
 Issue 93  has been merged into this issue.
Comment 27 by kelvin.luck, Jul 15, 2009
 Issue 70  has been merged into this issue.
Comment 28 by camilo.arthur, Jul 15, 2009
Hello Kelvin! I guess that this fix works for me! Thanks a lot! 

cheers,

Camilo
Comment 29 by felipe.leusin, Oct 06, 2009
Kelvin,
This fix helped with the rendering but the datepicker selects the wrong date based on
the daylight savings (DST) settings. IE: Here in Brazil DST starts at midnight Oct18,
when I select Oct18 on the datepicker it automatically switches to Oct17.

Maybe besides adding the hours to fix when you render the calendar you might need to
do the same when you get it from the .data of each cell.

I'm having a hard time trying to pin this down though.
Comment 30 by felipe.leusin, Oct 06, 2009
Hi again,
I found a way to fix it. I had to change the fromString method in date.js and switch:
var d = new Date('01/01/1977');
to
var d = new Date('01/01/1977').addHours(12);

I don't know if this is the best fix possible but it did the trick.
Comment 31 by kelvin.luck, Oct 06, 2009
Thanks for the info felipe - can I just confirm that you were having trouble with the
latest date picker code from svn?
Comment 32 by felipe.leusin, Oct 06, 2009
Yes, I used the latest version from the svn. It fixed the problem with the double
rendering of some dates when they were at the DST changing period.
Comment 33 by andy.widodo, Oct 07, 2009
I had the same problem too, at first when the timezone (or server time was GMT+0) and it duplicates 25 of oct 
and then i tested again by changing my local timezone to where i live now (GMT +7) there was no problem, so 
to fix this: 

Change the line :
add("addDays", function(num) {	
		this.setTime(this.getTime() + (num*86400000) );
		return this;
	});

to

add("addDays", function(num) {
		this.setDate(this.getDate() + num);
		return this;
	});

I don't know why but it does the trick

Cheers

Comment 34 by mihai.mocanu, Oct 23, 2009
Hi Kelvin,

I had the same bug (for Oct 25th). The solution of andy.widodo fixed the bug.

I am using Ubuntu 9.04, Firefox 3.0.14, Epiphany 2.26.1. It's the same on Mac OS X
10.6.1, Firefox 3.5.3.

My timezone is GMT+2.
date-picker-bug.png
6.4 KB   View   Download
date-picker-bug-1.png
24.1 KB   View   Download
Comment 35 by mr.jonc, Oct 26, 2009
Hi all,

I had the same issue, but it was November 1st repeated instead of Oct 25th. I assume
that is due to the different date that we get daylight savings time in the US.  
andy.widodo's sol'n worked for me as well FTW!
Comment 36 by ron.gerrits, Oct 29, 2009
Andy you saved my day! Thanks! 
Comment 38 by bgmccollum, Nov 03, 2009
Having the same issue for November 1st being repeated, which corresponds with the our DST change, but the 
bigger issue is that all my days are now a number off.

Sat - 31st (Oct)
Sun - 1st
Mon - 1st
Tue - 2nd
Wed - 3rd
Comment 39 by lewis.ayotte, Nov 19, 2009
two November 1st for me too - andy.widodo's solution worked for me...

tested on Windows XP, Windows 7, and Mac OS - Firefox, IE, Safari - All in EST.
Comment 40 by kelvin.luck, Nov 23, 2009
 Issue 126  has been merged into this issue.
Comment 41 by mm...@mindspring.com, Nov 23, 2009
Ditto for me with the November issue (Sun November 1st, Mon November 1st) on Windows
XP SP2 (EST) in Firefox + IE7 but, oddly, not in IE6.

andy.widodo's solution did the trick!
Sign in to add a comment

Hosted by Google Code