Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Date changed when DST begins #17

Open
riotera opened this issue Jan 17, 2017 · 1 comment
Open

Date changed when DST begins #17

riotera opened this issue Jan 17, 2017 · 1 comment

Comments

@riotera
Copy link

riotera commented Jan 17, 2017

Hi,

when Daylight Saving Time begins there is a gap in local time because the clocks are adjusted. For instance, in Brazil the day 15/10/2017 is the date when the DST starts. Some browser like Safari when the date is created in line https://github.com/mydea/PikadayResponsive/blob/master/src/pikaday-responsive.js#L148:

obj.date = moment(val, settings.format);

if the the val = '15/10/2017' the date will be set as 14/10/2017 (in Brazil).

In my tests the line should be:

obj.date = moment(val, settings.format).utc();

The UTC time has no DST so the date will not be changed

@mydea
Copy link
Owner

mydea commented Feb 6, 2017

Hmm, not sure if converting all dates to UTC is always the desired option? If you would, for example, add a time to that date object afterwards, the generated Moment object would have a wrong time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants