-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Specify Date.UTC when called with fewer than two arguments #642
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25643,7 +25643,7 @@ <h1>Date.prototype</h1> | |
<!-- es6num="20.3.3.4" --> | ||
<emu-clause id="sec-date.utc"> | ||
<h1>Date.UTC ( _year_, _month_ [ , _date_ [ , _hours_ [ , _minutes_ [ , _seconds_ [ , _ms_ ] ] ] ] ] )</h1> | ||
<p>When the `UTC` function is called with fewer than two arguments, the behaviour is implementation-dependent. When the `UTC` function is called with two to seven arguments, the following steps are taken:</p> | ||
<p>When the `UTC` function is called, the following steps are taken:</p> | ||
<emu-alg> | ||
1. Let _y_ be ? ToNumber(_year_). | ||
1. Let _m_ be ? ToNumber(_month_). | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @bterlson I just want to confirm this for clarification: we'll have a different behavior for supplied but undefined month. Like the following expected values: Date.UTC(2016) // 1451606400000
Date.UTC(2016, 0) // 1451606400000
Date.UTC(2016, undefined) // NaN This will be consistent with the other parameters, but There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is also consistent with the Date constructor: new Date(2016, 0) // Fri Jan 01 2016 00:00:00 GMT+0100 (CET)
new Date(2016, undefined) // Invalid Date There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, this is just how it is :-P |
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
_month_
is optional now.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
corrected