Converted all date/time handling and tests to use UTC #462
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes annoying timezone and normalization issues.
For example, this is the output I get when I pick a date on the API page and click "Log the select" for June 18, 2014:
Take a close look at the difference between "date" and the actual date in the object/pick. I noticed this whilst working on an application and noticed it submitted the dates with a day off. First I thought this was a normalization error but then I realized it was exactly two hours off (my timezone is UTC+2, the Netherlands) and figured it wasn't using UTC dates but local times!
After converting all code and tests to use UTC dates/times everything works as expected and all tests pass. Ran the tests before and after midnight to ensure everything is working as expected. The new API page now gives me the result I expected:
As you can see, the time is set to midnight properly and the date obj/pick matches the others.
It is much better and easier to work with UTC values for a date picker, specially when using these values in your application and/or storing it in the database.
Hopefully this can be merged quickly 👍