-
Notifications
You must be signed in to change notification settings - Fork 29
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
Time zone problems #3
Comments
Hi Tyler, I can't look into this today but I'll have a look at the weekend. I don't The service does the date checking and provides the reference data. There I will have a look at the UTC issue. I live in Ireland so I am at UTC time Cheers, On 12 March 2014 23:12, Tyler Akins notifications@github.com wrote:
|
new Date(date.year, date.month, date.day) should do |
vikrama is correct about this. Just forget the Date.UTC bit as JS always converts every date to local so you just end up with a non-midnight time in any other timezone which then needs to be converted back to UTC to actually get the midnight time (and correct date, if you are in a negative offset timezone). This obviously could be a breaking change but it requires significant more work to use as is than with vikrama's fix I'll submit the pull request. |
I am having a hard time using this plugin because I am not in UTC. In
validateDate
one makes a newDate
object. Mine looks like this in my console:This date does not validate because of the following check:
d.getDate() === Number(date.day)
I passed in the day of 12 and because I live in CST, the date now appears to be 11.
The text was updated successfully, but these errors were encountered: