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

Fix broken getCurrentTime() method in Safari #293

Merged
merged 1 commit into from Sep 23, 2016

Conversation

Projects
None yet
2 participants
@westonruter
Contributor

westonruter commented Sep 23, 2016

In Safari, but not other browsers, new Date( "2016-09-23 14:57:10" ) is an Invalid Date. It turns out that including T delimiting the date from the time causes it to work in Safari, so this PR implements that.

@westonruter westonruter added the bug label Sep 23, 2016

@westonruter westonruter added this to the 0.8.1 milestone Sep 23, 2016

@westonruter westonruter merged commit f751b32 into develop Sep 23, 2016

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details

@westonruter westonruter deleted the bugfix/safari-get-current-time branch Sep 23, 2016

@westonruter

This comment has been minimized.

Contributor

westonruter commented Oct 4, 2016

@delawski fun fact, in Chrome (and Safari) when you supply the T it is then the datetime string is interpreted to be in UTC. In Chrome when you don't have the T it interprets it in the local timezone (and Safari fails completely).

@delawski

This comment has been minimized.

Contributor

delawski commented Oct 4, 2016

@westonruter wow, I didn't know that making dates work in JS is still a challenge, even though it's 2016 already!

If there was a need to do complex operations on dates, I'd suggest investigating one of the date libraries like Moment.js.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment