Plugins

User login
Can't find a Plugin?

Can't find a Plugin you are looking for? Check out the jQuery Wiki page.

Are you a plugin developer? Please move your plugin over to this site.

Website Bug or Feature Request?

Found a bug on the new jQuery Plugin website? Have a feature request?

Submit it to the jQuery Plugin website issue queue to ensure it is noticed!

[Fixed] Incorrect date calculation in certain time zones


Project:Date Input
Version:1.1.6
Component:Code
Category:bug report
Priority:critical
Assigned:Unassigned
Status:closed
Description

I don't know why but for March month 2009 dates are calculated incorrect. The calendar displays two days with "28". See attachment for example.

Also there is a bigger problem for April 2009 when start of week is "0" (Sunday)

Thank you for great calendar!

AttachmentSize
April 2009.png2 KB
March 2009.png13.13 KB
March 2009.png13.13 KB

Comments

#1

Sorry I'm not able to duplicate this at all. What browser are you using? Have you modified the plugin in any way?

#2

Status:active» closed

Please re-open if you still consider this to be an issue.

#3

Status:closed» active

Testing files - I included clean version 1.1.6 in a test file. See zip attached. - Bug with March, April months, when week starts on Sunday.

Browsers: Firefox 3, IE 7...

Thank you!

AttachmentSize
date_input.zip27.58 KB

#4

Status:active» active (needs more info)

I've downloaded your zip folder and run the test file in there - I still see no issue on my own computer. I don't know if this is possible, but perhaps there is something wrong with your computer's clock? Or perhaps it is affected by time zone somehow - what time zone are you in? Could you try it on a different time zone/computer?

Cheers

#5

Status:active (needs more info)» active

You are right! it depends on time zone.
In GMT +2 there is this bug. in GMT -5 it's ok!

#6

Ok, this is very strange! I am not able to reproduce the bug on Linux (my usual platform), but under Windows, if I set the timezone to GMT +2, I see April 30th 2009 appear twice. I do not see March 28th 2009 appear twice, however.

I will look into it, though I can't promise how soon I will find the time.

#7

Title:March and April months incorrect calculate» Incorrect date calculation in certain time zones
Priority:normal» critical

#8

Same thing here.
I'm in time zone GMT +2, and using version 1.1.6.

I found the same bug in March 1994. it shows the date 31 twice, and then you can't navigate further to April.

The problem occured in firefox 2.xx on Linux Mephis 6.5.
I tried to recreate it on IE6 and on Firefox 3.0.3 under Windows XP but in both platforms the date showed OK.

#9

Title:Incorrect date calculation in certain time zones» [Fixed] Incorrect date calculation in certain time zones
Version:1.1.5» 1.1.6

Hi everybody.

This bug is related with math operations on Date functions. On single precision math, milliseconds diference makes date drop on previous day-number. To solve it just set current day at noon at line 84. Replace

var currentDay = new Date(rangeStart.getFullYear(), rangeStart.getMonth(), rangeStart.getDate() + i);

for this

var currentDay = new Date(rangeStart.getFullYear(), rangeStart.getMonth(), rangeStart.getDate() + i,12,00);

Still.. this don't solve everything.. one more thing is stringToDate function. Same call on Date at line 150.

return new Date(matches[3], this.shortMonthNum(matches[2]), matches[1]);

goes to

return new Date(matches[3], this.shortMonthNum(matches[2]), matches[1],12,00);

Thanks to jonleighton for this great calendar.
Regards

Arsenicus

#10

Thanks, I've committed this: http://github.com/jonleighton/date_input/commit/8931219512e91c4862b6b3eb...

Will make a new release shortly.

#11

Status:active» closed