Skip to content

Commit

Permalink
comments
Browse files Browse the repository at this point in the history
  • Loading branch information
ptomato committed May 14, 2021
1 parent ec3974a commit 3e0e935
Show file tree
Hide file tree
Showing 25 changed files with 34 additions and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ <h2 id="syntax">Syntax</h2>

<h2 id="value">Value</h2>

<p>An integer representing the weekday number on which the date falls. In the ISO 8601 calendar, this is always <code>7</code>, but in other calendar systems the value may vary from week to week.</p>
<p>An integer representing the weekday number on which the date falls.

<h2 id="examples">Examples</h2>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ <h2 id="syntax">Syntax</h2>

<h2 id="value">Value</h2>

<p>An integer representing the weekday number on which the date falls. In the ISO 8601 calendar, this is always <code>7</code>, but in other calendar systems the value may vary from week to week.</p>
<p>An integer representing the weekday number on which the date falls.</p>

<h2 id="examples">Examples</h2>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<h2 id="syntax">Syntax</h2>

<pre class="brush: js">
var newDateTime = Temporal.PlainDateTime.withPlainTime(<var>plainTime</var>);
var newDateTime = dateTime.withPlainTime(<var>plainTime</var>);
</pre>

<h3 id="parameters">Parameters</h3>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<h2 id="syntax">Syntax</h2>

<pre class="brush: js">
date.getISOFields();
monthDay.getISOFields();
</pre>

<h3 id="parameters">Parameters</h3>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
{{JSRef}}

<p class="summary"><span class="seoSummary">A month-and-day object which is not associated with a specific year, even if a specific year is used in its creation.</span> It is useful to represent a yearly recurring event, such as "our wedding anniversary is October 20th" or "Bastille Day is on the 14th of July."</p>
<p>A <code>Temporal.PlainMonthDay</code> can be converted into a <code>{{jsxref('Temporal.PlainDate','Temporal.PlainDate')}}</code> by combining it with a year, using the <code>{{jsxref('Temporal.PlainMonthDay.toPlainDate()','Temporal.PlainMonthDay.toPlainDate()')}}</code> method. If you need to refer to a certain instance of a calendar event in a particular year, use <code>{{jsxref('Temporal.PlainDate','Temporal.PlainDate')}}</code> or even <code>{{jsxref('Temporal.PlainDateTime','Temporal.PlainDateTime')}}</code> instead.</p>
<p>A <code>Temporal.PlainMonthDay</code> can be converted into a <code>{{jsxref('Temporal.PlainDate','Temporal.PlainDate')}}</code> by combining it with a year, using the <code>{{jsxref('Temporal.PlainMonthDay/toPlainDate','Temporal.PlainMonthDay.toPlainDate()')}}</code> method. If you need to refer to a certain instance of a calendar event in a particular year, use <code>{{jsxref('Temporal.PlainDate','Temporal.PlainDate')}}</code> or even <code>{{jsxref('Temporal.PlainDateTime','Temporal.PlainDateTime')}}</code> instead.</p>

<h2>Constructor</h2>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
{{JSRef}}

<p class="summary"><span class="seoSummary">The <strong><code>monthCode</code></strong> read-only property returns a calendar-specific string that identifies the month in a year-independent manner.</span></p>
<p>Note that <code>{{jsxref('Temporal.PlainMonthDay','Temporal.PlainMonthDay')}}</code> has no <code>month</code> property, because month names are ambiguous for some calendars without knowing the year. Instead, the <code>monthCode</code> property is used which is year-independent in all calendars.</p>
<p>Note that <code>{{jsxref('Temporal.PlainMonthDay','Temporal.PlainMonthDay')}}</code> has no <code>month</code> property, because month numbers are ambiguous for some calendars without knowing the year. Instead, the <code>monthCode</code> property is used which is year-independent in all calendars.</p>


<h2 id="syntax">Syntax</h2>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
---
{{JSRef}}

<p class="summary"><span class="seoSummary">Returns a string representing the month and day in ISO 8601 format.</span> This method provides a useful value when a <code>{{jsxref('Temporal.PlainMonthDay','Temporal.PlainMonthDay')}}</code> object is passed to <code>{{jsxref('JSON.stringify','JSON.stringify()')}}</code>. It is rarely useful in any other context. If you simply need a string containing the calendar's ID, use <code>{{jsxref('Temporal/PlainMonthDay/toString','Temporal.PlainMonthDay.toString()')}}</code> instead.</p>
<p class="summary"><span class="seoSummary">Returns a string representing the month and day in ISO 8601 format.</span> This method provides a useful value when a <code>{{jsxref('Temporal.PlainMonthDay','Temporal.PlainMonthDay')}}</code> object is passed to <code>{{jsxref('JSON.stringify','JSON.stringify()')}}</code>. It is rarely useful in any other context. If you simply need to serialize the month and day to an ISO 8601 string, use <code>{{jsxref('Temporal/PlainMonthDay/toString','Temporal.PlainMonthDay.toString()')}}</code> instead.</p>
</p>
<p>
The reverse operation, recovering a <code>{{jsxref('Temporal/PlainMonthDay','Temporal.PlainMonthDay')}}</code> object from a string, is accomplished by using <code>{{jsxref('Temporal/PlainMonthDay/from','Temporal.PlainMonthDay.from()')}}</code>, but that method cannot be called automatically by <code>{{jsxref('JSON.parse','JSON.parse()')}}</code>. If you need to rebuild a <code>{{jsxref('Temporal/PlainMonthDay','Temporal.PlainMonthDay')}}</code> object from a JSON string, then you need to know the names of the keys that should be interpreted as <code>{{jsxref('Temporal/PlainMonthDay','Temporal.PlainMonthDay')}}</code> properties. In that case, you can build a custom "reviver" function for your use case.
Expand All @@ -19,7 +19,7 @@
<h2 id="syntax">Syntax</h2>

<pre class="brush: js">
Calendar.toJSON();
monthDay.toJSON();
</pre>

<h3 id="parameters">Parameters</h3>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<h2 id="syntax">Syntax</h2>

<pre class="brush: js">
date.toLocaleString(<var>locales</var>, <var>options</var>);
monthDay.toLocaleString(<var>locales</var>, <var>options</var>);
</pre>

<h3 id="parameters">Parameters</h3>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<h2 id="syntax">Syntax</h2>

<pre class="brush: js">
date.toPlainDate(<var>year</var>);
monthDay.toPlainDate(<var>year</var>);
</pre>

<h3 id="parameters">Parameters</h3>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<h2 id="syntax">Syntax</h2>

<pre class="brush: js">
Calendar.toString(<var>options</var>);
monthDay.toString(<var>options</var>);
</pre>

<h3 id="parameters">Parameters</h3>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<h2 id="syntax">Syntax</h2>

<pre class="brush: js">
date.valueOf();
monthDay.valueOf();
</pre>

<h3 id="parameters">Parameters</h3>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@
<h2 id="syntax">Syntax</h2>

<pre class="brush: js">
var monthLabel = date.daysInMonth;
var monthLength = date.daysInMonth;
</pre>


<h2 id="value">Value</h2>

<p>An integer representing the number of days in the month. This is <code>28</code>, <code>29</code>, <code>30</code>, or <code>31</code>, depending on the month and whether the year is a leap year.</p>
<p>An integer representing the number of days in the month. In the ISO 8601 calendar, this is <code>28</code>, <code>29</code>, <code>30</code>, or <code>31</code>, depending on the month and whether the year is a leap year.</p>

<h2 id="examples">Examples</h2>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ <h2 id="syntax">Syntax</h2>

<h2 id="value">Value</h2>

<p>An boolean set to <code>true</code> if the date occurs in a leap year, or <code>false</code> if not.</p>
<p>The boolean value <code>true</code> if the date occurs in a leap year, or <code>false</code> if not.</p>

<h2 id="examples">Examples</h2>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
---
{{JSRef}}

<p class="summary"><span class="seoSummary">Returns a string representing the year and month in ISO 8601 format.</span> This method provides a useful value when a <code>{{jsxref('Temporal.PlainYearMonth','Temporal.PlainYearMonth')}}</code> object is passed to <code>{{jsxref('JSON.stringify','JSON.stringify()')}}</code>. It is rarely useful in any other context. If you simply need a string containing the calendar's ID, use <code>{{jsxref('Temporal/PlainYearMonth/toString','Temporal.PlainYearMonth.toString()')}}</code> instead.</p>
<p class="summary"><span class="seoSummary">Returns a string representing the year and month in ISO 8601 format.</span> This method provides a useful value when a <code>{{jsxref('Temporal.PlainYearMonth','Temporal.PlainYearMonth')}}</code> object is passed to <code>{{jsxref('JSON.stringify','JSON.stringify()')}}</code>. It is rarely useful in any other context. If you simply need to serialize the year and month to an ISO 8601 string, use <code>{{jsxref('Temporal/PlainYearMonth/toString','Temporal.PlainYearMonth.toString()')}}</code> instead.</p>
</p>
<p>
The reverse operation, recovering a <code>{{jsxref('Temporal/PlainYearMonth','Temporal.PlainYearMonth')}}</code> object from a string, is accomplished by using <code>{{jsxref('Temporal/PlainYearMonth/from','Temporal.PlainYearMonth.from()')}}</code>, but that method cannot be called automatically by <code>{{jsxref('JSON.parse','JSON.parse()')}}</code>. If you need to rebuild a <code>{{jsxref('Temporal/PlainYearMonth','Temporal.PlainYearMonth')}}</code> object from a JSON string, then you need to know the names of the keys that should be interpreted as <code>{{jsxref('Temporal/PlainYearMonth','Temporal.PlainYearMonth')}}</code> properties. In that case, you can build a custom "reviver" function for your use case.
Expand All @@ -19,7 +19,7 @@
<h2 id="syntax">Syntax</h2>

<pre class="brush: js">
Calendar.toJSON();
yearMonth.toJSON();
</pre>

<h3 id="parameters">Parameters</h3>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,11 @@ <h3 id="parameters">Parameters</h3>
<dl>
<dt><code><var>day</var></code></dt>
<dd>
<p>An object representing a valid day of the month to be used in constructing the <code>{{jsxref('Temporal.PlainDate','Temporal.PlainDate')}}</code>. If the day value is out of range for the month, a <code>RangeError</code> will be thrown.</p>
<p>An object representing a valid day of the month to be used in constructing the <code>{{jsxref('Temporal.PlainDate','Temporal.PlainDate')}}</code> via one property:</p>
<dl>
<dt><code>day</code></dt>
<dd><p>An integer representing a valid day of the month. If the value is out of range for the month, a <code>RangeError</code> will be thrown.</p></dd>
</dl>
</dd>
</dl>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<h2 id="syntax">Syntax</h2>

<pre class="brush: js">
<var>PlainYearMonth</var>.valueOf();
<var>yearMonth</var>.valueOf();
</pre>

<h3 id="parameters">Parameters</h3>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ <h2 id="syntax">Syntax</h2>

<h2 id="value">Value</h2>

<p>An integer representing the weekday number on which the date falls. In the ISO 8601 calendar, this is always <code>7</code>, but in other calendar systems the value may vary from week to week.</p>
<p>An integer representing the weekday number on which the date falls.</p>

<h2 id="examples">Examples</h2>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
{{JSRef}}

<p class="summary"><span class="seoSummary">The <strong><code>epochMilliseconds</code></strong> read-only property returns the number of full milliseconds between the <code>{{jsxref('Temporal.zonedDateTime','Temporal.zonedDateTime')}}</code> object and 00:00 UTC on 1970-01-01, otherwise known as the UNIX Epoch. Any fractional remainders are truncated towards zero.</p>
<p>The <code>epochMilliseconds</code> property is the easiest way to construct a legacy <code>{{jsxref('Date')}}</code> object from a <code>{{jsxref('Temporal.ZonedDateTime','Temporal.ZonedDateTime')}}</code> object.</p>
<p>Using the value of the <code>epochMilliseconds</code> property is the easiest way to construct a legacy <code>{{jsxref('Date')}}</code> object from a <code>{{jsxref('Temporal.ZonedDateTime','Temporal.ZonedDateTime')}}</code> object.</p>

<h2 id="syntax">Syntax</h2>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
---
{{JSRef}}

<p class="summary"><span class="seoSummary">The <strong><code>epochSeconds</code></strong> read-only property returns the number of full seconds between the <code>{{jsxref('Temporal.zonedDateTime','Temporal.zonedDateTime')}}</code> object and 00:00 UTC on 1970-01-01, otherwise known as the UNIX Epoch. Any fractional remainders are truncated towards zero.</p>
<p class="summary"><span class="seoSummary">The <strong><code>epochSeconds</code></strong> read-only property returns the number of full seconds between the <code>{{jsxref('Temporal.ZonedDateTime','Temporal.ZonedDateTime')}}</code> object and 00:00 UTC on 1970-01-01, otherwise known as the UNIX Epoch. Any fractional remainders are truncated towards zero.</p>


<h2 id="syntax">Syntax</h2>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ <h2 id="return-value">Return value</h2>
<code>isoMillisecond</code>,
<code>isoMicrosecond</code>,
<code>isoNanosecond</code>,
<code>offset</code>,
<code>timeZone</code>,
and
<code>calendar</code> properties.</p>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

<p class="summary"><span class="seoSummary">The <strong><code>offsetNanoseconds</code></strong> read-only property is the offset (in nanoseconds) relative to UTC of the <code>{{jsxref('Temporal.ZonedDateTime','Temporal.ZonedDateTime')}}</code> object's time zone.</span> The value of this field will change after DST (Daylight Saving Time) transitions or after political changes to a time zone, e.g. a country switching to a new time zone.</p>

<p>The <code>offsetNanoseconds</code> property is ignored in <code>{{jsxref('Temporal/ZonedDateTime/with','.with()')}}</code> and <code>{{jsxref('Temporal/ZonedDateTime/from','.from()')}}</code>. To change the offset using <code>{{jsxref('Temporal/ZonedDateTime/with','.with()')}}</code> (or from using an object instead of a string), use the string-typed <code>{{jsxref('Temporal/ZonedDateTime/offset','offset')}}</code> property.</p>
<p>The <code>offsetNanoseconds</code> property is ignored in <code>{{jsxref('Temporal/ZonedDateTime/with','.with()')}}</code> and <code>{{jsxref('Temporal/ZonedDateTime/from','.from()')}}</code>. To change the offset using <code>{{jsxref('Temporal/ZonedDateTime/with','.with()')}}</code> (or <code>{{jsxref('Temporal/ZonedDateTime/from','from()')}}</code> using an object instead of a string), use the string-typed <code>{{jsxref('Temporal/ZonedDateTime/offset','offset')}}</code> property.</p>

<h2 id="syntax">Syntax</h2>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ <h2 id="value">Value</h2>
<h2 id="examples">Examples</h2>

<pre class="brush: js">
zdt = Temporal.ZonedDateTime.from('2020-01-01T12:00-08:00[America/Los_Angeles]').startOfDay();
zdt = Temporal.ZonedDateTime.from('2020-01-01T12:00-08:00[America/Los_Angeles]').startOfDay;
// => 2020-01-01T00:00:00-08:00[America/Los_Angeles]
zdt = Temporal.ZonedDateTime.from('2018-11-04T12:00-02:00[America/Sao_Paulo]').startOfDay();
zdt = Temporal.ZonedDateTime.from('2018-11-04T12:00-02:00[America/Sao_Paulo]').startOfDay;
// => 2018-11-04T01:00:00-02:00[America/Sao_Paulo]
// Note the 1:00AM start time because the first clock hour was skipped due to DST transition
// that started at midnight.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
---
{{JSRef}}

<p class="summary"><span class="seoSummary">The <strong><code>timeZone</code></strong> read-only property represents the persistent time zone of the <code>{{jsxref('Temporal.zonedDateTime','Temporal.zonedDateTime')}}</code> object.</span> By storing its time zone, <code>{{jsxref('Temporal.ZonedDateTime','Temporal.ZonedDateTime')}}</code> is able to use that time zone when deriving other values, e.g. to automatically perform DST (Daylight Saving Time) adjustment when adding or subtracting time.</p>
<p class="summary"><span class="seoSummary">The <strong><code>timeZone</code></strong> read-only property represents the persistent time zone of the <code>{{jsxref('Temporal.ZonedDateTime','Temporal.ZonedDateTime')}}</code> object.</span> By storing its time zone, <code>{{jsxref('Temporal.ZonedDateTime','Temporal.ZonedDateTime')}}</code> is able to use that time zone when deriving other values, e.g. to automatically perform DST (Daylight Saving Time) adjustment when adding or subtracting time.</p>

<p>The time zone is a required property when creating <code>{{jsxref('Temporal.ZonedDateTime','Temporal.ZonedDateTime')}}</code> instances. If you don't know the time zone of your underlying data, use <code>{{jsxref('Temporal.Instant','Temporal.Instant')}}</code> and/or <code>{{jsxref('Temporal.PlainDateTime','Temporal.PlainDateTime')}}</code>, neither of which have awareness of time zones. To change the time zone while keeping the exact time constant, use the <code>{{jsxref('Temporal.ZonedDateTime/withTimeZone','Temporal.ZonedDateTime.withTimeZone()')}}</code> method.</p>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<h2 id="syntax">Syntax</h2>

<pre class="brush: js">
var isoString = date.toString(<var>options</var>);
var isoString = datetime.toString(<var>options</var>);
</pre>

<h3 id="parameters">Parameters</h3>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ <h3 id="parameters">Parameters</h3>

<dl>
<dt><code><var>plainTime</var></code></dt>
<dd>The clock time that should replace the current clock time of the original <code>{{jsxref('Temporal.ZonedDateTime','Temporal.ZonedDateTime')}}</code> object. An object containing some or all of the properties accepted by <code>{{jsxref('Temporal/ZonedDateTime/from','Temporal.ZonedDateTime.from()')}}</code>. Valid input to <code>withPlainTime()</code> is the same as valid input to <code>{{jsxref('Temporal/PlainTime/from','Temporal.PlainTime.from()')}}</code>: strings like <code>12:15:36</code>, plain objects like <code>{ hour: 20, minute: 30 }</code>, or Temporal objects that contain time fields: <code>{{jsxref('Temporal.PlainTime','Temporal.PlainTime')}}</code>, <code>{{jsxref('Temporal.PlainDateTime','Temporal.PlainDateTime')}}</code>, or <code>{{jsxref('Temporal.ZonedDateTime','Temporal.ZonedDateTime')}}</code>.
<dd>The clock time that should replace the current clock time of the original <code>{{jsxref('Temporal.ZonedDateTime','Temporal.ZonedDateTime')}}</code> object. Valid input to <code>withPlainTime()</code> is the same as valid input to <code>{{jsxref('Temporal/PlainTime/from','Temporal.PlainTime.from()')}}</code>: strings like <code>12:15:36</code>, plain objects like <code>{ hour: 20, minute: 30 }</code>, or Temporal objects that contain time fields: <code>{{jsxref('Temporal.PlainTime','Temporal.PlainTime')}}</code>, <code>{{jsxref('Temporal.PlainDateTime','Temporal.PlainDateTime')}}</code>, or <code>{{jsxref('Temporal.ZonedDateTime','Temporal.ZonedDateTime')}}</code>.
</dd>
</dl>

Expand Down

0 comments on commit 3e0e935

Please sign in to comment.