From 3e0e935076630d7ec2bb05b5aef41e2546cdff2c Mon Sep 17 00:00:00 2001
From: Philip Chimento An integer representing the weekday number on which the date falls. In the ISO 8601 calendar, this is always 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 An integer representing the weekday number on which the date falls. 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 A The Note that Note that Returns a string representing the month and day in ISO 8601 format. This method provides a useful value when a Returns a string representing the month and day in ISO 8601 format. This method provides a useful value when a Syntax
Value
-7
, but in other calendar systems the value may vary from week to week.Examples
diff --git a/files/en-us/web/javascript/reference/global_objects/temporal/plaindatetime/dayofweek/index.html b/files/en-us/web/javascript/reference/global_objects/temporal/plaindatetime/dayofweek/index.html
index a94fc21863c3c37..8a58b6f2b7fa4e8 100644
--- a/files/en-us/web/javascript/reference/global_objects/temporal/plaindatetime/dayofweek/index.html
+++ b/files/en-us/web/javascript/reference/global_objects/temporal/plaindatetime/dayofweek/index.html
@@ -21,7 +21,7 @@ Syntax
Value
-7
, but in other calendar systems the value may vary from week to week.Examples
diff --git a/files/en-us/web/javascript/reference/global_objects/temporal/plaindatetime/withplaintime/index.html b/files/en-us/web/javascript/reference/global_objects/temporal/plaindatetime/withplaintime/index.html
index 66dca443454f342..38ab3c7cf232d77 100644
--- a/files/en-us/web/javascript/reference/global_objects/temporal/plaindatetime/withplaintime/index.html
+++ b/files/en-us/web/javascript/reference/global_objects/temporal/plaindatetime/withplaintime/index.html
@@ -19,7 +19,7 @@
Syntax
-var newDateTime = Temporal.PlainDateTime.withPlainTime(plainTime);
+var newDateTime = dateTime.withPlainTime(plainTime);
Parameters
diff --git a/files/en-us/web/javascript/reference/global_objects/temporal/plainmonthday/getisofields/index.html b/files/en-us/web/javascript/reference/global_objects/temporal/plainmonthday/getisofields/index.html
index eb104d7d8bf221f..9e31f1a8825dcac 100644
--- a/files/en-us/web/javascript/reference/global_objects/temporal/plainmonthday/getisofields/index.html
+++ b/files/en-us/web/javascript/reference/global_objects/temporal/plainmonthday/getisofields/index.html
@@ -16,7 +16,7 @@
Syntax
-date.getISOFields();
+monthDay.getISOFields();
Parameters
diff --git a/files/en-us/web/javascript/reference/global_objects/temporal/plainmonthday/index.html b/files/en-us/web/javascript/reference/global_objects/temporal/plainmonthday/index.html
index 156187300714382..b10f001d4327c08 100644
--- a/files/en-us/web/javascript/reference/global_objects/temporal/plainmonthday/index.html
+++ b/files/en-us/web/javascript/reference/global_objects/temporal/plainmonthday/index.html
@@ -14,7 +14,7 @@
{{JSRef}}
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.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.Constructor
diff --git a/files/en-us/web/javascript/reference/global_objects/temporal/plainmonthday/monthcode/index.html b/files/en-us/web/javascript/reference/global_objects/temporal/plainmonthday/monthcode/index.html
index 0c0c0cfc0fbb500..0ab37ec495a36c4 100644
--- a/files/en-us/web/javascript/reference/global_objects/temporal/plainmonthday/monthcode/index.html
+++ b/files/en-us/web/javascript/reference/global_objects/temporal/plainmonthday/monthcode/index.html
@@ -10,7 +10,7 @@
{{JSRef}}
monthCode
read-only property returns a calendar-specific string that identifies the month in a year-independent manner.{{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.{{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.Syntax
diff --git a/files/en-us/web/javascript/reference/global_objects/temporal/plainmonthday/tojson/index.html b/files/en-us/web/javascript/reference/global_objects/temporal/plainmonthday/tojson/index.html
index df4088832907390..0ccb4195a0197a8 100644
--- a/files/en-us/web/javascript/reference/global_objects/temporal/plainmonthday/tojson/index.html
+++ b/files/en-us/web/javascript/reference/global_objects/temporal/plainmonthday/tojson/index.html
@@ -9,7 +9,7 @@
---
{{JSRef}}
-{{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.{{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')}}
.