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

Add some Date-related abstract operations #1

Merged
merged 1 commit into from Aug 7, 2014

Conversation

mathiasbynens
Copy link
Contributor

No description provided.

@domenic
Copy link
Owner

domenic commented Aug 7, 2014

Fascinating, I've never seen that section of the spec before.

Lovely work, matching the existing coding and documentation style exactly. Will merge and release a new minor version.

@domenic
Copy link
Owner

domenic commented Aug 7, 2014

Getting a test failure:

  1. Abstract operations DateFromTime should return the date number for a given time value:
    AssertionError: "undefined" === 1

@mathiasbynens
Copy link
Contributor Author

Hmm, the tests are passing for me, so it might be (?) a timezone/locale-related issue caused by the use of new Date(…) in YearFromTime. I’ll look into it.

@mathiasbynens
Copy link
Contributor Author

New York (GMT-5)

> var d = new Date(946684800000);
> d.toISOString();
'2000-01-01T00:00:00.000Z'
> d
Fri Dec 31 1999 19:00:00 GMT-0500 (EST)
> d.getFullYear();
1999

Belgium (GMT+1)

> var d = new Date(946684800000);
> d.toISOString();
'2000-01-01T00:00:00.000Z'
> d
Sat Jan 01 2000 01:00:00 GMT+0100 (CET)
> d.getFullYear();
2000

The solution is to use Date#getUTCFullYear instead of Date#getFullYear. PR updated.

@domenic domenic merged commit 58f0921 into domenic:master Aug 7, 2014
@domenic
Copy link
Owner

domenic commented Aug 7, 2014

Released as 1.7.0!

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.

None yet

2 participants