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

[BUGFIX beta] Ensure ISO-8601 regex correctly matches timestamps #4771

Merged
merged 2 commits into from
Jan 26, 2017

Conversation

tomlagier
Copy link
Contributor

This fixes the case that a timestamp with a timezone offset matches the regex and correctly calls Date.UTC rather than native Date.parse.

See #4764

@@ -46,9 +46,19 @@ test("#deserialize with different offset formats", function(assert) {
var dateStringColon = '2013-03-15T23:22:00.000+00:00';
var dateStringShortOffset = '2016-12-02T17:30:00.000+00';

assert.expect(6);

var _dateUTC = Date.UTC;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should wrap this in a try/finally so that the original Date.UTC always gets restored.

@bmac bmac merged commit 3506441 into emberjs:master Jan 26, 2017
bmac pushed a commit that referenced this pull request Jan 26, 2017
* [BUGFIX beta] Ensure ISO-8601 regex correctly matches timestamps with a timezone offset

* Wrap Date prototype stubbing in try/finally to ensure it always reverts after tests complete

(cherry picked from commit 3506441)
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

Successfully merging this pull request may close these issues.

3 participants