Skip to content
This repository has been archived by the owner on Dec 16, 2022. It is now read-only.

Fix broken getCurrentTime() method in Safari #293

Merged
merged 1 commit into from
Sep 23, 2016

Conversation

westonruter
Copy link
Contributor

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 this to the 0.8.1 milestone Sep 23, 2016
@westonruter westonruter merged commit f751b32 into develop Sep 23, 2016
@westonruter westonruter deleted the bugfix/safari-get-current-time branch September 23, 2016 22:35
@westonruter
Copy link
Contributor Author

@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
Copy link
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 subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants