diff --git a/files/en-us/web/javascript/reference/global_objects/temporal/plaindate/dayofweek/index.html b/files/en-us/web/javascript/reference/global_objects/temporal/plaindate/dayofweek/index.html index 3d44963ab90d379..8329b855b52dd0f 100644 --- a/files/en-us/web/javascript/reference/global_objects/temporal/plaindate/dayofweek/index.html +++ b/files/en-us/web/javascript/reference/global_objects/temporal/plaindate/dayofweek/index.html @@ -21,7 +21,7 @@
An integer representing the weekday number on which the date falls. In the ISO 8601 calendar, this is always 7
, but in other calendar systems the value may vary from week to week.
An integer representing the weekday number on which the date falls.
An integer representing the weekday number on which the date falls. In the ISO 8601 calendar, this is always 7
, but in other calendar systems the value may vary from week to week.
An integer representing the weekday number on which the date falls.
-var newDateTime = Temporal.PlainDateTime.withPlainTime(plainTime); +var newDateTime = dateTime.withPlainTime(plainTime);
-date.getISOFields(); +monthDay.getISOFields();
A month-and-day object which is not associated with a specific year, even if a specific year is used in its creation. 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."
-A Temporal.PlainMonthDay
can be converted into a {{jsxref('Temporal.PlainDate','Temporal.PlainDate')}}
by combining it with a year, using the {{jsxref('Temporal.PlainMonthDay.toPlainDate()','Temporal.PlainMonthDay.toPlainDate()')}}
method. If you need to refer to a certain instance of a calendar event in a particular year, use {{jsxref('Temporal.PlainDate','Temporal.PlainDate')}}
or even {{jsxref('Temporal.PlainDateTime','Temporal.PlainDateTime')}}
instead.
A Temporal.PlainMonthDay
can be converted into a {{jsxref('Temporal.PlainDate','Temporal.PlainDate')}}
by combining it with a year, using the {{jsxref('Temporal.PlainMonthDay/toPlainDate','Temporal.PlainMonthDay.toPlainDate()')}}
method. If you need to refer to a certain instance of a calendar event in a particular year, use {{jsxref('Temporal.PlainDate','Temporal.PlainDate')}}
or even {{jsxref('Temporal.PlainDateTime','Temporal.PlainDateTime')}}
instead.
The monthCode
read-only property returns a calendar-specific string that identifies the month in a year-independent manner.
Note that {{jsxref('Temporal.PlainMonthDay','Temporal.PlainMonthDay')}}
has no month
property, because month names are ambiguous for some calendars without knowing the year. Instead, the monthCode
property is used which is year-independent in all calendars.
Note that {{jsxref('Temporal.PlainMonthDay','Temporal.PlainMonthDay')}}
has no month
property, because month numbers are ambiguous for some calendars without knowing the year. Instead, the monthCode
property is used which is year-independent in all calendars.
Returns a string representing the month and day in ISO 8601 format. This method provides a useful value when a {{jsxref('Temporal.PlainMonthDay','Temporal.PlainMonthDay')}}
object is passed to {{jsxref('JSON.stringify','JSON.stringify()')}}
. It is rarely useful in any other context. If you simply need a string containing the calendar's ID, use {{jsxref('Temporal/PlainMonthDay/toString','Temporal.PlainMonthDay.toString()')}}
instead.
Returns a string representing the month and day in ISO 8601 format. This method provides a useful value when a {{jsxref('Temporal.PlainMonthDay','Temporal.PlainMonthDay')}}
object is passed to {{jsxref('JSON.stringify','JSON.stringify()')}}
. It is rarely useful in any other context. If you simply need to serialize the month and day to an ISO 8601 string, use {{jsxref('Temporal/PlainMonthDay/toString','Temporal.PlainMonthDay.toString()')}}
instead.
The reverse operation, recovering a {{jsxref('Temporal/PlainMonthDay','Temporal.PlainMonthDay')}}
object from a string, is accomplished by using {{jsxref('Temporal/PlainMonthDay/from','Temporal.PlainMonthDay.from()')}}
, but that method cannot be called automatically by {{jsxref('JSON.parse','JSON.parse()')}}
. If you need to rebuild a {{jsxref('Temporal/PlainMonthDay','Temporal.PlainMonthDay')}}
object from a JSON string, then you need to know the names of the keys that should be interpreted as {{jsxref('Temporal/PlainMonthDay','Temporal.PlainMonthDay')}}
properties. In that case, you can build a custom "reviver" function for your use case.
@@ -19,7 +19,7 @@
-Calendar.toJSON(); +monthDay.toJSON();
-date.toLocaleString(locales, options); +monthDay.toLocaleString(locales, options);
-date.toPlainDate(year); +monthDay.toPlainDate(year);
-Calendar.toString(options); +monthDay.toString(options);
-date.valueOf(); +monthDay.valueOf();
-var monthLabel = date.daysInMonth; +var monthLength = date.daysInMonth;
An integer representing the number of days in the month. This is 28
, 29
, 30
, or 31
, depending on the month and whether the year is a leap year.
An integer representing the number of days in the month. In the ISO 8601 calendar, this is 28
, 29
, 30
, or 31
, depending on the month and whether the year is a leap year.
An boolean set to true
if the date occurs in a leap year, or false
if not.
The boolean value true
if the date occurs in a leap year, or false
if not.
Returns a string representing the year and month in ISO 8601 format. This method provides a useful value when a {{jsxref('Temporal.PlainYearMonth','Temporal.PlainYearMonth')}}
object is passed to {{jsxref('JSON.stringify','JSON.stringify()')}}
. It is rarely useful in any other context. If you simply need a string containing the calendar's ID, use {{jsxref('Temporal/PlainYearMonth/toString','Temporal.PlainYearMonth.toString()')}}
instead.
Returns a string representing the year and month in ISO 8601 format. This method provides a useful value when a {{jsxref('Temporal.PlainYearMonth','Temporal.PlainYearMonth')}}
object is passed to {{jsxref('JSON.stringify','JSON.stringify()')}}
. It is rarely useful in any other context. If you simply need to serialize the year and month to an ISO 8601 string, use {{jsxref('Temporal/PlainYearMonth/toString','Temporal.PlainYearMonth.toString()')}}
instead.
The reverse operation, recovering a {{jsxref('Temporal/PlainYearMonth','Temporal.PlainYearMonth')}}
object from a string, is accomplished by using {{jsxref('Temporal/PlainYearMonth/from','Temporal.PlainYearMonth.from()')}}
, but that method cannot be called automatically by {{jsxref('JSON.parse','JSON.parse()')}}
. If you need to rebuild a {{jsxref('Temporal/PlainYearMonth','Temporal.PlainYearMonth')}}
object from a JSON string, then you need to know the names of the keys that should be interpreted as {{jsxref('Temporal/PlainYearMonth','Temporal.PlainYearMonth')}}
properties. In that case, you can build a custom "reviver" function for your use case.
@@ -19,7 +19,7 @@
-Calendar.toJSON(); +yearMonth.toJSON();
day
An object representing a valid day of the month to be used in constructing the {{jsxref('Temporal.PlainDate','Temporal.PlainDate')}}
. If the day value is out of range for the month, a RangeError
will be thrown.
An object representing a valid day of the month to be used in constructing the {{jsxref('Temporal.PlainDate','Temporal.PlainDate')}}
via one property:
day
An integer representing a valid day of the month. If the value is out of range for the month, a RangeError
will be thrown.
-PlainYearMonth.valueOf(); +yearMonth.valueOf();
An integer representing the weekday number on which the date falls. In the ISO 8601 calendar, this is always 7
, but in other calendar systems the value may vary from week to week.
An integer representing the weekday number on which the date falls.
The epochMilliseconds
read-only property returns the number of full milliseconds between the {{jsxref('Temporal.zonedDateTime','Temporal.zonedDateTime')}}
object and 00:00 UTC on 1970-01-01, otherwise known as the UNIX Epoch. Any fractional remainders are truncated towards zero.
The epochMilliseconds
property is the easiest way to construct a legacy {{jsxref('Date')}}
object from a {{jsxref('Temporal.ZonedDateTime','Temporal.ZonedDateTime')}}
object.
Using the value of the epochMilliseconds
property is the easiest way to construct a legacy {{jsxref('Date')}}
object from a {{jsxref('Temporal.ZonedDateTime','Temporal.ZonedDateTime')}}
object.
The epochSeconds
read-only property returns the number of full seconds between the {{jsxref('Temporal.zonedDateTime','Temporal.zonedDateTime')}}
object and 00:00 UTC on 1970-01-01, otherwise known as the UNIX Epoch. Any fractional remainders are truncated towards zero.
The epochSeconds
read-only property returns the number of full seconds between the {{jsxref('Temporal.ZonedDateTime','Temporal.ZonedDateTime')}}
object and 00:00 UTC on 1970-01-01, otherwise known as the UNIX Epoch. Any fractional remainders are truncated towards zero.
isoMillisecond
,
isoMicrosecond
,
isoNanosecond
,
+offset
,
+timeZone
,
and
calendar
properties.
diff --git a/files/en-us/web/javascript/reference/global_objects/temporal/zoneddatetime/offsetnanoseconds/index.html b/files/en-us/web/javascript/reference/global_objects/temporal/zoneddatetime/offsetnanoseconds/index.html
index e11b1dce6428bc7..e56f214aff26b42 100644
--- a/files/en-us/web/javascript/reference/global_objects/temporal/zoneddatetime/offsetnanoseconds/index.html
+++ b/files/en-us/web/javascript/reference/global_objects/temporal/zoneddatetime/offsetnanoseconds/index.html
@@ -11,7 +11,7 @@
The offsetNanoseconds
read-only property is the offset (in nanoseconds) relative to UTC of the {{jsxref('Temporal.ZonedDateTime','Temporal.ZonedDateTime')}}
object's time zone. 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.
The offsetNanoseconds
property is ignored in {{jsxref('Temporal/ZonedDateTime/with','.with()')}}
and {{jsxref('Temporal/ZonedDateTime/from','.from()')}}
. To change the offset using {{jsxref('Temporal/ZonedDateTime/with','.with()')}}
(or from using an object instead of a string), use the string-typed {{jsxref('Temporal/ZonedDateTime/offset','offset')}}
property.
The offsetNanoseconds
property is ignored in {{jsxref('Temporal/ZonedDateTime/with','.with()')}}
and {{jsxref('Temporal/ZonedDateTime/from','.from()')}}
. To change the offset using {{jsxref('Temporal/ZonedDateTime/with','.with()')}}
(or {{jsxref('Temporal/ZonedDateTime/from','from()')}}
using an object instead of a string), use the string-typed {{jsxref('Temporal/ZonedDateTime/offset','offset')}}
property.
-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. diff --git a/files/en-us/web/javascript/reference/global_objects/temporal/zoneddatetime/timezone/index.html b/files/en-us/web/javascript/reference/global_objects/temporal/zoneddatetime/timezone/index.html index 2ae1d164a566171..e153ad72b1f1eeb 100644 --- a/files/en-us/web/javascript/reference/global_objects/temporal/zoneddatetime/timezone/index.html +++ b/files/en-us/web/javascript/reference/global_objects/temporal/zoneddatetime/timezone/index.html @@ -9,7 +9,7 @@ --- {{JSRef}} -The
+timeZone
read-only property represents the persistent time zone of the{{jsxref('Temporal.zonedDateTime','Temporal.zonedDateTime')}}
object. By storing its time zone,{{jsxref('Temporal.ZonedDateTime','Temporal.ZonedDateTime')}}
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.The
timeZone
read-only property represents the persistent time zone of the{{jsxref('Temporal.ZonedDateTime','Temporal.ZonedDateTime')}}
object. By storing its time zone,{{jsxref('Temporal.ZonedDateTime','Temporal.ZonedDateTime')}}
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.The time zone is a required property when creating
diff --git a/files/en-us/web/javascript/reference/global_objects/temporal/zoneddatetime/tostring/index.html b/files/en-us/web/javascript/reference/global_objects/temporal/zoneddatetime/tostring/index.html index b941b5da5ade104..176b8386993f395 100644 --- a/files/en-us/web/javascript/reference/global_objects/temporal/zoneddatetime/tostring/index.html +++ b/files/en-us/web/javascript/reference/global_objects/temporal/zoneddatetime/tostring/index.html @@ -14,7 +14,7 @@{{jsxref('Temporal.ZonedDateTime','Temporal.ZonedDateTime')}}
instances. If you don't know the time zone of your underlying data, use{{jsxref('Temporal.Instant','Temporal.Instant')}}
and/or{{jsxref('Temporal.PlainDateTime','Temporal.PlainDateTime')}}
, neither of which have awareness of time zones. To change the time zone while keeping the exact time constant, use the{{jsxref('Temporal.ZonedDateTime/withTimeZone','Temporal.ZonedDateTime.withTimeZone()')}}
method.Syntax
-var isoString = date.toString(options); +var isoString = datetime.toString(options);Parameters
diff --git a/files/en-us/web/javascript/reference/global_objects/temporal/zoneddatetime/withplaintime/index.html b/files/en-us/web/javascript/reference/global_objects/temporal/zoneddatetime/withplaintime/index.html index f47665956d96b14..fcdb1eb04f57669 100644 --- a/files/en-us/web/javascript/reference/global_objects/temporal/zoneddatetime/withplaintime/index.html +++ b/files/en-us/web/javascript/reference/global_objects/temporal/zoneddatetime/withplaintime/index.html @@ -26,7 +26,7 @@Parameters
plainTime
{{jsxref('Temporal.ZonedDateTime','Temporal.ZonedDateTime')}}
object. An object containing some or all of the properties accepted by {{jsxref('Temporal/ZonedDateTime/from','Temporal.ZonedDateTime.from()')}}
. Valid input to withPlainTime()
is the same as valid input to {{jsxref('Temporal/PlainTime/from','Temporal.PlainTime.from()')}}
: strings like 12:15:36
, plain objects like { hour: 20, minute: 30 }
, or Temporal objects that contain time fields: {{jsxref('Temporal.PlainTime','Temporal.PlainTime')}}
, {{jsxref('Temporal.PlainDateTime','Temporal.PlainDateTime')}}
, or {{jsxref('Temporal.ZonedDateTime','Temporal.ZonedDateTime')}}
.
+{{jsxref('Temporal.ZonedDateTime','Temporal.ZonedDateTime')}}
object. Valid input to withPlainTime()
is the same as valid input to {{jsxref('Temporal/PlainTime/from','Temporal.PlainTime.from()')}}
: strings like 12:15:36
, plain objects like { hour: 20, minute: 30 }
, or Temporal objects that contain time fields: {{jsxref('Temporal.PlainTime','Temporal.PlainTime')}}
, {{jsxref('Temporal.PlainDateTime','Temporal.PlainDateTime')}}
, or {{jsxref('Temporal.ZonedDateTime','Temporal.ZonedDateTime')}}
.