-
Notifications
You must be signed in to change notification settings - Fork 22.5k
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
[new-ci] Reference for stage 3 temporal #37344
base: main
Are you sure you want to change the base?
Conversation
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.
For Temporal.Now
files/en-us/web/javascript/reference/global_objects/temporal/now/index.md
Outdated
Show resolved
Hide resolved
files/en-us/web/javascript/reference/global_objects/temporal/now/index.md
Outdated
Show resolved
Hide resolved
files/en-us/web/javascript/reference/global_objects/temporal/now/index.md
Outdated
Show resolved
Hide resolved
files/en-us/web/javascript/reference/global_objects/temporal/now/timezoneid/index.md
Outdated
Show resolved
Hide resolved
files/en-us/web/javascript/reference/global_objects/temporal/now/timezoneid/index.md
Show resolved
Hide resolved
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.
PlainTime, PlainYearMonth, and ZonedDateTime indexes
files/en-us/web/javascript/reference/global_objects/temporal/plaintime/index.md
Outdated
Show resolved
Hide resolved
files/en-us/web/javascript/reference/global_objects/temporal/plaintime/index.md
Outdated
Show resolved
Hide resolved
files/en-us/web/javascript/reference/global_objects/temporal/plaintime/index.md
Show resolved
Hide resolved
files/en-us/web/javascript/reference/global_objects/temporal/plainyearmonth/index.md
Outdated
Show resolved
Hide resolved
files/en-us/web/javascript/reference/global_objects/temporal/plainyearmonth/index.md
Outdated
Show resolved
Hide resolved
files/en-us/web/javascript/reference/global_objects/temporal/zoneddatetime/index.md
Outdated
Show resolved
Hide resolved
files/en-us/web/javascript/reference/global_objects/temporal/zoneddatetime/index.md
Outdated
Show resolved
Hide resolved
files/en-us/web/javascript/reference/global_objects/temporal/zoneddatetime/index.md
Outdated
Show resolved
Hide resolved
files/en-us/web/javascript/reference/global_objects/temporal/zoneddatetime/index.md
Outdated
Show resolved
Hide resolved
files/en-us/web/javascript/reference/global_objects/temporal/plaindatetime/index.md
Outdated
Show resolved
Hide resolved
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.
Temporal index page
files/en-us/web/javascript/reference/global_objects/temporal/index.md
Outdated
Show resolved
Hide resolved
files/en-us/web/javascript/reference/global_objects/temporal/index.md
Outdated
Show resolved
Hide resolved
files/en-us/web/javascript/reference/global_objects/temporal/index.md
Outdated
Show resolved
Hide resolved
files/en-us/web/javascript/reference/global_objects/temporal/index.md
Outdated
Show resolved
Hide resolved
files/en-us/web/javascript/reference/global_objects/temporal/index.md
Outdated
Show resolved
Hide resolved
Co-authored-by: Eric A. Meyer <[email protected]>
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.
Giving my approval, so I don't end up blocking this one later on.
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.
One comment for Time zone & calendar group
files/en-us/web/javascript/reference/global_objects/temporal/zoneddatetime/timezoneid/index.md
Outdated
Show resolved
Hide resolved
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.
One comment for Time components group
files/en-us/web/javascript/reference/global_objects/temporal/zoneddatetime/minute/index.md
Show resolved
Hide resolved
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.
Temporal.Instant constructors
files/en-us/web/javascript/reference/global_objects/temporal/instant/instant/index.md
Show resolved
Hide resolved
...en-us/web/javascript/reference/global_objects/temporal/instant/fromepochnanoseconds/index.md
Show resolved
Hide resolved
...n-us/web/javascript/reference/global_objects/temporal/instant/fromepochmilliseconds/index.md
Show resolved
Hide resolved
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.
Temporal.PlainDate constructors
files/en-us/web/javascript/reference/global_objects/temporal/plaindate/plaindate/index.md
Show resolved
Hide resolved
files/en-us/web/javascript/reference/global_objects/temporal/plaindate/from/index.md
Outdated
Show resolved
Hide resolved
files/en-us/web/javascript/reference/global_objects/temporal/plaindate/from/index.md
Outdated
Show resolved
Hide resolved
files/en-us/web/javascript/reference/global_objects/temporal/plaindate/from/index.md
Show resolved
Hide resolved
files/en-us/web/javascript/reference/global_objects/temporal/plaindate/with/index.md
Show resolved
Hide resolved
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.
Temporal.PlainDateTime and Temporal.PlainTime constructors
files/en-us/web/javascript/reference/global_objects/temporal/plaindatetime/from/index.md
Outdated
Show resolved
Hide resolved
files/en-us/web/javascript/reference/global_objects/temporal/plaindatetime/from/index.md
Outdated
Show resolved
Hide resolved
files/en-us/web/javascript/reference/global_objects/temporal/plaindatetime/with/index.md
Outdated
Show resolved
Hide resolved
files/en-us/web/javascript/reference/global_objects/temporal/plaindatetime/with/index.md
Show resolved
Hide resolved
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.
Few comments for Arithmetic group
files/en-us/web/javascript/reference/global_objects/temporal/instant/subtract/index.md
Outdated
Show resolved
Hide resolved
files/en-us/web/javascript/reference/global_objects/temporal/plaindatetime/since/index.md
Show resolved
Hide resolved
files/en-us/web/javascript/reference/global_objects/temporal/plaindate/until/index.md
Show resolved
Hide resolved
files/en-us/web/javascript/reference/global_objects/temporal/plaintime/since/index.md
Show resolved
Hide resolved
files/en-us/web/javascript/reference/global_objects/temporal/plaintime/until/index.md
Show resolved
Hide resolved
files/en-us/web/javascript/reference/global_objects/temporal/plainyearmonth/since/index.md
Show resolved
Hide resolved
files/en-us/web/javascript/reference/global_objects/temporal/zoneddatetime/round/index.md
Outdated
Show resolved
Hide resolved
files/en-us/web/javascript/reference/global_objects/temporal/instant/since/index.md
Outdated
Show resolved
Hide resolved
files/en-us/web/javascript/reference/global_objects/temporal/instant/since/index.md
Outdated
Show resolved
Hide resolved
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.
Temporal.PlainMonthDay and Temporal.PlainYearMonth constructors
files/en-us/web/javascript/reference/global_objects/temporal/plainmonthday/from/index.md
Outdated
Show resolved
Hide resolved
files/en-us/web/javascript/reference/global_objects/temporal/plainmonthday/with/index.md
Outdated
Show resolved
Hide resolved
...n-us/web/javascript/reference/global_objects/temporal/plainyearmonth/plainyearmonth/index.md
Outdated
Show resolved
Hide resolved
...n-us/web/javascript/reference/global_objects/temporal/plainyearmonth/plainyearmonth/index.md
Outdated
Show resolved
Hide resolved
files/en-us/web/javascript/reference/global_objects/temporal/plainyearmonth/from/index.md
Outdated
Show resolved
Hide resolved
files/en-us/web/javascript/reference/global_objects/temporal/plainyearmonth/with/index.md
Outdated
Show resolved
Hide resolved
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.
Temporal.ZonedDateTime constructors
files/en-us/web/javascript/reference/global_objects/temporal/zoneddatetime/from/index.md
Outdated
Show resolved
Hide resolved
files/en-us/web/javascript/reference/global_objects/temporal/zoneddatetime/from/index.md
Outdated
Show resolved
Hide resolved
files/en-us/web/javascript/reference/global_objects/temporal/zoneddatetime/from/index.md
Outdated
Show resolved
Hide resolved
files/en-us/web/javascript/reference/global_objects/temporal/zoneddatetime/from/index.md
Outdated
Show resolved
Hide resolved
files/en-us/web/javascript/reference/global_objects/temporal/zoneddatetime/with/index.md
Outdated
Show resolved
Hide resolved
files/en-us/web/javascript/reference/global_objects/temporal/zoneddatetime/with/index.md
Outdated
Show resolved
Hide resolved
...s/en-us/web/javascript/reference/global_objects/temporal/zoneddatetime/withcalendar/index.md
Outdated
Show resolved
Hide resolved
.../en-us/web/javascript/reference/global_objects/temporal/zoneddatetime/withplaintime/index.md
Outdated
Show resolved
Hide resolved
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.
Only one comment for Calendar: month-related group
files/en-us/web/javascript/reference/global_objects/temporal/plainyearmonth/monthcode/index.md
Show resolved
Hide resolved
This pull request has merge conflicts that must be resolved before it can be merged. |
.../en-us/web/javascript/reference/global_objects/temporal/plainmonthday/plainmonthday/index.md
Outdated
Show resolved
Hide resolved
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.
Couple of comments for Conversion group, nearly there
console.log(zonedDateTime.toString()); // 2021-08-01T08:34:56.123456789-04:00[America/New_York] | ||
|
||
const localDateTime = instant.toZonedDateTimeISO(Temporal.Now.timeZoneId()); | ||
console.log(zonedDateTime.toString()); // This instant in your timezone |
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.
copy paste err?
console.log(zonedDateTime.toString()); // This instant in your timezone | |
console.log(localDateTime.toString()); // This instant in your timezone |
|
||
```js | ||
const dtNotExist = Temporal.PlainDateTime.from("2024-03-10T02:05:00"); | ||
// This wall-clock time never existed. So we need to choose from 01:05:00-05:00 or 03:05:00-04:00. |
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.
Do you want to mention "due to DST changeover" in the comment?
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.
I find the interleaving ambiguous and not-existing examples is a little hard to follow, but leave if you prefer it.
The **`toPlainDateTime()`** method of {{jsxref("Temporal.ZonedDateTime")}} instances returns a new {{jsxref("Temporal.PlainDateTime")}} object representing the date and time portions of this date-time. Only the time zone information is removed. | ||
|
||
> [!WARNING] | ||
> After a `Temporal.ZonedDateTime` is converted to `Temporal.PlainDateTime`, it will no longer be aware of its time zone. This means that subsequent operations like arithmetic or with will not adjust for DST and may not yield the same results as equivalent operations with `Temporal.ZonedDateTime`. However, unless you perform those operations across a time zone offset transition, it's impossible to notice the difference. Therefore, be very careful when performing this conversion because subsequent results may look correct most of the time while failing around time zone transitions like when DST starts or ends. |
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.
Minor one if you like:
> After a `Temporal.ZonedDateTime` is converted to `Temporal.PlainDateTime`, it will no longer be aware of its time zone. This means that subsequent operations like arithmetic or with will not adjust for DST and may not yield the same results as equivalent operations with `Temporal.ZonedDateTime`. However, unless you perform those operations across a time zone offset transition, it's impossible to notice the difference. Therefore, be very careful when performing this conversion because subsequent results may look correct most of the time while failing around time zone transitions like when DST starts or ends. | |
> After a `Temporal.ZonedDateTime` is converted to `Temporal.PlainDateTime`, it's no longer time zone aware. Subsequent operations like arithmetic or `with` operations will not adjust for DST and may not yield the same results as equivalent operations with `Temporal.ZonedDateTime`. However, unless you perform those operations across a time zone offset transition, it's impossible to notice the difference. Be very careful when performing this conversion because subsequent results may be correct most of the time, but incorrect across time zone transitions like when DST starts or ends. |
{{JSRef}} | ||
|
||
The **`toPlainTime()`** method of {{jsxref("Temporal.ZonedDateTime")}} instances returns a new {{jsxref("Temporal.PlainTime")}} object representing the time portion of this date-time. | ||
|
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.
Is the warning like on toplaindatetime
also useful regarding accuracy of subsequent calculations across DST boundaries, etc?
#27745
Far from ready for review, and I'll work on this alone for a whileIt is now ready for review! It's extremely big but I think it's more worthwhile getting it in as a whole. I`m already leaving the guide to a second PR.
For reviewers (both editorial and technical): I've made a spreadsheet here: https://docs.google.com/spreadsheets/d/1RrRHL0m08R4V4WtuWBbSWr9a1gO4RiIaH42WrPv_Uhs/edit Welcoming anyone on the team for editorial reviews! Technical review from the champion group is greatly appreciated too. It seems we have roughly 4 weeks to make this happen.