freqdec / datePicker

An attempt at writing a flexible, framework free, feature-rich and accessible datepicker
http://freqdec.github.io/datePicker/
MIT License
171 stars 56 forks source link

You can't select 21th october #11

Closed riotera closed 11 years ago

riotera commented 12 years ago

I will try to understand why but if you select 21th october the calendar picks the 20th and overwrite the calendar.

Marco

riotera commented 12 years ago

it's due to daylight saving time, in Brazil enter on 21th october, so the time go back to 1 hour (20th october, 23:00)

freqdec commented 12 years ago

Hi - you've spotted a bug. I thought that I always set the hour to be 5a.m. to stop daylight savings sillyness like this. I shall have to relook at the code to see where I missed setting the hour!

riotera commented 12 years ago

Hi,

I solved the problem in this way, at line 1473:

o.date       = new Date(cellDate.substr(0,4),cellDate.substr(4,2)-1,cellDate.substr(6,2), 12, 0, 0); 

I don't know if it is the only place to do it and if it is the best solution.

freqdec commented 11 years ago

A long time in coming but I've just updated the code to always set the hour to 5am which should stop daylight savings problems such as this.