From 6b2a210b4f95ef1bcb83cad18e96fd3d741697ad Mon Sep 17 00:00:00 2001 From: Renegade334 Date: Sun, 19 Oct 2025 12:11:15 +0100 Subject: [PATCH 1/8] add lib.esnext.temporal --- src/compiler/commandLineParser.ts | 1 + src/lib/esnext.d.ts | 1 + src/lib/esnext.temporal.d.ts | 457 ++++++++++++++++++ src/lib/libs.json | 1 + ...next,moduleresolution=nodenext).trace.json | 2 + .../Parse --lib option with extra comma.js | 2 +- ... --lib option with trailing white-space.js | 2 +- .../Parse invalid option of library flags.js | 2 +- ...array to compiler-options with json api.js | 2 +- ...ompiler-options with jsonSourceFile api.js | 2 +- ... libs to compiler-options with json api.js | 2 +- ...ompiler-options with jsonSourceFile api.js | 2 +- ... libs to compiler-options with json api.js | 2 +- ...ompiler-options with jsonSourceFile api.js | 2 +- ... libs to compiler-options with json api.js | 2 +- ...ompiler-options with jsonSourceFile api.js | 2 +- ...eplacement(libreplacement=true).trace.json | 15 +- ...sTypesVersions(module=nodenext).trace.json | 2 + ...PackageImports(module=nodenext).trace.json | 2 + ...xportsTrailers(module=nodenext).trace.json | 2 + .../reactJsxReactResolvedNodeNext.trace.json | 2 + ...eactJsxReactResolvedNodeNextEsm.trace.json | 2 + ...does-not-add-color-when-NO_COLOR-is-set.js | 2 +- .../reference/tsc/commandLine/help-all.js | 2 +- .../reference/tsc/commandLine/help.js | 2 +- ...-when-host-can't-provide-terminal-width.js | 2 +- ...tatus.DiagnosticsPresent_OutputsSkipped.js | 2 +- ...-config-file-absent-with---ignoreConfig.js | 2 +- ...out-any-options-when-config-file-absent.js | 2 +- ...-style-sibling-packages-symlinked-Linux.js | 62 +-- ...packages-symlinked-package1-built-Linux.js | 52 +- .../packages-outside-project-folder-Linux.js | 104 ++-- .../packages-outside-project-folder-MacOs.js | 88 ++-- ...ages-outside-project-folder-built-Linux.js | 100 ++-- ...ages-outside-project-folder-built-MacOs.js | 86 ++-- ...stamp-true-useFsEventsOnParentDirectory.js | 4 +- .../fsWatch/fsWatchWithTimestamp-true.js | 4 +- ...inode-when-rename-event-ends-with-tilde.js | 16 +- ...e-occurs-when-file-is-still-on-the-disk.js | 18 +- ...when-using-file-watching-thats-on-inode.js | 16 +- ...polling-when-renaming-file-in-subfolder.js | 8 +- ...rectory-when-renaming-file-in-subfolder.js | 8 +- ...tchFile-when-renaming-file-in-subfolder.js | 8 +- ...-folders-with-synchronousWatchDirectory.js | 4 +- ...ymlinks-to-folders-in-recursive-folders.js | 4 +- ...hronous-watch-directory-renaming-a-file.js | 20 +- ...ory-with-outDir-and-declaration-enabled.js | 16 +- .../with-non-synchronous-watch-directory.js | 20 +- ...-directory-watching-extendedDiagnostics.js | 4 +- ...ption-with-recursive-directory-watching.js | 4 +- .../with-fallbackPolling-option.js | 4 +- .../with-watchDirectory-option.js | 4 +- .../projectErrors/file-rename-on-wsl2.js | 4 +- ...-location-with-currentDirectory-at-root.js | 4 +- ...lution-fails-in-global-typings-location.js | 4 +- ...e-failing-with-currentDirectory-at-root.js | 6 +- ...with-import-from-the-cache-file-failing.js | 8 +- ...ache-file-with-currentDirectory-at-root.js | 6 +- ...ocation-with-import-from-the-cache-file.js | 8 +- ...ache-file-with-currentDirectory-at-root.js | 6 +- ...ith-relative-import-from-the-cache-file.js | 8 +- ...kages-symlinked-Linux-canUseWatchEvents.js | 16 +- ...-style-sibling-packages-symlinked-Linux.js | 36 +- ...-package1-built-Linux-canUseWatchEvents.js | 16 +- ...packages-symlinked-package1-built-Linux.js | 34 +- ...-project-folder-Linux-canUseWatchEvents.js | 56 +-- .../packages-outside-project-folder-Linux.js | 112 ++--- ...-project-folder-MacOs-canUseWatchEvents.js | 56 +-- .../packages-outside-project-folder-MacOs.js | 88 ++-- ...ct-folder-built-Linux-canUseWatchEvents.js | 56 +-- ...ages-outside-project-folder-built-Linux.js | 110 ++--- ...ct-folder-built-MacOs-canUseWatchEvents.js | 56 +-- ...ages-outside-project-folder-built-MacOs.js | 88 ++-- .../telemetry/does-not-expose-paths.js | 2 +- ...files-starting-with-dot-in-node_modules.js | 10 +- ...polling-when-file-is-added-to-subfolder.js | 4 +- ...rectory-when-file-is-added-to-subfolder.js | 4 +- ...tchFile-when-file-is-added-to-subfolder.js | 4 +- ...ere-workspaces-folder-is-hosted-at-root.js | 16 +- 79 files changed, 1240 insertions(+), 755 deletions(-) create mode 100644 src/lib/esnext.temporal.d.ts diff --git a/src/compiler/commandLineParser.ts b/src/compiler/commandLineParser.ts index 236e643b00b3c..98bf0558e710b 100644 --- a/src/compiler/commandLineParser.ts +++ b/src/compiler/commandLineParser.ts @@ -251,6 +251,7 @@ const libEntries: [string, string][] = [ ["esnext.typedarrays", "lib.esnext.typedarrays.d.ts"], ["esnext.error", "lib.esnext.error.d.ts"], ["esnext.sharedmemory", "lib.esnext.sharedmemory.d.ts"], + ["esnext.temporal", "lib.esnext.temporal.d.ts"], ["decorators", "lib.decorators.d.ts"], ["decorators.legacy", "lib.decorators.legacy.d.ts"], ]; diff --git a/src/lib/esnext.d.ts b/src/lib/esnext.d.ts index c32661b0be9f2..76ce09eab1d84 100644 --- a/src/lib/esnext.d.ts +++ b/src/lib/esnext.d.ts @@ -10,3 +10,4 @@ /// /// /// +/// diff --git a/src/lib/esnext.temporal.d.ts b/src/lib/esnext.temporal.d.ts new file mode 100644 index 0000000000000..ff0d455f4291a --- /dev/null +++ b/src/lib/esnext.temporal.d.ts @@ -0,0 +1,457 @@ +/// +/// + +declare namespace Temporal { + type CalendarLike = PlainDate | PlainDateTime | PlainMonthDay | PlainYearMonth | ZonedDateTime | string; + type DurationLike = Duration | DurationLikeObject | string; + type InstantLike = Instant | ZonedDateTime | string; + type PlainDateLike = PlainDate | ZonedDateTime | PlainDateTime | DateLikeObject | string; + type PlainDateTimeLike = PlainDateTime | ZonedDateTime | PlainDate | DateTimeLikeObject | string; + type PlainMonthDayLike = PlainMonthDay | MonthDayLikeObject | string; + type PlainTimeLike = PlainTime | PlainDateTime | ZonedDateTime | TimeLikeObject | string; + type PlainYearMonthLike = PlainYearMonth | YearMonthLikeObject | string; + type TimeZoneLike = ZonedDateTime | string; + type ZonedDateTimeLike = ZonedDateTime | ZonedDateTimeLikeObject | string; + + type PartialTemporalLike = { + [P in Exclude]?: T[P] | undefined; + }; + + interface DateLikeObject { + year?: number | undefined; + era?: string | undefined; + eraYear?: number | undefined; + month?: number | undefined; + monthCode?: string | undefined; + day: number; + calendar?: string | undefined; + } + + interface DateTimeLikeObject extends DateLikeObject, TimeLikeObject {} + + interface DurationLikeObject { + years?: number | undefined; + months?: number | undefined; + weeks?: number | undefined; + days?: number | undefined; + hours?: number | undefined; + minutes?: number | undefined; + seconds?: number | undefined; + milliseconds?: number | undefined; + microseconds?: number | undefined; + nanoseconds?: number | undefined; + } + + interface MonthDayLikeObject extends Omit {} + + interface TimeLikeObject { + hour?: number | undefined; + minute?: number | undefined; + second?: number | undefined; + millisecond?: number | undefined; + microsecond?: number | undefined; + nanosecond?: number | undefined; + } + + interface YearMonthLikeObject extends Omit {} + + interface ZonedDateTimeLikeObject extends DateTimeLikeObject { + timeZone: TimeZoneLike; + offset?: string | undefined; + } + + type DateUnit = "year" | "month" | "week" | "day" | "years" | "months" | "weeks" | "days"; + type TimeUnit = "hour" | "minute" | "second" | "millisecond" | "microsecond" | "nanosecond" | "hours" | "minutes" | "seconds" | "milliseconds" | "microseconds" | "nanoseconds"; + + interface OverflowOptions { + overflow?: "constrain" | "reject" | undefined; + } + + interface RoundingOptions { + smallestUnit?: Units | undefined; + roundingIncrement?: number | undefined; + roundingMode?: "ceil" | "floor" | "expand" | "trunc" | "halfCeil" | "halfFloor" | "halfExpand" | "halfTrunc" | "halfEven" | undefined; + } + + interface RoundingOptionsWithLargestUnit extends RoundingOptions { + largestUnit?: "auto" | Units | undefined; + } + + interface ToStringRoundingOptions extends Pick, "smallestUnit" | "roundingMode"> {} + + interface ToStringRoundingOptionsWithFractionalSeconds extends ToStringRoundingOptions { + fractionalSecondDigits?: "auto" | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | undefined; + } + + namespace Now { + function timeZoneId(): string; + function instant(): Instant; + function plainDateTimeISO(timeZone?: TimeZoneLike): PlainDateTime; + function zonedDateTimeISO(timeZone?: TimeZoneLike): ZonedDateTime; + function plainDateISO(timeZone?: TimeZoneLike): PlainDate; + function plainTimeISO(timeZone?: TimeZoneLike): PlainTime; + } + + interface PlainDateToStringOptions { + calendarName?: "auto" | "always" | "never" | "critical" | undefined; + } + + interface PlainDateToZonedDateTimeOptions { + plainTime?: PlainTimeLike | undefined; + timeZone: TimeZoneLike; + } + + interface PlainDate { + readonly calendarId: string; + readonly era: string | undefined; + readonly eraYear: number | undefined; + readonly year: number; + readonly month: number; + readonly monthCode: string; + readonly day: number; + readonly dayOfWeek: number; + readonly dayOfYear: number; + readonly weekOfYear: number | undefined; + readonly yearOfWeek: number | undefined; + readonly daysInWeek: number; + readonly daysInMonth: number; + readonly daysInYear: number; + readonly monthsInYear: number; + readonly inLeapYear: boolean; + toPlainYearMonth(): PlainYearMonth; + toPlainMonthDay(): PlainMonthDay; + add(duration: DurationLike, options?: OverflowOptions): PlainDate; + subtract(duration: DurationLike, options?: OverflowOptions): PlainDate; + with(dateLike: PartialTemporalLike, options?: OverflowOptions): PlainDate; + withCalendar(calendarLike: CalendarLike): PlainDate; + until(other: PlainDateLike, options?: RoundingOptionsWithLargestUnit): Duration; + since(other: PlainDateLike, options?: RoundingOptionsWithLargestUnit): Duration; + equals(other: PlainDateLike): boolean; + toPlainDateTime(time?: PlainTimeLike): PlainDateTime; + toZonedDateTime(timeZone: TimeZoneLike): ZonedDateTime; + toZonedDateTime(item: PlainDateToZonedDateTimeOptions): ZonedDateTime; + toString(options?: PlainDateToStringOptions): string; + toLocaleString(locales?: Intl.LocalesArgument, options?: Intl.DateTimeFormatOptions): string; + toJSON(): string; + valueOf(): never; + readonly [Symbol.toStringTag]: "Temporal.PlainDate"; + } + + interface PlainDateConstructor { + new (isoYear: number, isoMonth: number, isoDay: number, calendar?: string): PlainDate; + readonly prototype: PlainDate; + from(item: PlainDateLike, options?: OverflowOptions): PlainDate; + compare(one: PlainDateLike, two: PlainDateLike): number; + } + var PlainDate: PlainDateConstructor; + + interface PlainTimeToStringOptions extends ToStringRoundingOptionsWithFractionalSeconds> {} + + interface PlainTime { + readonly hour: number; + readonly minute: number; + readonly second: number; + readonly millisecond: number; + readonly microsecond: number; + readonly nanosecond: number; + add(duration: DurationLike): PlainTime; + subtract(duration: DurationLike): PlainTime; + with(timeLike: PartialTemporalLike, options?: OverflowOptions): PlainTime; + until(other: PlainTimeLike, options?: RoundingOptionsWithLargestUnit): Duration; + since(other: PlainTimeLike, options?: RoundingOptionsWithLargestUnit): Duration; + equals(other: PlainTimeLike): boolean; + round(roundTo: TimeUnit): PlainTime; + round(roundTo: RoundingOptions): PlainTime; + toString(options?: PlainTimeToStringOptions): string; + toLocaleString(locales?: Intl.LocalesArgument, options?: Intl.DateTimeFormatOptions): string; + toJSON(): string; + valueOf(): never; + readonly [Symbol.toStringTag]: "Temporal.PlainTime"; + } + + interface PlainTimeConstructor { + new (hour?: number, minute?: number, second?: number, millisecond?: number, microsecond?: number, nanosecond?: number): PlainTime; + readonly prototype: PlainTime; + from(item: PlainTimeLike, options?: OverflowOptions): PlainTime; + compare(one: PlainTimeLike, two: PlainTimeLike): number; + } + var PlainTime: PlainTimeConstructor; + + interface PlainDateTimeToStringOptions extends PlainDateToStringOptions, PlainTimeToStringOptions {} + + interface PlainDateTimeToZonedDateTimeOptions extends Pick {} + + interface PlainDateTime { + readonly calendarId: string; + readonly era: string | undefined; + readonly eraYear: number | undefined; + readonly year: number; + readonly month: number; + readonly monthCode: string; + readonly day: number; + readonly hour: number; + readonly minute: number; + readonly second: number; + readonly millisecond: number; + readonly microsecond: number; + readonly nanosecond: number; + readonly dayOfWeek: number; + readonly dayOfYear: number; + readonly weekOfYear: number | undefined; + readonly yearOfWeek: number | undefined; + readonly daysInWeek: number; + readonly daysInMonth: number; + readonly daysInYear: number; + readonly monthsInYear: number; + readonly inLeapYear: boolean; + with(dateTimeLike: PartialTemporalLike, options?: OverflowOptions): PlainDateTime; + withPlainTime(plainTime?: PlainTimeLike): PlainDateTime; + withCalendar(calendar: CalendarLike): PlainDateTime; + add(duration: DurationLike, options?: OverflowOptions): PlainDateTime; + subtract(duration: DurationLike, options?: OverflowOptions): PlainDateTime; + until(other: PlainDateTimeLike, options?: RoundingOptionsWithLargestUnit): Duration; + since(other: PlainDateTimeLike, options?: RoundingOptionsWithLargestUnit): Duration; + round(roundTo: "day" | "days" | TimeUnit): PlainDateTime; + round(roundTo: RoundingOptions<"day" | "days" | TimeUnit>): PlainDateTime; + equals(other: PlainDateTimeLike): boolean; + toString(options?: PlainDateTimeToStringOptions): string; + toLocaleString(locales?: Intl.LocalesArgument, options?: Intl.DateTimeFormatOptions): string; + toJSON(): string; + valueOf(): never; + toZonedDateTime(timeZone: TimeZoneLike, options?: PlainDateTimeToZonedDateTimeOptions): ZonedDateTime; + toPlainDate(): PlainDate; + toPlainTime(): PlainTime; + readonly [Symbol.toStringTag]: "Temporal.PlainDateTime"; + } + + interface PlainDateTimeConstructor { + new (isoYear: number, isoMonth: number, isoDay: number, hour?: number, minute?: number, second?: number, millisecond?: number, microsecond?: number, nanosecond?: number, calendar?: string): PlainDateTime; + readonly prototype: PlainDateTime; + from(item: PlainDateTimeLike, options?: OverflowOptions): PlainDateTime; + compare(one: PlainDateTimeLike, two: PlainDateTimeLike): number; + } + var PlainDateTime: PlainDateTimeConstructor; + + interface ZonedDateTimeToStringOptions extends PlainDateTimeToStringOptions { + offset?: "auto" | "never" | undefined; + timeZoneName?: "auto" | "never" | "critical" | undefined; + } + + interface ZonedDateTimeToZonedDateTimeOptions extends OverflowOptions { + disambiguation?: "compatible" | "earlier" | "later" | "reject" | undefined; + offset?: "use" | "ignore" | "prefer" | "reject" | undefined; + } + + interface ZonedDateTimeTransitionOptions { + direction: "next" | "previous"; + } + + interface ZonedDateTime { + readonly calendarId: string; + readonly timeZoneId: string; + readonly era: string | undefined; + readonly eraYear: number | undefined; + readonly year: number; + readonly month: number; + readonly monthCode: string; + readonly day: number; + readonly hour: number; + readonly minute: number; + readonly second: number; + readonly millisecond: number; + readonly microsecond: number; + readonly nanosecond: number; + readonly epochMilliseconds: number; + readonly epochNanoseconds: bigint; + readonly dayOfWeek: number; + readonly dayOfYear: number; + readonly weekOfYear: number | undefined; + readonly yearOfWeek: number | undefined; + readonly hoursInDay: number; + readonly daysInWeek: number; + readonly daysInMonth: number; + readonly daysInYear: number; + readonly monthsInYear: number; + readonly inLeapYear: boolean; + readonly offsetNanoseconds: number; + readonly offset: string; + with(zonedDateTimeLike: PartialTemporalLike, options?: ZonedDateTimeToZonedDateTimeOptions): ZonedDateTime; + withPlainTime(plainTime?: PlainTimeLike): ZonedDateTime; + withTimeZone(timeZone: TimeZoneLike): ZonedDateTime; + withCalendar(calendar: CalendarLike): ZonedDateTime; + add(duration: DurationLike, options?: OverflowOptions): ZonedDateTime; + subtract(duration: DurationLike, options?: OverflowOptions): ZonedDateTime; + until(other: ZonedDateTimeLike, options?: RoundingOptionsWithLargestUnit): Duration; + since(other: ZonedDateTimeLike, options?: RoundingOptionsWithLargestUnit): Duration; + round(roundTo: "day" | "days" | TimeUnit): ZonedDateTime; + round(roundTo: RoundingOptions<"day" | "days" | TimeUnit>): ZonedDateTime; + equals(other: ZonedDateTimeLike): boolean; + toString(options?: ZonedDateTimeToStringOptions): string; + toLocaleString(locales?: Intl.LocalesArgument, options?: Intl.DateTimeFormatOptions): string; + toJSON(): string; + valueOf(): never; + startOfDay(): ZonedDateTime; + getTimeZoneTransition(direction: "next" | "previous"): ZonedDateTime | null; + getTimeZoneTransition(direction: ZonedDateTimeTransitionOptions): ZonedDateTime | null; + toInstant(): Instant; + toPlainDate(): PlainDate; + toPlainTime(): PlainTime; + toPlainDateTime(): PlainDateTime; + readonly [Symbol.toStringTag]: "Temporal.ZonedDateTime"; + } + + interface ZonedDateTimeConstructor { + new (epochNanoseconds: bigint, timeZone: string, calendar?: string): ZonedDateTime; + readonly prototype: ZonedDateTime; + from(item: ZonedDateTimeLike, options?: ZonedDateTimeToZonedDateTimeOptions): ZonedDateTime; + compare(one: ZonedDateTimeLike, two: ZonedDateTimeLike): number; + } + var ZonedDateTime: ZonedDateTimeConstructor; + + interface DurationRelativeToOptions { + relativeTo?: ZonedDateTimeLike | PlainDateLike | undefined; + } + + interface DurationRoundingOptions extends DurationRelativeToOptions, RoundingOptionsWithLargestUnit {} + + interface DurationToStringOptions extends ToStringRoundingOptionsWithFractionalSeconds> {} + + interface DurationTotalOptions extends DurationRelativeToOptions { + unit: DateUnit | TimeUnit; + } + + interface Duration { + readonly years: number; + readonly months: number; + readonly weeks: number; + readonly days: number; + readonly hours: number; + readonly minutes: number; + readonly seconds: number; + readonly milliseconds: number; + readonly microseconds: number; + readonly nanoseconds: number; + readonly sign: number; + readonly blank: boolean; + with(durationLike: PartialTemporalLike): Duration; + negated(): Duration; + abs(): Duration; + add(other: DurationLike): Duration; + subtract(other: DurationLike): Duration; + round(roundTo: "day" | "days" | TimeUnit): Duration; + round(roundTo: DurationRoundingOptions): Duration; + total(totalOf: "day" | "days" | TimeUnit): number; + total(totalOf: DurationTotalOptions): number; + toString(options?: DurationToStringOptions): string; + toLocaleString(locales?: Intl.LocalesArgument, options?: Intl.DateTimeFormatOptions): string; + toJSON(): string; + valueOf(): never; + readonly [Symbol.toStringTag]: "Temporal.Duration"; + } + + interface DurationConstructor { + new (years?: number, months?: number, weeks?: number, days?: number, hours?: number, minutes?: number, seconds?: number, milliseconds?: number, microseconds?: number, nanoseconds?: number): Duration; + readonly prototype: Duration; + from(item: DurationLike): Duration; + compare(one: DurationLike, two: DurationLike, options?: DurationRelativeToOptions): Duration; + } + var Duration: DurationConstructor; + + interface InstantToStringOptions extends PlainTimeToStringOptions { + timeZone?: TimeZoneLike | undefined; + } + + interface Instant { + readonly epochMilliseconds: number; + readonly epochNanoseconds: bigint; + add(duration: DurationLike): Instant; + subtract(duration: DurationLike): Instant; + until(other: InstantLike, options?: RoundingOptionsWithLargestUnit): Duration; + since(other: InstantLike, options?: RoundingOptionsWithLargestUnit): Duration; + round(roundTo: TimeUnit): Instant; + round(roundTo: RoundingOptions): Instant; + equals(other: InstantLike): boolean; + toString(options?: InstantToStringOptions): string; + toLocaleString(locales?: Intl.LocalesArgument, options?: Intl.DateTimeFormatOptions): string; + toJSON(): string; + valueOf(): never; + toZonedDateTimeISO(timeZone: TimeZoneLike): ZonedDateTime; + readonly [Symbol.toStringTag]: "Temporal.Instant"; + } + + interface InstantConstructor { + new (epochNanoseconds: bigint): Instant; + readonly prototype: Instant; + from(item: InstantLike): Instant; + fromEpochMilliseconds(epochMilliseconds: number): Instant; + fromEpochNanoseconds(epochNanoseconds: bigint): Instant; + compare(one: InstantLike, two: InstantLike): number; + } + var Instant: InstantConstructor; + + interface PlainYearMonthToPlainDateOptions { + day: number; + } + + interface PlainYearMonthToStringOptions extends Pick {} + + interface PlainYearMonth { + readonly calendarId: string; + readonly era: string | undefined; + readonly eraYear: number | undefined; + readonly year: number; + readonly month: number; + readonly monthCode: string; + readonly daysInYear: number; + readonly daysInMonth: number; + readonly monthsInYear: number; + readonly inLeapYear: boolean; + with(yearMonthLike: PartialTemporalLike, options?: OverflowOptions): PlainYearMonth; + add(duration: DurationLike, options?: OverflowOptions): PlainYearMonth; + subtract(duration: DurationLike, options?: OverflowOptions): PlainYearMonth; + until(other: PlainYearMonthLike, options?: RoundingOptionsWithLargestUnit<"year" | "month" | "years" | "months">): Duration; + since(other: PlainYearMonthLike, options?: RoundingOptionsWithLargestUnit<"year" | "month" | "years" | "months">): Duration; + equals(other: PlainYearMonthLike): boolean; + toString(options?: PlainYearMonthToStringOptions): string; + toLocaleString(locales?: Intl.LocalesArgument, options?: Intl.DateTimeFormatOptions): string; + toJSON(): string; + valueOf(): never; + toPlainDate(item: PlainYearMonthToPlainDateOptions): PlainDate; + readonly [Symbol.toStringTag]: "Temporal.PlainYearMonth"; + } + + interface PlainYearMonthConstructor { + new (isoYear: number, isoMonth: number, calendar?: string, referenceISODay?: number): PlainYearMonth; + readonly prototype: PlainYearMonth; + from(item: PlainYearMonthLike, options?: OverflowOptions): PlainYearMonth; + compare(one: PlainYearMonthLike, two: PlainYearMonthLike): number; + } + var PlainYearMonth: PlainYearMonthConstructor; + + interface PlainMonthDayToPlainDateOptions { + year: number; + } + + interface PlainMonthDayToStringOptions extends Pick {} + + interface PlainMonthDay { + readonly calendarId: string; + readonly monthCode: string; + readonly day: number; + with(monthDayLike: PartialTemporalLike, options?: OverflowOptions): PlainMonthDay; + equals(other: PlainMonthDayLike): boolean; + toString(options?: PlainMonthDayToStringOptions): string; + toLocaleString(locales?: Intl.LocalesArgument, options?: Intl.DateTimeFormatOptions): string; + toJSON(): string; + valueOf(): never; + toPlainDate(item: PlainMonthDayToPlainDateOptions): PlainDate; + readonly [Symbol.toStringTag]: "Temporal.PlainMonthDay"; + } + + interface PlainMonthDayConstructor { + new (isoMonth: number, isoDay: number, calendar?: string, referenceISOYear?: number): PlainMonthDay; + readonly prototype: PlainMonthDay; + from(item: PlainMonthDayLike, options?: OverflowOptions): PlainMonthDay; + } + var PlainMonthDay: PlainMonthDayConstructor; +} diff --git a/src/lib/libs.json b/src/lib/libs.json index c3cefc3426c42..8b205659700fe 100644 --- a/src/lib/libs.json +++ b/src/lib/libs.json @@ -90,6 +90,7 @@ "esnext.typedarrays", "esnext.error", "esnext.sharedmemory", + "esnext.temporal", "decorators", "decorators.legacy", // Default libraries diff --git a/tests/baselines/reference/bundlerDirectoryModule(module=nodenext,moduleresolution=nodenext).trace.json b/tests/baselines/reference/bundlerDirectoryModule(module=nodenext,moduleresolution=nodenext).trace.json index 461c1a41b3285..5a159946d324d 100644 --- a/tests/baselines/reference/bundlerDirectoryModule(module=nodenext,moduleresolution=nodenext).trace.json +++ b/tests/baselines/reference/bundlerDirectoryModule(module=nodenext,moduleresolution=nodenext).trace.json @@ -195,5 +195,7 @@ "File '/.ts/package.json' does not exist according to earlier cached lookups.", "File '/package.json' does not exist according to earlier cached lookups.", "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", "File '/package.json' does not exist according to earlier cached lookups." ] \ No newline at end of file diff --git a/tests/baselines/reference/config/commandLineParsing/parseCommandLine/Parse --lib option with extra comma.js b/tests/baselines/reference/config/commandLineParsing/parseCommandLine/Parse --lib option with extra comma.js index 9af82569714d4..7a621f1fa7d2b 100644 --- a/tests/baselines/reference/config/commandLineParsing/parseCommandLine/Parse --lib option with extra comma.js +++ b/tests/baselines/reference/config/commandLineParsing/parseCommandLine/Parse --lib option with extra comma.js @@ -10,4 +10,4 @@ WatchOptions:: FileNames:: es7,0.ts Errors:: -error TS6046: Argument for '--lib' option must be: 'es5', 'es6', 'es2015', 'es7', 'es2016', 'es2017', 'es2018', 'es2019', 'es2020', 'es2021', 'es2022', 'es2023', 'es2024', 'esnext', 'dom', 'dom.iterable', 'dom.asynciterable', 'webworker', 'webworker.importscripts', 'webworker.iterable', 'webworker.asynciterable', 'scripthost', 'es2015.core', 'es2015.collection', 'es2015.generator', 'es2015.iterable', 'es2015.promise', 'es2015.proxy', 'es2015.reflect', 'es2015.symbol', 'es2015.symbol.wellknown', 'es2016.array.include', 'es2016.intl', 'es2017.arraybuffer', 'es2017.date', 'es2017.object', 'es2017.sharedmemory', 'es2017.string', 'es2017.intl', 'es2017.typedarrays', 'es2018.asyncgenerator', 'es2018.asynciterable', 'es2018.intl', 'es2018.promise', 'es2018.regexp', 'es2019.array', 'es2019.object', 'es2019.string', 'es2019.symbol', 'es2019.intl', 'es2020.bigint', 'es2020.date', 'es2020.promise', 'es2020.sharedmemory', 'es2020.string', 'es2020.symbol.wellknown', 'es2020.intl', 'es2020.number', 'es2021.promise', 'es2021.string', 'es2021.weakref', 'es2021.intl', 'es2022.array', 'es2022.error', 'es2022.intl', 'es2022.object', 'es2022.string', 'es2022.regexp', 'es2023.array', 'es2023.collection', 'es2023.intl', 'es2024.arraybuffer', 'es2024.collection', 'es2024.object', 'es2024.promise', 'es2024.regexp', 'es2024.sharedmemory', 'es2024.string', 'esnext.array', 'esnext.collection', 'esnext.symbol', 'esnext.asynciterable', 'esnext.intl', 'esnext.disposable', 'esnext.bigint', 'esnext.string', 'esnext.promise', 'esnext.weakref', 'esnext.decorators', 'esnext.object', 'esnext.regexp', 'esnext.iterator', 'esnext.float16', 'esnext.typedarrays', 'esnext.error', 'esnext.sharedmemory', 'decorators', 'decorators.legacy'. +error TS6046: Argument for '--lib' option must be: 'es5', 'es6', 'es2015', 'es7', 'es2016', 'es2017', 'es2018', 'es2019', 'es2020', 'es2021', 'es2022', 'es2023', 'es2024', 'esnext', 'dom', 'dom.iterable', 'dom.asynciterable', 'webworker', 'webworker.importscripts', 'webworker.iterable', 'webworker.asynciterable', 'scripthost', 'es2015.core', 'es2015.collection', 'es2015.generator', 'es2015.iterable', 'es2015.promise', 'es2015.proxy', 'es2015.reflect', 'es2015.symbol', 'es2015.symbol.wellknown', 'es2016.array.include', 'es2016.intl', 'es2017.arraybuffer', 'es2017.date', 'es2017.object', 'es2017.sharedmemory', 'es2017.string', 'es2017.intl', 'es2017.typedarrays', 'es2018.asyncgenerator', 'es2018.asynciterable', 'es2018.intl', 'es2018.promise', 'es2018.regexp', 'es2019.array', 'es2019.object', 'es2019.string', 'es2019.symbol', 'es2019.intl', 'es2020.bigint', 'es2020.date', 'es2020.promise', 'es2020.sharedmemory', 'es2020.string', 'es2020.symbol.wellknown', 'es2020.intl', 'es2020.number', 'es2021.promise', 'es2021.string', 'es2021.weakref', 'es2021.intl', 'es2022.array', 'es2022.error', 'es2022.intl', 'es2022.object', 'es2022.string', 'es2022.regexp', 'es2023.array', 'es2023.collection', 'es2023.intl', 'es2024.arraybuffer', 'es2024.collection', 'es2024.object', 'es2024.promise', 'es2024.regexp', 'es2024.sharedmemory', 'es2024.string', 'esnext.array', 'esnext.collection', 'esnext.symbol', 'esnext.asynciterable', 'esnext.intl', 'esnext.disposable', 'esnext.bigint', 'esnext.string', 'esnext.promise', 'esnext.weakref', 'esnext.decorators', 'esnext.object', 'esnext.regexp', 'esnext.iterator', 'esnext.float16', 'esnext.typedarrays', 'esnext.error', 'esnext.sharedmemory', 'esnext.temporal', 'decorators', 'decorators.legacy'. diff --git a/tests/baselines/reference/config/commandLineParsing/parseCommandLine/Parse --lib option with trailing white-space.js b/tests/baselines/reference/config/commandLineParsing/parseCommandLine/Parse --lib option with trailing white-space.js index 88baea60556c0..001b66a01e12e 100644 --- a/tests/baselines/reference/config/commandLineParsing/parseCommandLine/Parse --lib option with trailing white-space.js +++ b/tests/baselines/reference/config/commandLineParsing/parseCommandLine/Parse --lib option with trailing white-space.js @@ -10,4 +10,4 @@ WatchOptions:: FileNames:: es7,0.ts Errors:: -error TS6046: Argument for '--lib' option must be: 'es5', 'es6', 'es2015', 'es7', 'es2016', 'es2017', 'es2018', 'es2019', 'es2020', 'es2021', 'es2022', 'es2023', 'es2024', 'esnext', 'dom', 'dom.iterable', 'dom.asynciterable', 'webworker', 'webworker.importscripts', 'webworker.iterable', 'webworker.asynciterable', 'scripthost', 'es2015.core', 'es2015.collection', 'es2015.generator', 'es2015.iterable', 'es2015.promise', 'es2015.proxy', 'es2015.reflect', 'es2015.symbol', 'es2015.symbol.wellknown', 'es2016.array.include', 'es2016.intl', 'es2017.arraybuffer', 'es2017.date', 'es2017.object', 'es2017.sharedmemory', 'es2017.string', 'es2017.intl', 'es2017.typedarrays', 'es2018.asyncgenerator', 'es2018.asynciterable', 'es2018.intl', 'es2018.promise', 'es2018.regexp', 'es2019.array', 'es2019.object', 'es2019.string', 'es2019.symbol', 'es2019.intl', 'es2020.bigint', 'es2020.date', 'es2020.promise', 'es2020.sharedmemory', 'es2020.string', 'es2020.symbol.wellknown', 'es2020.intl', 'es2020.number', 'es2021.promise', 'es2021.string', 'es2021.weakref', 'es2021.intl', 'es2022.array', 'es2022.error', 'es2022.intl', 'es2022.object', 'es2022.string', 'es2022.regexp', 'es2023.array', 'es2023.collection', 'es2023.intl', 'es2024.arraybuffer', 'es2024.collection', 'es2024.object', 'es2024.promise', 'es2024.regexp', 'es2024.sharedmemory', 'es2024.string', 'esnext.array', 'esnext.collection', 'esnext.symbol', 'esnext.asynciterable', 'esnext.intl', 'esnext.disposable', 'esnext.bigint', 'esnext.string', 'esnext.promise', 'esnext.weakref', 'esnext.decorators', 'esnext.object', 'esnext.regexp', 'esnext.iterator', 'esnext.float16', 'esnext.typedarrays', 'esnext.error', 'esnext.sharedmemory', 'decorators', 'decorators.legacy'. +error TS6046: Argument for '--lib' option must be: 'es5', 'es6', 'es2015', 'es7', 'es2016', 'es2017', 'es2018', 'es2019', 'es2020', 'es2021', 'es2022', 'es2023', 'es2024', 'esnext', 'dom', 'dom.iterable', 'dom.asynciterable', 'webworker', 'webworker.importscripts', 'webworker.iterable', 'webworker.asynciterable', 'scripthost', 'es2015.core', 'es2015.collection', 'es2015.generator', 'es2015.iterable', 'es2015.promise', 'es2015.proxy', 'es2015.reflect', 'es2015.symbol', 'es2015.symbol.wellknown', 'es2016.array.include', 'es2016.intl', 'es2017.arraybuffer', 'es2017.date', 'es2017.object', 'es2017.sharedmemory', 'es2017.string', 'es2017.intl', 'es2017.typedarrays', 'es2018.asyncgenerator', 'es2018.asynciterable', 'es2018.intl', 'es2018.promise', 'es2018.regexp', 'es2019.array', 'es2019.object', 'es2019.string', 'es2019.symbol', 'es2019.intl', 'es2020.bigint', 'es2020.date', 'es2020.promise', 'es2020.sharedmemory', 'es2020.string', 'es2020.symbol.wellknown', 'es2020.intl', 'es2020.number', 'es2021.promise', 'es2021.string', 'es2021.weakref', 'es2021.intl', 'es2022.array', 'es2022.error', 'es2022.intl', 'es2022.object', 'es2022.string', 'es2022.regexp', 'es2023.array', 'es2023.collection', 'es2023.intl', 'es2024.arraybuffer', 'es2024.collection', 'es2024.object', 'es2024.promise', 'es2024.regexp', 'es2024.sharedmemory', 'es2024.string', 'esnext.array', 'esnext.collection', 'esnext.symbol', 'esnext.asynciterable', 'esnext.intl', 'esnext.disposable', 'esnext.bigint', 'esnext.string', 'esnext.promise', 'esnext.weakref', 'esnext.decorators', 'esnext.object', 'esnext.regexp', 'esnext.iterator', 'esnext.float16', 'esnext.typedarrays', 'esnext.error', 'esnext.sharedmemory', 'esnext.temporal', 'decorators', 'decorators.legacy'. diff --git a/tests/baselines/reference/config/commandLineParsing/parseCommandLine/Parse invalid option of library flags.js b/tests/baselines/reference/config/commandLineParsing/parseCommandLine/Parse invalid option of library flags.js index 7f4be7fd1d8a2..01267eb10ac3c 100644 --- a/tests/baselines/reference/config/commandLineParsing/parseCommandLine/Parse invalid option of library flags.js +++ b/tests/baselines/reference/config/commandLineParsing/parseCommandLine/Parse invalid option of library flags.js @@ -10,4 +10,4 @@ WatchOptions:: FileNames:: 0.ts Errors:: -error TS6046: Argument for '--lib' option must be: 'es5', 'es6', 'es2015', 'es7', 'es2016', 'es2017', 'es2018', 'es2019', 'es2020', 'es2021', 'es2022', 'es2023', 'es2024', 'esnext', 'dom', 'dom.iterable', 'dom.asynciterable', 'webworker', 'webworker.importscripts', 'webworker.iterable', 'webworker.asynciterable', 'scripthost', 'es2015.core', 'es2015.collection', 'es2015.generator', 'es2015.iterable', 'es2015.promise', 'es2015.proxy', 'es2015.reflect', 'es2015.symbol', 'es2015.symbol.wellknown', 'es2016.array.include', 'es2016.intl', 'es2017.arraybuffer', 'es2017.date', 'es2017.object', 'es2017.sharedmemory', 'es2017.string', 'es2017.intl', 'es2017.typedarrays', 'es2018.asyncgenerator', 'es2018.asynciterable', 'es2018.intl', 'es2018.promise', 'es2018.regexp', 'es2019.array', 'es2019.object', 'es2019.string', 'es2019.symbol', 'es2019.intl', 'es2020.bigint', 'es2020.date', 'es2020.promise', 'es2020.sharedmemory', 'es2020.string', 'es2020.symbol.wellknown', 'es2020.intl', 'es2020.number', 'es2021.promise', 'es2021.string', 'es2021.weakref', 'es2021.intl', 'es2022.array', 'es2022.error', 'es2022.intl', 'es2022.object', 'es2022.string', 'es2022.regexp', 'es2023.array', 'es2023.collection', 'es2023.intl', 'es2024.arraybuffer', 'es2024.collection', 'es2024.object', 'es2024.promise', 'es2024.regexp', 'es2024.sharedmemory', 'es2024.string', 'esnext.array', 'esnext.collection', 'esnext.symbol', 'esnext.asynciterable', 'esnext.intl', 'esnext.disposable', 'esnext.bigint', 'esnext.string', 'esnext.promise', 'esnext.weakref', 'esnext.decorators', 'esnext.object', 'esnext.regexp', 'esnext.iterator', 'esnext.float16', 'esnext.typedarrays', 'esnext.error', 'esnext.sharedmemory', 'decorators', 'decorators.legacy'. +error TS6046: Argument for '--lib' option must be: 'es5', 'es6', 'es2015', 'es7', 'es2016', 'es2017', 'es2018', 'es2019', 'es2020', 'es2021', 'es2022', 'es2023', 'es2024', 'esnext', 'dom', 'dom.iterable', 'dom.asynciterable', 'webworker', 'webworker.importscripts', 'webworker.iterable', 'webworker.asynciterable', 'scripthost', 'es2015.core', 'es2015.collection', 'es2015.generator', 'es2015.iterable', 'es2015.promise', 'es2015.proxy', 'es2015.reflect', 'es2015.symbol', 'es2015.symbol.wellknown', 'es2016.array.include', 'es2016.intl', 'es2017.arraybuffer', 'es2017.date', 'es2017.object', 'es2017.sharedmemory', 'es2017.string', 'es2017.intl', 'es2017.typedarrays', 'es2018.asyncgenerator', 'es2018.asynciterable', 'es2018.intl', 'es2018.promise', 'es2018.regexp', 'es2019.array', 'es2019.object', 'es2019.string', 'es2019.symbol', 'es2019.intl', 'es2020.bigint', 'es2020.date', 'es2020.promise', 'es2020.sharedmemory', 'es2020.string', 'es2020.symbol.wellknown', 'es2020.intl', 'es2020.number', 'es2021.promise', 'es2021.string', 'es2021.weakref', 'es2021.intl', 'es2022.array', 'es2022.error', 'es2022.intl', 'es2022.object', 'es2022.string', 'es2022.regexp', 'es2023.array', 'es2023.collection', 'es2023.intl', 'es2024.arraybuffer', 'es2024.collection', 'es2024.object', 'es2024.promise', 'es2024.regexp', 'es2024.sharedmemory', 'es2024.string', 'esnext.array', 'esnext.collection', 'esnext.symbol', 'esnext.asynciterable', 'esnext.intl', 'esnext.disposable', 'esnext.bigint', 'esnext.string', 'esnext.promise', 'esnext.weakref', 'esnext.decorators', 'esnext.object', 'esnext.regexp', 'esnext.iterator', 'esnext.float16', 'esnext.typedarrays', 'esnext.error', 'esnext.sharedmemory', 'esnext.temporal', 'decorators', 'decorators.legacy'. diff --git a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert empty string option of libs array to compiler-options with json api.js b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert empty string option of libs array to compiler-options with json api.js index 0ed359422d88d..caf29f2f8c3be 100644 --- a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert empty string option of libs array to compiler-options with json api.js +++ b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert empty string option of libs array to compiler-options with json api.js @@ -30,5 +30,5 @@ CompilerOptions:: "configFilePath": "/apath/tsconfig.json" } Errors:: -error TS6046: Argument for '--lib' option must be: 'es5', 'es6', 'es2015', 'es7', 'es2016', 'es2017', 'es2018', 'es2019', 'es2020', 'es2021', 'es2022', 'es2023', 'es2024', 'esnext', 'dom', 'dom.iterable', 'dom.asynciterable', 'webworker', 'webworker.importscripts', 'webworker.iterable', 'webworker.asynciterable', 'scripthost', 'es2015.core', 'es2015.collection', 'es2015.generator', 'es2015.iterable', 'es2015.promise', 'es2015.proxy', 'es2015.reflect', 'es2015.symbol', 'es2015.symbol.wellknown', 'es2016.array.include', 'es2016.intl', 'es2017.arraybuffer', 'es2017.date', 'es2017.object', 'es2017.sharedmemory', 'es2017.string', 'es2017.intl', 'es2017.typedarrays', 'es2018.asyncgenerator', 'es2018.asynciterable', 'es2018.intl', 'es2018.promise', 'es2018.regexp', 'es2019.array', 'es2019.object', 'es2019.string', 'es2019.symbol', 'es2019.intl', 'es2020.bigint', 'es2020.date', 'es2020.promise', 'es2020.sharedmemory', 'es2020.string', 'es2020.symbol.wellknown', 'es2020.intl', 'es2020.number', 'es2021.promise', 'es2021.string', 'es2021.weakref', 'es2021.intl', 'es2022.array', 'es2022.error', 'es2022.intl', 'es2022.object', 'es2022.string', 'es2022.regexp', 'es2023.array', 'es2023.collection', 'es2023.intl', 'es2024.arraybuffer', 'es2024.collection', 'es2024.object', 'es2024.promise', 'es2024.regexp', 'es2024.sharedmemory', 'es2024.string', 'esnext.array', 'esnext.collection', 'esnext.symbol', 'esnext.asynciterable', 'esnext.intl', 'esnext.disposable', 'esnext.bigint', 'esnext.string', 'esnext.promise', 'esnext.weakref', 'esnext.decorators', 'esnext.object', 'esnext.regexp', 'esnext.iterator', 'esnext.float16', 'esnext.typedarrays', 'esnext.error', 'esnext.sharedmemory', 'decorators', 'decorators.legacy'. +error TS6046: Argument for '--lib' option must be: 'es5', 'es6', 'es2015', 'es7', 'es2016', 'es2017', 'es2018', 'es2019', 'es2020', 'es2021', 'es2022', 'es2023', 'es2024', 'esnext', 'dom', 'dom.iterable', 'dom.asynciterable', 'webworker', 'webworker.importscripts', 'webworker.iterable', 'webworker.asynciterable', 'scripthost', 'es2015.core', 'es2015.collection', 'es2015.generator', 'es2015.iterable', 'es2015.promise', 'es2015.proxy', 'es2015.reflect', 'es2015.symbol', 'es2015.symbol.wellknown', 'es2016.array.include', 'es2016.intl', 'es2017.arraybuffer', 'es2017.date', 'es2017.object', 'es2017.sharedmemory', 'es2017.string', 'es2017.intl', 'es2017.typedarrays', 'es2018.asyncgenerator', 'es2018.asynciterable', 'es2018.intl', 'es2018.promise', 'es2018.regexp', 'es2019.array', 'es2019.object', 'es2019.string', 'es2019.symbol', 'es2019.intl', 'es2020.bigint', 'es2020.date', 'es2020.promise', 'es2020.sharedmemory', 'es2020.string', 'es2020.symbol.wellknown', 'es2020.intl', 'es2020.number', 'es2021.promise', 'es2021.string', 'es2021.weakref', 'es2021.intl', 'es2022.array', 'es2022.error', 'es2022.intl', 'es2022.object', 'es2022.string', 'es2022.regexp', 'es2023.array', 'es2023.collection', 'es2023.intl', 'es2024.arraybuffer', 'es2024.collection', 'es2024.object', 'es2024.promise', 'es2024.regexp', 'es2024.sharedmemory', 'es2024.string', 'esnext.array', 'esnext.collection', 'esnext.symbol', 'esnext.asynciterable', 'esnext.intl', 'esnext.disposable', 'esnext.bigint', 'esnext.string', 'esnext.promise', 'esnext.weakref', 'esnext.decorators', 'esnext.object', 'esnext.regexp', 'esnext.iterator', 'esnext.float16', 'esnext.typedarrays', 'esnext.error', 'esnext.sharedmemory', 'esnext.temporal', 'decorators', 'decorators.legacy'. diff --git a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert empty string option of libs array to compiler-options with jsonSourceFile api.js b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert empty string option of libs array to compiler-options with jsonSourceFile api.js index eefaad0104fd0..6b8bf7028329f 100644 --- a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert empty string option of libs array to compiler-options with jsonSourceFile api.js +++ b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert empty string option of libs array to compiler-options with jsonSourceFile api.js @@ -30,7 +30,7 @@ CompilerOptions:: "configFilePath": "/apath/tsconfig.json" } Errors:: -tsconfig.json:8:7 - error TS6046: Argument for '--lib' option must be: 'es5', 'es6', 'es2015', 'es7', 'es2016', 'es2017', 'es2018', 'es2019', 'es2020', 'es2021', 'es2022', 'es2023', 'es2024', 'esnext', 'dom', 'dom.iterable', 'dom.asynciterable', 'webworker', 'webworker.importscripts', 'webworker.iterable', 'webworker.asynciterable', 'scripthost', 'es2015.core', 'es2015.collection', 'es2015.generator', 'es2015.iterable', 'es2015.promise', 'es2015.proxy', 'es2015.reflect', 'es2015.symbol', 'es2015.symbol.wellknown', 'es2016.array.include', 'es2016.intl', 'es2017.arraybuffer', 'es2017.date', 'es2017.object', 'es2017.sharedmemory', 'es2017.string', 'es2017.intl', 'es2017.typedarrays', 'es2018.asyncgenerator', 'es2018.asynciterable', 'es2018.intl', 'es2018.promise', 'es2018.regexp', 'es2019.array', 'es2019.object', 'es2019.string', 'es2019.symbol', 'es2019.intl', 'es2020.bigint', 'es2020.date', 'es2020.promise', 'es2020.sharedmemory', 'es2020.string', 'es2020.symbol.wellknown', 'es2020.intl', 'es2020.number', 'es2021.promise', 'es2021.string', 'es2021.weakref', 'es2021.intl', 'es2022.array', 'es2022.error', 'es2022.intl', 'es2022.object', 'es2022.string', 'es2022.regexp', 'es2023.array', 'es2023.collection', 'es2023.intl', 'es2024.arraybuffer', 'es2024.collection', 'es2024.object', 'es2024.promise', 'es2024.regexp', 'es2024.sharedmemory', 'es2024.string', 'esnext.array', 'esnext.collection', 'esnext.symbol', 'esnext.asynciterable', 'esnext.intl', 'esnext.disposable', 'esnext.bigint', 'esnext.string', 'esnext.promise', 'esnext.weakref', 'esnext.decorators', 'esnext.object', 'esnext.regexp', 'esnext.iterator', 'esnext.float16', 'esnext.typedarrays', 'esnext.error', 'esnext.sharedmemory', 'decorators', 'decorators.legacy'. +tsconfig.json:8:7 - error TS6046: Argument for '--lib' option must be: 'es5', 'es6', 'es2015', 'es7', 'es2016', 'es2017', 'es2018', 'es2019', 'es2020', 'es2021', 'es2022', 'es2023', 'es2024', 'esnext', 'dom', 'dom.iterable', 'dom.asynciterable', 'webworker', 'webworker.importscripts', 'webworker.iterable', 'webworker.asynciterable', 'scripthost', 'es2015.core', 'es2015.collection', 'es2015.generator', 'es2015.iterable', 'es2015.promise', 'es2015.proxy', 'es2015.reflect', 'es2015.symbol', 'es2015.symbol.wellknown', 'es2016.array.include', 'es2016.intl', 'es2017.arraybuffer', 'es2017.date', 'es2017.object', 'es2017.sharedmemory', 'es2017.string', 'es2017.intl', 'es2017.typedarrays', 'es2018.asyncgenerator', 'es2018.asynciterable', 'es2018.intl', 'es2018.promise', 'es2018.regexp', 'es2019.array', 'es2019.object', 'es2019.string', 'es2019.symbol', 'es2019.intl', 'es2020.bigint', 'es2020.date', 'es2020.promise', 'es2020.sharedmemory', 'es2020.string', 'es2020.symbol.wellknown', 'es2020.intl', 'es2020.number', 'es2021.promise', 'es2021.string', 'es2021.weakref', 'es2021.intl', 'es2022.array', 'es2022.error', 'es2022.intl', 'es2022.object', 'es2022.string', 'es2022.regexp', 'es2023.array', 'es2023.collection', 'es2023.intl', 'es2024.arraybuffer', 'es2024.collection', 'es2024.object', 'es2024.promise', 'es2024.regexp', 'es2024.sharedmemory', 'es2024.string', 'esnext.array', 'esnext.collection', 'esnext.symbol', 'esnext.asynciterable', 'esnext.intl', 'esnext.disposable', 'esnext.bigint', 'esnext.string', 'esnext.promise', 'esnext.weakref', 'esnext.decorators', 'esnext.object', 'esnext.regexp', 'esnext.iterator', 'esnext.float16', 'esnext.typedarrays', 'esnext.error', 'esnext.sharedmemory', 'esnext.temporal', 'decorators', 'decorators.legacy'. 8 ""    ~~ diff --git a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert empty string option of libs to compiler-options with json api.js b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert empty string option of libs to compiler-options with json api.js index f2c97f4662bc6..dec1bab9806ca 100644 --- a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert empty string option of libs to compiler-options with json api.js +++ b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert empty string option of libs to compiler-options with json api.js @@ -33,5 +33,5 @@ CompilerOptions:: "configFilePath": "/apath/tsconfig.json" } Errors:: -error TS6046: Argument for '--lib' option must be: 'es5', 'es6', 'es2015', 'es7', 'es2016', 'es2017', 'es2018', 'es2019', 'es2020', 'es2021', 'es2022', 'es2023', 'es2024', 'esnext', 'dom', 'dom.iterable', 'dom.asynciterable', 'webworker', 'webworker.importscripts', 'webworker.iterable', 'webworker.asynciterable', 'scripthost', 'es2015.core', 'es2015.collection', 'es2015.generator', 'es2015.iterable', 'es2015.promise', 'es2015.proxy', 'es2015.reflect', 'es2015.symbol', 'es2015.symbol.wellknown', 'es2016.array.include', 'es2016.intl', 'es2017.arraybuffer', 'es2017.date', 'es2017.object', 'es2017.sharedmemory', 'es2017.string', 'es2017.intl', 'es2017.typedarrays', 'es2018.asyncgenerator', 'es2018.asynciterable', 'es2018.intl', 'es2018.promise', 'es2018.regexp', 'es2019.array', 'es2019.object', 'es2019.string', 'es2019.symbol', 'es2019.intl', 'es2020.bigint', 'es2020.date', 'es2020.promise', 'es2020.sharedmemory', 'es2020.string', 'es2020.symbol.wellknown', 'es2020.intl', 'es2020.number', 'es2021.promise', 'es2021.string', 'es2021.weakref', 'es2021.intl', 'es2022.array', 'es2022.error', 'es2022.intl', 'es2022.object', 'es2022.string', 'es2022.regexp', 'es2023.array', 'es2023.collection', 'es2023.intl', 'es2024.arraybuffer', 'es2024.collection', 'es2024.object', 'es2024.promise', 'es2024.regexp', 'es2024.sharedmemory', 'es2024.string', 'esnext.array', 'esnext.collection', 'esnext.symbol', 'esnext.asynciterable', 'esnext.intl', 'esnext.disposable', 'esnext.bigint', 'esnext.string', 'esnext.promise', 'esnext.weakref', 'esnext.decorators', 'esnext.object', 'esnext.regexp', 'esnext.iterator', 'esnext.float16', 'esnext.typedarrays', 'esnext.error', 'esnext.sharedmemory', 'decorators', 'decorators.legacy'. +error TS6046: Argument for '--lib' option must be: 'es5', 'es6', 'es2015', 'es7', 'es2016', 'es2017', 'es2018', 'es2019', 'es2020', 'es2021', 'es2022', 'es2023', 'es2024', 'esnext', 'dom', 'dom.iterable', 'dom.asynciterable', 'webworker', 'webworker.importscripts', 'webworker.iterable', 'webworker.asynciterable', 'scripthost', 'es2015.core', 'es2015.collection', 'es2015.generator', 'es2015.iterable', 'es2015.promise', 'es2015.proxy', 'es2015.reflect', 'es2015.symbol', 'es2015.symbol.wellknown', 'es2016.array.include', 'es2016.intl', 'es2017.arraybuffer', 'es2017.date', 'es2017.object', 'es2017.sharedmemory', 'es2017.string', 'es2017.intl', 'es2017.typedarrays', 'es2018.asyncgenerator', 'es2018.asynciterable', 'es2018.intl', 'es2018.promise', 'es2018.regexp', 'es2019.array', 'es2019.object', 'es2019.string', 'es2019.symbol', 'es2019.intl', 'es2020.bigint', 'es2020.date', 'es2020.promise', 'es2020.sharedmemory', 'es2020.string', 'es2020.symbol.wellknown', 'es2020.intl', 'es2020.number', 'es2021.promise', 'es2021.string', 'es2021.weakref', 'es2021.intl', 'es2022.array', 'es2022.error', 'es2022.intl', 'es2022.object', 'es2022.string', 'es2022.regexp', 'es2023.array', 'es2023.collection', 'es2023.intl', 'es2024.arraybuffer', 'es2024.collection', 'es2024.object', 'es2024.promise', 'es2024.regexp', 'es2024.sharedmemory', 'es2024.string', 'esnext.array', 'esnext.collection', 'esnext.symbol', 'esnext.asynciterable', 'esnext.intl', 'esnext.disposable', 'esnext.bigint', 'esnext.string', 'esnext.promise', 'esnext.weakref', 'esnext.decorators', 'esnext.object', 'esnext.regexp', 'esnext.iterator', 'esnext.float16', 'esnext.typedarrays', 'esnext.error', 'esnext.sharedmemory', 'esnext.temporal', 'decorators', 'decorators.legacy'. diff --git a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert empty string option of libs to compiler-options with jsonSourceFile api.js b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert empty string option of libs to compiler-options with jsonSourceFile api.js index 28c1aadf33c64..5c672139ca785 100644 --- a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert empty string option of libs to compiler-options with jsonSourceFile api.js +++ b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert empty string option of libs to compiler-options with jsonSourceFile api.js @@ -33,7 +33,7 @@ CompilerOptions:: "configFilePath": "/apath/tsconfig.json" } Errors:: -tsconfig.json:9:7 - error TS6046: Argument for '--lib' option must be: 'es5', 'es6', 'es2015', 'es7', 'es2016', 'es2017', 'es2018', 'es2019', 'es2020', 'es2021', 'es2022', 'es2023', 'es2024', 'esnext', 'dom', 'dom.iterable', 'dom.asynciterable', 'webworker', 'webworker.importscripts', 'webworker.iterable', 'webworker.asynciterable', 'scripthost', 'es2015.core', 'es2015.collection', 'es2015.generator', 'es2015.iterable', 'es2015.promise', 'es2015.proxy', 'es2015.reflect', 'es2015.symbol', 'es2015.symbol.wellknown', 'es2016.array.include', 'es2016.intl', 'es2017.arraybuffer', 'es2017.date', 'es2017.object', 'es2017.sharedmemory', 'es2017.string', 'es2017.intl', 'es2017.typedarrays', 'es2018.asyncgenerator', 'es2018.asynciterable', 'es2018.intl', 'es2018.promise', 'es2018.regexp', 'es2019.array', 'es2019.object', 'es2019.string', 'es2019.symbol', 'es2019.intl', 'es2020.bigint', 'es2020.date', 'es2020.promise', 'es2020.sharedmemory', 'es2020.string', 'es2020.symbol.wellknown', 'es2020.intl', 'es2020.number', 'es2021.promise', 'es2021.string', 'es2021.weakref', 'es2021.intl', 'es2022.array', 'es2022.error', 'es2022.intl', 'es2022.object', 'es2022.string', 'es2022.regexp', 'es2023.array', 'es2023.collection', 'es2023.intl', 'es2024.arraybuffer', 'es2024.collection', 'es2024.object', 'es2024.promise', 'es2024.regexp', 'es2024.sharedmemory', 'es2024.string', 'esnext.array', 'esnext.collection', 'esnext.symbol', 'esnext.asynciterable', 'esnext.intl', 'esnext.disposable', 'esnext.bigint', 'esnext.string', 'esnext.promise', 'esnext.weakref', 'esnext.decorators', 'esnext.object', 'esnext.regexp', 'esnext.iterator', 'esnext.float16', 'esnext.typedarrays', 'esnext.error', 'esnext.sharedmemory', 'decorators', 'decorators.legacy'. +tsconfig.json:9:7 - error TS6046: Argument for '--lib' option must be: 'es5', 'es6', 'es2015', 'es7', 'es2016', 'es2017', 'es2018', 'es2019', 'es2020', 'es2021', 'es2022', 'es2023', 'es2024', 'esnext', 'dom', 'dom.iterable', 'dom.asynciterable', 'webworker', 'webworker.importscripts', 'webworker.iterable', 'webworker.asynciterable', 'scripthost', 'es2015.core', 'es2015.collection', 'es2015.generator', 'es2015.iterable', 'es2015.promise', 'es2015.proxy', 'es2015.reflect', 'es2015.symbol', 'es2015.symbol.wellknown', 'es2016.array.include', 'es2016.intl', 'es2017.arraybuffer', 'es2017.date', 'es2017.object', 'es2017.sharedmemory', 'es2017.string', 'es2017.intl', 'es2017.typedarrays', 'es2018.asyncgenerator', 'es2018.asynciterable', 'es2018.intl', 'es2018.promise', 'es2018.regexp', 'es2019.array', 'es2019.object', 'es2019.string', 'es2019.symbol', 'es2019.intl', 'es2020.bigint', 'es2020.date', 'es2020.promise', 'es2020.sharedmemory', 'es2020.string', 'es2020.symbol.wellknown', 'es2020.intl', 'es2020.number', 'es2021.promise', 'es2021.string', 'es2021.weakref', 'es2021.intl', 'es2022.array', 'es2022.error', 'es2022.intl', 'es2022.object', 'es2022.string', 'es2022.regexp', 'es2023.array', 'es2023.collection', 'es2023.intl', 'es2024.arraybuffer', 'es2024.collection', 'es2024.object', 'es2024.promise', 'es2024.regexp', 'es2024.sharedmemory', 'es2024.string', 'esnext.array', 'esnext.collection', 'esnext.symbol', 'esnext.asynciterable', 'esnext.intl', 'esnext.disposable', 'esnext.bigint', 'esnext.string', 'esnext.promise', 'esnext.weakref', 'esnext.decorators', 'esnext.object', 'esnext.regexp', 'esnext.iterator', 'esnext.float16', 'esnext.typedarrays', 'esnext.error', 'esnext.sharedmemory', 'esnext.temporal', 'decorators', 'decorators.legacy'. 9 ""    ~~ diff --git a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert incorrect option of libs to compiler-options with json api.js b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert incorrect option of libs to compiler-options with json api.js index dcaa13a3cfaf9..193526d720770 100644 --- a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert incorrect option of libs to compiler-options with json api.js +++ b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert incorrect option of libs to compiler-options with json api.js @@ -35,5 +35,5 @@ CompilerOptions:: "configFilePath": "/apath/tsconfig.json" } Errors:: -error TS6046: Argument for '--lib' option must be: 'es5', 'es6', 'es2015', 'es7', 'es2016', 'es2017', 'es2018', 'es2019', 'es2020', 'es2021', 'es2022', 'es2023', 'es2024', 'esnext', 'dom', 'dom.iterable', 'dom.asynciterable', 'webworker', 'webworker.importscripts', 'webworker.iterable', 'webworker.asynciterable', 'scripthost', 'es2015.core', 'es2015.collection', 'es2015.generator', 'es2015.iterable', 'es2015.promise', 'es2015.proxy', 'es2015.reflect', 'es2015.symbol', 'es2015.symbol.wellknown', 'es2016.array.include', 'es2016.intl', 'es2017.arraybuffer', 'es2017.date', 'es2017.object', 'es2017.sharedmemory', 'es2017.string', 'es2017.intl', 'es2017.typedarrays', 'es2018.asyncgenerator', 'es2018.asynciterable', 'es2018.intl', 'es2018.promise', 'es2018.regexp', 'es2019.array', 'es2019.object', 'es2019.string', 'es2019.symbol', 'es2019.intl', 'es2020.bigint', 'es2020.date', 'es2020.promise', 'es2020.sharedmemory', 'es2020.string', 'es2020.symbol.wellknown', 'es2020.intl', 'es2020.number', 'es2021.promise', 'es2021.string', 'es2021.weakref', 'es2021.intl', 'es2022.array', 'es2022.error', 'es2022.intl', 'es2022.object', 'es2022.string', 'es2022.regexp', 'es2023.array', 'es2023.collection', 'es2023.intl', 'es2024.arraybuffer', 'es2024.collection', 'es2024.object', 'es2024.promise', 'es2024.regexp', 'es2024.sharedmemory', 'es2024.string', 'esnext.array', 'esnext.collection', 'esnext.symbol', 'esnext.asynciterable', 'esnext.intl', 'esnext.disposable', 'esnext.bigint', 'esnext.string', 'esnext.promise', 'esnext.weakref', 'esnext.decorators', 'esnext.object', 'esnext.regexp', 'esnext.iterator', 'esnext.float16', 'esnext.typedarrays', 'esnext.error', 'esnext.sharedmemory', 'decorators', 'decorators.legacy'. +error TS6046: Argument for '--lib' option must be: 'es5', 'es6', 'es2015', 'es7', 'es2016', 'es2017', 'es2018', 'es2019', 'es2020', 'es2021', 'es2022', 'es2023', 'es2024', 'esnext', 'dom', 'dom.iterable', 'dom.asynciterable', 'webworker', 'webworker.importscripts', 'webworker.iterable', 'webworker.asynciterable', 'scripthost', 'es2015.core', 'es2015.collection', 'es2015.generator', 'es2015.iterable', 'es2015.promise', 'es2015.proxy', 'es2015.reflect', 'es2015.symbol', 'es2015.symbol.wellknown', 'es2016.array.include', 'es2016.intl', 'es2017.arraybuffer', 'es2017.date', 'es2017.object', 'es2017.sharedmemory', 'es2017.string', 'es2017.intl', 'es2017.typedarrays', 'es2018.asyncgenerator', 'es2018.asynciterable', 'es2018.intl', 'es2018.promise', 'es2018.regexp', 'es2019.array', 'es2019.object', 'es2019.string', 'es2019.symbol', 'es2019.intl', 'es2020.bigint', 'es2020.date', 'es2020.promise', 'es2020.sharedmemory', 'es2020.string', 'es2020.symbol.wellknown', 'es2020.intl', 'es2020.number', 'es2021.promise', 'es2021.string', 'es2021.weakref', 'es2021.intl', 'es2022.array', 'es2022.error', 'es2022.intl', 'es2022.object', 'es2022.string', 'es2022.regexp', 'es2023.array', 'es2023.collection', 'es2023.intl', 'es2024.arraybuffer', 'es2024.collection', 'es2024.object', 'es2024.promise', 'es2024.regexp', 'es2024.sharedmemory', 'es2024.string', 'esnext.array', 'esnext.collection', 'esnext.symbol', 'esnext.asynciterable', 'esnext.intl', 'esnext.disposable', 'esnext.bigint', 'esnext.string', 'esnext.promise', 'esnext.weakref', 'esnext.decorators', 'esnext.object', 'esnext.regexp', 'esnext.iterator', 'esnext.float16', 'esnext.typedarrays', 'esnext.error', 'esnext.sharedmemory', 'esnext.temporal', 'decorators', 'decorators.legacy'. diff --git a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert incorrect option of libs to compiler-options with jsonSourceFile api.js b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert incorrect option of libs to compiler-options with jsonSourceFile api.js index daa2dc0be2527..931924261d154 100644 --- a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert incorrect option of libs to compiler-options with jsonSourceFile api.js +++ b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert incorrect option of libs to compiler-options with jsonSourceFile api.js @@ -35,7 +35,7 @@ CompilerOptions:: "configFilePath": "/apath/tsconfig.json" } Errors:: -tsconfig.json:10:7 - error TS6046: Argument for '--lib' option must be: 'es5', 'es6', 'es2015', 'es7', 'es2016', 'es2017', 'es2018', 'es2019', 'es2020', 'es2021', 'es2022', 'es2023', 'es2024', 'esnext', 'dom', 'dom.iterable', 'dom.asynciterable', 'webworker', 'webworker.importscripts', 'webworker.iterable', 'webworker.asynciterable', 'scripthost', 'es2015.core', 'es2015.collection', 'es2015.generator', 'es2015.iterable', 'es2015.promise', 'es2015.proxy', 'es2015.reflect', 'es2015.symbol', 'es2015.symbol.wellknown', 'es2016.array.include', 'es2016.intl', 'es2017.arraybuffer', 'es2017.date', 'es2017.object', 'es2017.sharedmemory', 'es2017.string', 'es2017.intl', 'es2017.typedarrays', 'es2018.asyncgenerator', 'es2018.asynciterable', 'es2018.intl', 'es2018.promise', 'es2018.regexp', 'es2019.array', 'es2019.object', 'es2019.string', 'es2019.symbol', 'es2019.intl', 'es2020.bigint', 'es2020.date', 'es2020.promise', 'es2020.sharedmemory', 'es2020.string', 'es2020.symbol.wellknown', 'es2020.intl', 'es2020.number', 'es2021.promise', 'es2021.string', 'es2021.weakref', 'es2021.intl', 'es2022.array', 'es2022.error', 'es2022.intl', 'es2022.object', 'es2022.string', 'es2022.regexp', 'es2023.array', 'es2023.collection', 'es2023.intl', 'es2024.arraybuffer', 'es2024.collection', 'es2024.object', 'es2024.promise', 'es2024.regexp', 'es2024.sharedmemory', 'es2024.string', 'esnext.array', 'esnext.collection', 'esnext.symbol', 'esnext.asynciterable', 'esnext.intl', 'esnext.disposable', 'esnext.bigint', 'esnext.string', 'esnext.promise', 'esnext.weakref', 'esnext.decorators', 'esnext.object', 'esnext.regexp', 'esnext.iterator', 'esnext.float16', 'esnext.typedarrays', 'esnext.error', 'esnext.sharedmemory', 'decorators', 'decorators.legacy'. +tsconfig.json:10:7 - error TS6046: Argument for '--lib' option must be: 'es5', 'es6', 'es2015', 'es7', 'es2016', 'es2017', 'es2018', 'es2019', 'es2020', 'es2021', 'es2022', 'es2023', 'es2024', 'esnext', 'dom', 'dom.iterable', 'dom.asynciterable', 'webworker', 'webworker.importscripts', 'webworker.iterable', 'webworker.asynciterable', 'scripthost', 'es2015.core', 'es2015.collection', 'es2015.generator', 'es2015.iterable', 'es2015.promise', 'es2015.proxy', 'es2015.reflect', 'es2015.symbol', 'es2015.symbol.wellknown', 'es2016.array.include', 'es2016.intl', 'es2017.arraybuffer', 'es2017.date', 'es2017.object', 'es2017.sharedmemory', 'es2017.string', 'es2017.intl', 'es2017.typedarrays', 'es2018.asyncgenerator', 'es2018.asynciterable', 'es2018.intl', 'es2018.promise', 'es2018.regexp', 'es2019.array', 'es2019.object', 'es2019.string', 'es2019.symbol', 'es2019.intl', 'es2020.bigint', 'es2020.date', 'es2020.promise', 'es2020.sharedmemory', 'es2020.string', 'es2020.symbol.wellknown', 'es2020.intl', 'es2020.number', 'es2021.promise', 'es2021.string', 'es2021.weakref', 'es2021.intl', 'es2022.array', 'es2022.error', 'es2022.intl', 'es2022.object', 'es2022.string', 'es2022.regexp', 'es2023.array', 'es2023.collection', 'es2023.intl', 'es2024.arraybuffer', 'es2024.collection', 'es2024.object', 'es2024.promise', 'es2024.regexp', 'es2024.sharedmemory', 'es2024.string', 'esnext.array', 'esnext.collection', 'esnext.symbol', 'esnext.asynciterable', 'esnext.intl', 'esnext.disposable', 'esnext.bigint', 'esnext.string', 'esnext.promise', 'esnext.weakref', 'esnext.decorators', 'esnext.object', 'esnext.regexp', 'esnext.iterator', 'esnext.float16', 'esnext.typedarrays', 'esnext.error', 'esnext.sharedmemory', 'esnext.temporal', 'decorators', 'decorators.legacy'. 10 "incorrectLib"    ~~~~~~~~~~~~~~ diff --git a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert trailing-whitespace string option of libs to compiler-options with json api.js b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert trailing-whitespace string option of libs to compiler-options with json api.js index b925c34b7d945..0e805dfa3c58e 100644 --- a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert trailing-whitespace string option of libs to compiler-options with json api.js +++ b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert trailing-whitespace string option of libs to compiler-options with json api.js @@ -30,5 +30,5 @@ CompilerOptions:: "configFilePath": "/apath/tsconfig.json" } Errors:: -error TS6046: Argument for '--lib' option must be: 'es5', 'es6', 'es2015', 'es7', 'es2016', 'es2017', 'es2018', 'es2019', 'es2020', 'es2021', 'es2022', 'es2023', 'es2024', 'esnext', 'dom', 'dom.iterable', 'dom.asynciterable', 'webworker', 'webworker.importscripts', 'webworker.iterable', 'webworker.asynciterable', 'scripthost', 'es2015.core', 'es2015.collection', 'es2015.generator', 'es2015.iterable', 'es2015.promise', 'es2015.proxy', 'es2015.reflect', 'es2015.symbol', 'es2015.symbol.wellknown', 'es2016.array.include', 'es2016.intl', 'es2017.arraybuffer', 'es2017.date', 'es2017.object', 'es2017.sharedmemory', 'es2017.string', 'es2017.intl', 'es2017.typedarrays', 'es2018.asyncgenerator', 'es2018.asynciterable', 'es2018.intl', 'es2018.promise', 'es2018.regexp', 'es2019.array', 'es2019.object', 'es2019.string', 'es2019.symbol', 'es2019.intl', 'es2020.bigint', 'es2020.date', 'es2020.promise', 'es2020.sharedmemory', 'es2020.string', 'es2020.symbol.wellknown', 'es2020.intl', 'es2020.number', 'es2021.promise', 'es2021.string', 'es2021.weakref', 'es2021.intl', 'es2022.array', 'es2022.error', 'es2022.intl', 'es2022.object', 'es2022.string', 'es2022.regexp', 'es2023.array', 'es2023.collection', 'es2023.intl', 'es2024.arraybuffer', 'es2024.collection', 'es2024.object', 'es2024.promise', 'es2024.regexp', 'es2024.sharedmemory', 'es2024.string', 'esnext.array', 'esnext.collection', 'esnext.symbol', 'esnext.asynciterable', 'esnext.intl', 'esnext.disposable', 'esnext.bigint', 'esnext.string', 'esnext.promise', 'esnext.weakref', 'esnext.decorators', 'esnext.object', 'esnext.regexp', 'esnext.iterator', 'esnext.float16', 'esnext.typedarrays', 'esnext.error', 'esnext.sharedmemory', 'decorators', 'decorators.legacy'. +error TS6046: Argument for '--lib' option must be: 'es5', 'es6', 'es2015', 'es7', 'es2016', 'es2017', 'es2018', 'es2019', 'es2020', 'es2021', 'es2022', 'es2023', 'es2024', 'esnext', 'dom', 'dom.iterable', 'dom.asynciterable', 'webworker', 'webworker.importscripts', 'webworker.iterable', 'webworker.asynciterable', 'scripthost', 'es2015.core', 'es2015.collection', 'es2015.generator', 'es2015.iterable', 'es2015.promise', 'es2015.proxy', 'es2015.reflect', 'es2015.symbol', 'es2015.symbol.wellknown', 'es2016.array.include', 'es2016.intl', 'es2017.arraybuffer', 'es2017.date', 'es2017.object', 'es2017.sharedmemory', 'es2017.string', 'es2017.intl', 'es2017.typedarrays', 'es2018.asyncgenerator', 'es2018.asynciterable', 'es2018.intl', 'es2018.promise', 'es2018.regexp', 'es2019.array', 'es2019.object', 'es2019.string', 'es2019.symbol', 'es2019.intl', 'es2020.bigint', 'es2020.date', 'es2020.promise', 'es2020.sharedmemory', 'es2020.string', 'es2020.symbol.wellknown', 'es2020.intl', 'es2020.number', 'es2021.promise', 'es2021.string', 'es2021.weakref', 'es2021.intl', 'es2022.array', 'es2022.error', 'es2022.intl', 'es2022.object', 'es2022.string', 'es2022.regexp', 'es2023.array', 'es2023.collection', 'es2023.intl', 'es2024.arraybuffer', 'es2024.collection', 'es2024.object', 'es2024.promise', 'es2024.regexp', 'es2024.sharedmemory', 'es2024.string', 'esnext.array', 'esnext.collection', 'esnext.symbol', 'esnext.asynciterable', 'esnext.intl', 'esnext.disposable', 'esnext.bigint', 'esnext.string', 'esnext.promise', 'esnext.weakref', 'esnext.decorators', 'esnext.object', 'esnext.regexp', 'esnext.iterator', 'esnext.float16', 'esnext.typedarrays', 'esnext.error', 'esnext.sharedmemory', 'esnext.temporal', 'decorators', 'decorators.legacy'. diff --git a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert trailing-whitespace string option of libs to compiler-options with jsonSourceFile api.js b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert trailing-whitespace string option of libs to compiler-options with jsonSourceFile api.js index b6711b0ac7d6b..3192804b7a2da 100644 --- a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert trailing-whitespace string option of libs to compiler-options with jsonSourceFile api.js +++ b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert trailing-whitespace string option of libs to compiler-options with jsonSourceFile api.js @@ -30,7 +30,7 @@ CompilerOptions:: "configFilePath": "/apath/tsconfig.json" } Errors:: -tsconfig.json:8:7 - error TS6046: Argument for '--lib' option must be: 'es5', 'es6', 'es2015', 'es7', 'es2016', 'es2017', 'es2018', 'es2019', 'es2020', 'es2021', 'es2022', 'es2023', 'es2024', 'esnext', 'dom', 'dom.iterable', 'dom.asynciterable', 'webworker', 'webworker.importscripts', 'webworker.iterable', 'webworker.asynciterable', 'scripthost', 'es2015.core', 'es2015.collection', 'es2015.generator', 'es2015.iterable', 'es2015.promise', 'es2015.proxy', 'es2015.reflect', 'es2015.symbol', 'es2015.symbol.wellknown', 'es2016.array.include', 'es2016.intl', 'es2017.arraybuffer', 'es2017.date', 'es2017.object', 'es2017.sharedmemory', 'es2017.string', 'es2017.intl', 'es2017.typedarrays', 'es2018.asyncgenerator', 'es2018.asynciterable', 'es2018.intl', 'es2018.promise', 'es2018.regexp', 'es2019.array', 'es2019.object', 'es2019.string', 'es2019.symbol', 'es2019.intl', 'es2020.bigint', 'es2020.date', 'es2020.promise', 'es2020.sharedmemory', 'es2020.string', 'es2020.symbol.wellknown', 'es2020.intl', 'es2020.number', 'es2021.promise', 'es2021.string', 'es2021.weakref', 'es2021.intl', 'es2022.array', 'es2022.error', 'es2022.intl', 'es2022.object', 'es2022.string', 'es2022.regexp', 'es2023.array', 'es2023.collection', 'es2023.intl', 'es2024.arraybuffer', 'es2024.collection', 'es2024.object', 'es2024.promise', 'es2024.regexp', 'es2024.sharedmemory', 'es2024.string', 'esnext.array', 'esnext.collection', 'esnext.symbol', 'esnext.asynciterable', 'esnext.intl', 'esnext.disposable', 'esnext.bigint', 'esnext.string', 'esnext.promise', 'esnext.weakref', 'esnext.decorators', 'esnext.object', 'esnext.regexp', 'esnext.iterator', 'esnext.float16', 'esnext.typedarrays', 'esnext.error', 'esnext.sharedmemory', 'decorators', 'decorators.legacy'. +tsconfig.json:8:7 - error TS6046: Argument for '--lib' option must be: 'es5', 'es6', 'es2015', 'es7', 'es2016', 'es2017', 'es2018', 'es2019', 'es2020', 'es2021', 'es2022', 'es2023', 'es2024', 'esnext', 'dom', 'dom.iterable', 'dom.asynciterable', 'webworker', 'webworker.importscripts', 'webworker.iterable', 'webworker.asynciterable', 'scripthost', 'es2015.core', 'es2015.collection', 'es2015.generator', 'es2015.iterable', 'es2015.promise', 'es2015.proxy', 'es2015.reflect', 'es2015.symbol', 'es2015.symbol.wellknown', 'es2016.array.include', 'es2016.intl', 'es2017.arraybuffer', 'es2017.date', 'es2017.object', 'es2017.sharedmemory', 'es2017.string', 'es2017.intl', 'es2017.typedarrays', 'es2018.asyncgenerator', 'es2018.asynciterable', 'es2018.intl', 'es2018.promise', 'es2018.regexp', 'es2019.array', 'es2019.object', 'es2019.string', 'es2019.symbol', 'es2019.intl', 'es2020.bigint', 'es2020.date', 'es2020.promise', 'es2020.sharedmemory', 'es2020.string', 'es2020.symbol.wellknown', 'es2020.intl', 'es2020.number', 'es2021.promise', 'es2021.string', 'es2021.weakref', 'es2021.intl', 'es2022.array', 'es2022.error', 'es2022.intl', 'es2022.object', 'es2022.string', 'es2022.regexp', 'es2023.array', 'es2023.collection', 'es2023.intl', 'es2024.arraybuffer', 'es2024.collection', 'es2024.object', 'es2024.promise', 'es2024.regexp', 'es2024.sharedmemory', 'es2024.string', 'esnext.array', 'esnext.collection', 'esnext.symbol', 'esnext.asynciterable', 'esnext.intl', 'esnext.disposable', 'esnext.bigint', 'esnext.string', 'esnext.promise', 'esnext.weakref', 'esnext.decorators', 'esnext.object', 'esnext.regexp', 'esnext.iterator', 'esnext.float16', 'esnext.typedarrays', 'esnext.error', 'esnext.sharedmemory', 'esnext.temporal', 'decorators', 'decorators.legacy'. 8 " "    ~~~~~ diff --git a/tests/baselines/reference/libReplacement(libreplacement=true).trace.json b/tests/baselines/reference/libReplacement(libreplacement=true).trace.json index efb15146fd8d9..28bf420163aa7 100644 --- a/tests/baselines/reference/libReplacement(libreplacement=true).trace.json +++ b/tests/baselines/reference/libReplacement(libreplacement=true).trace.json @@ -1051,5 +1051,18 @@ "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", "Directory '/node_modules' does not exist, skipping all lookups in it.", - "======== Module name '@typescript/lib-esnext/typedarrays' was not resolved. ========" + "======== Module name '@typescript/lib-esnext/typedarrays' was not resolved. ========", + "======== Resolving module '@typescript/lib-esnext/temporal' from '/.src/__lib_node_modules_lookup_lib.esnext.temporal.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-esnext/temporal' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-esnext/temporal'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-esnext/temporal'", + "Loading module '@typescript/lib-esnext/temporal' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-esnext/temporal' was not resolved. ========" ] \ No newline at end of file diff --git a/tests/baselines/reference/nodeModulesExportsBlocksTypesVersions(module=nodenext).trace.json b/tests/baselines/reference/nodeModulesExportsBlocksTypesVersions(module=nodenext).trace.json index 2f98f83cf68ad..a4fee39a9473c 100644 --- a/tests/baselines/reference/nodeModulesExportsBlocksTypesVersions(module=nodenext).trace.json +++ b/tests/baselines/reference/nodeModulesExportsBlocksTypesVersions(module=nodenext).trace.json @@ -380,5 +380,7 @@ "File '/.ts/package.json' does not exist according to earlier cached lookups.", "File '/package.json' does not exist according to earlier cached lookups.", "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", "File '/package.json' does not exist according to earlier cached lookups." ] \ No newline at end of file diff --git a/tests/baselines/reference/nodeModulesPackageImports(module=nodenext).trace.json b/tests/baselines/reference/nodeModulesPackageImports(module=nodenext).trace.json index 7fca31951e91f..2131b29ff83e2 100644 --- a/tests/baselines/reference/nodeModulesPackageImports(module=nodenext).trace.json +++ b/tests/baselines/reference/nodeModulesPackageImports(module=nodenext).trace.json @@ -230,5 +230,7 @@ "File '/.ts/package.json' does not exist according to earlier cached lookups.", "File '/package.json' does not exist according to earlier cached lookups.", "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", "File '/package.json' does not exist according to earlier cached lookups." ] \ No newline at end of file diff --git a/tests/baselines/reference/nodeModulesPackagePatternExportsTrailers(module=nodenext).trace.json b/tests/baselines/reference/nodeModulesPackagePatternExportsTrailers(module=nodenext).trace.json index 6fc69895d9aec..111fbbb5ae640 100644 --- a/tests/baselines/reference/nodeModulesPackagePatternExportsTrailers(module=nodenext).trace.json +++ b/tests/baselines/reference/nodeModulesPackagePatternExportsTrailers(module=nodenext).trace.json @@ -329,5 +329,7 @@ "File '/.ts/package.json' does not exist according to earlier cached lookups.", "File '/package.json' does not exist according to earlier cached lookups.", "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", "File '/package.json' does not exist according to earlier cached lookups." ] \ No newline at end of file diff --git a/tests/baselines/reference/reactJsxReactResolvedNodeNext.trace.json b/tests/baselines/reference/reactJsxReactResolvedNodeNext.trace.json index 2683c0acc5e32..791ec1a3c1662 100644 --- a/tests/baselines/reference/reactJsxReactResolvedNodeNext.trace.json +++ b/tests/baselines/reference/reactJsxReactResolvedNodeNext.trace.json @@ -213,5 +213,7 @@ "File '/.ts/package.json' does not exist according to earlier cached lookups.", "File '/package.json' does not exist according to earlier cached lookups.", "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", "File '/package.json' does not exist according to earlier cached lookups." ] \ No newline at end of file diff --git a/tests/baselines/reference/reactJsxReactResolvedNodeNextEsm.trace.json b/tests/baselines/reference/reactJsxReactResolvedNodeNextEsm.trace.json index 7500fdec0948c..d74a63891d3b5 100644 --- a/tests/baselines/reference/reactJsxReactResolvedNodeNextEsm.trace.json +++ b/tests/baselines/reference/reactJsxReactResolvedNodeNextEsm.trace.json @@ -213,5 +213,7 @@ "File '/.ts/package.json' does not exist according to earlier cached lookups.", "File '/package.json' does not exist according to earlier cached lookups.", "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", "File '/package.json' does not exist according to earlier cached lookups." ] \ No newline at end of file diff --git a/tests/baselines/reference/tsc/commandLine/does-not-add-color-when-NO_COLOR-is-set.js b/tests/baselines/reference/tsc/commandLine/does-not-add-color-when-NO_COLOR-is-set.js index 12729b55ad4fe..323f9d0ed1a42 100644 --- a/tests/baselines/reference/tsc/commandLine/does-not-add-color-when-NO_COLOR-is-set.js +++ b/tests/baselines/reference/tsc/commandLine/does-not-add-color-when-NO_COLOR-is-set.js @@ -117,7 +117,7 @@ default: undefined --lib Specify a set of bundled library declaration files that describe the target runtime environment. -one or more: es5, es6/es2015, es7/es2016, es2017, es2018, es2019, es2020, es2021, es2022, es2023, es2024, esnext, dom, dom.iterable, dom.asynciterable, webworker, webworker.importscripts, webworker.iterable, webworker.asynciterable, scripthost, es2015.core, es2015.collection, es2015.generator, es2015.iterable, es2015.promise, es2015.proxy, es2015.reflect, es2015.symbol, es2015.symbol.wellknown, es2016.array.include, es2016.intl, es2017.arraybuffer, es2017.date, es2017.object, es2017.sharedmemory, es2017.string, es2017.intl, es2017.typedarrays, es2018.asyncgenerator, es2018.asynciterable/esnext.asynciterable, es2018.intl, es2018.promise, es2018.regexp, es2019.array, es2019.object, es2019.string, es2019.symbol/esnext.symbol, es2019.intl, es2020.bigint/esnext.bigint, es2020.date, es2020.promise, es2020.sharedmemory, es2020.string, es2020.symbol.wellknown, es2020.intl, es2020.number, es2021.promise, es2021.string, es2021.weakref/esnext.weakref, es2021.intl, es2022.array, es2022.error, es2022.intl, es2022.object, es2022.string, es2022.regexp, es2023.array, es2023.collection, es2023.intl, es2024.arraybuffer, es2024.collection, es2024.object/esnext.object, es2024.promise, es2024.regexp/esnext.regexp, es2024.sharedmemory, es2024.string/esnext.string, esnext.array, esnext.collection, esnext.intl, esnext.disposable, esnext.promise, esnext.decorators, esnext.iterator, esnext.float16, esnext.typedarrays, esnext.error, esnext.sharedmemory, decorators, decorators.legacy +one or more: es5, es6/es2015, es7/es2016, es2017, es2018, es2019, es2020, es2021, es2022, es2023, es2024, esnext, dom, dom.iterable, dom.asynciterable, webworker, webworker.importscripts, webworker.iterable, webworker.asynciterable, scripthost, es2015.core, es2015.collection, es2015.generator, es2015.iterable, es2015.promise, es2015.proxy, es2015.reflect, es2015.symbol, es2015.symbol.wellknown, es2016.array.include, es2016.intl, es2017.arraybuffer, es2017.date, es2017.object, es2017.sharedmemory, es2017.string, es2017.intl, es2017.typedarrays, es2018.asyncgenerator, es2018.asynciterable/esnext.asynciterable, es2018.intl, es2018.promise, es2018.regexp, es2019.array, es2019.object, es2019.string, es2019.symbol/esnext.symbol, es2019.intl, es2020.bigint/esnext.bigint, es2020.date, es2020.promise, es2020.sharedmemory, es2020.string, es2020.symbol.wellknown, es2020.intl, es2020.number, es2021.promise, es2021.string, es2021.weakref/esnext.weakref, es2021.intl, es2022.array, es2022.error, es2022.intl, es2022.object, es2022.string, es2022.regexp, es2023.array, es2023.collection, es2023.intl, es2024.arraybuffer, es2024.collection, es2024.object/esnext.object, es2024.promise, es2024.regexp/esnext.regexp, es2024.sharedmemory, es2024.string/esnext.string, esnext.array, esnext.collection, esnext.intl, esnext.disposable, esnext.promise, esnext.decorators, esnext.iterator, esnext.float16, esnext.typedarrays, esnext.error, esnext.sharedmemory, esnext.temporal, decorators, decorators.legacy default: undefined --allowJs diff --git a/tests/baselines/reference/tsc/commandLine/help-all.js b/tests/baselines/reference/tsc/commandLine/help-all.js index f0a4d50e418a5..02cc14b12c1ba 100644 --- a/tests/baselines/reference/tsc/commandLine/help-all.js +++ b/tests/baselines/reference/tsc/commandLine/help-all.js @@ -577,7 +577,7 @@ default: react --lib Specify a set of bundled library declaration files that describe the target runtime environment. -one or more: es5, es6/es2015, es7/es2016, es2017, es2018, es2019, es2020, es2021, es2022, es2023, es2024, esnext, dom, dom.iterable, dom.asynciterable, webworker, webworker.importscripts, webworker.iterable, webworker.asynciterable, scripthost, es2015.core, es2015.collection, es2015.generator, es2015.iterable, es2015.promise, es2015.proxy, es2015.reflect, es2015.symbol, es2015.symbol.wellknown, es2016.array.include, es2016.intl, es2017.arraybuffer, es2017.date, es2017.object, es2017.sharedmemory, es2017.string, es2017.intl, es2017.typedarrays, es2018.asyncgenerator, es2018.asynciterable/esnext.asynciterable, es2018.intl, es2018.promise, es2018.regexp, es2019.array, es2019.object, es2019.string, es2019.symbol/esnext.symbol, es2019.intl, es2020.bigint/esnext.bigint, es2020.date, es2020.promise, es2020.sharedmemory, es2020.string, es2020.symbol.wellknown, es2020.intl, es2020.number, es2021.promise, es2021.string, es2021.weakref/esnext.weakref, es2021.intl, es2022.array, es2022.error, es2022.intl, es2022.object, es2022.string, es2022.regexp, es2023.array, es2023.collection, es2023.intl, es2024.arraybuffer, es2024.collection, es2024.object/esnext.object, es2024.promise, es2024.regexp/esnext.regexp, es2024.sharedmemory, es2024.string/esnext.string, esnext.array, esnext.collection, esnext.intl, esnext.disposable, esnext.promise, esnext.decorators, esnext.iterator, esnext.float16, esnext.typedarrays, esnext.error, esnext.sharedmemory, decorators, decorators.legacy +one or more: es5, es6/es2015, es7/es2016, es2017, es2018, es2019, es2020, es2021, es2022, es2023, es2024, esnext, dom, dom.iterable, dom.asynciterable, webworker, webworker.importscripts, webworker.iterable, webworker.asynciterable, scripthost, es2015.core, es2015.collection, es2015.generator, es2015.iterable, es2015.promise, es2015.proxy, es2015.reflect, es2015.symbol, es2015.symbol.wellknown, es2016.array.include, es2016.intl, es2017.arraybuffer, es2017.date, es2017.object, es2017.sharedmemory, es2017.string, es2017.intl, es2017.typedarrays, es2018.asyncgenerator, es2018.asynciterable/esnext.asynciterable, es2018.intl, es2018.promise, es2018.regexp, es2019.array, es2019.object, es2019.string, es2019.symbol/esnext.symbol, es2019.intl, es2020.bigint/esnext.bigint, es2020.date, es2020.promise, es2020.sharedmemory, es2020.string, es2020.symbol.wellknown, es2020.intl, es2020.number, es2021.promise, es2021.string, es2021.weakref/esnext.weakref, es2021.intl, es2022.array, es2022.error, es2022.intl, es2022.object, es2022.string, es2022.regexp, es2023.array, es2023.collection, es2023.intl, es2024.arraybuffer, es2024.collection, es2024.object/esnext.object, es2024.promise, es2024.regexp/esnext.regexp, es2024.sharedmemory, es2024.string/esnext.string, esnext.array, esnext.collection, esnext.intl, esnext.disposable, esnext.promise, esnext.decorators, esnext.iterator, esnext.float16, esnext.typedarrays, esnext.error, esnext.sharedmemory, esnext.temporal, decorators, decorators.legacy default: undefined --libReplacement diff --git a/tests/baselines/reference/tsc/commandLine/help.js b/tests/baselines/reference/tsc/commandLine/help.js index 22cd46fc2a7a4..1edf731d90081 100644 --- a/tests/baselines/reference/tsc/commandLine/help.js +++ b/tests/baselines/reference/tsc/commandLine/help.js @@ -116,7 +116,7 @@ default: undefined --lib Specify a set of bundled library declaration files that describe the target runtime environment. -one or more: es5, es6/es2015, es7/es2016, es2017, es2018, es2019, es2020, es2021, es2022, es2023, es2024, esnext, dom, dom.iterable, dom.asynciterable, webworker, webworker.importscripts, webworker.iterable, webworker.asynciterable, scripthost, es2015.core, es2015.collection, es2015.generator, es2015.iterable, es2015.promise, es2015.proxy, es2015.reflect, es2015.symbol, es2015.symbol.wellknown, es2016.array.include, es2016.intl, es2017.arraybuffer, es2017.date, es2017.object, es2017.sharedmemory, es2017.string, es2017.intl, es2017.typedarrays, es2018.asyncgenerator, es2018.asynciterable/esnext.asynciterable, es2018.intl, es2018.promise, es2018.regexp, es2019.array, es2019.object, es2019.string, es2019.symbol/esnext.symbol, es2019.intl, es2020.bigint/esnext.bigint, es2020.date, es2020.promise, es2020.sharedmemory, es2020.string, es2020.symbol.wellknown, es2020.intl, es2020.number, es2021.promise, es2021.string, es2021.weakref/esnext.weakref, es2021.intl, es2022.array, es2022.error, es2022.intl, es2022.object, es2022.string, es2022.regexp, es2023.array, es2023.collection, es2023.intl, es2024.arraybuffer, es2024.collection, es2024.object/esnext.object, es2024.promise, es2024.regexp/esnext.regexp, es2024.sharedmemory, es2024.string/esnext.string, esnext.array, esnext.collection, esnext.intl, esnext.disposable, esnext.promise, esnext.decorators, esnext.iterator, esnext.float16, esnext.typedarrays, esnext.error, esnext.sharedmemory, decorators, decorators.legacy +one or more: es5, es6/es2015, es7/es2016, es2017, es2018, es2019, es2020, es2021, es2022, es2023, es2024, esnext, dom, dom.iterable, dom.asynciterable, webworker, webworker.importscripts, webworker.iterable, webworker.asynciterable, scripthost, es2015.core, es2015.collection, es2015.generator, es2015.iterable, es2015.promise, es2015.proxy, es2015.reflect, es2015.symbol, es2015.symbol.wellknown, es2016.array.include, es2016.intl, es2017.arraybuffer, es2017.date, es2017.object, es2017.sharedmemory, es2017.string, es2017.intl, es2017.typedarrays, es2018.asyncgenerator, es2018.asynciterable/esnext.asynciterable, es2018.intl, es2018.promise, es2018.regexp, es2019.array, es2019.object, es2019.string, es2019.symbol/esnext.symbol, es2019.intl, es2020.bigint/esnext.bigint, es2020.date, es2020.promise, es2020.sharedmemory, es2020.string, es2020.symbol.wellknown, es2020.intl, es2020.number, es2021.promise, es2021.string, es2021.weakref/esnext.weakref, es2021.intl, es2022.array, es2022.error, es2022.intl, es2022.object, es2022.string, es2022.regexp, es2023.array, es2023.collection, es2023.intl, es2024.arraybuffer, es2024.collection, es2024.object/esnext.object, es2024.promise, es2024.regexp/esnext.regexp, es2024.sharedmemory, es2024.string/esnext.string, esnext.array, esnext.collection, esnext.intl, esnext.disposable, esnext.promise, esnext.decorators, esnext.iterator, esnext.float16, esnext.typedarrays, esnext.error, esnext.sharedmemory, esnext.temporal, decorators, decorators.legacy default: undefined --allowJs diff --git a/tests/baselines/reference/tsc/commandLine/show-help-with-ExitStatus.DiagnosticsPresent_OutputsSkipped-when-host-can't-provide-terminal-width.js b/tests/baselines/reference/tsc/commandLine/show-help-with-ExitStatus.DiagnosticsPresent_OutputsSkipped-when-host-can't-provide-terminal-width.js index 6341254d3e748..cca44a2a416c0 100644 --- a/tests/baselines/reference/tsc/commandLine/show-help-with-ExitStatus.DiagnosticsPresent_OutputsSkipped-when-host-can't-provide-terminal-width.js +++ b/tests/baselines/reference/tsc/commandLine/show-help-with-ExitStatus.DiagnosticsPresent_OutputsSkipped-when-host-can't-provide-terminal-width.js @@ -117,7 +117,7 @@ default: undefined --lib Specify a set of bundled library declaration files that describe the target runtime environment. -one or more: es5, es6/es2015, es7/es2016, es2017, es2018, es2019, es2020, es2021, es2022, es2023, es2024, esnext, dom, dom.iterable, dom.asynciterable, webworker, webworker.importscripts, webworker.iterable, webworker.asynciterable, scripthost, es2015.core, es2015.collection, es2015.generator, es2015.iterable, es2015.promise, es2015.proxy, es2015.reflect, es2015.symbol, es2015.symbol.wellknown, es2016.array.include, es2016.intl, es2017.arraybuffer, es2017.date, es2017.object, es2017.sharedmemory, es2017.string, es2017.intl, es2017.typedarrays, es2018.asyncgenerator, es2018.asynciterable/esnext.asynciterable, es2018.intl, es2018.promise, es2018.regexp, es2019.array, es2019.object, es2019.string, es2019.symbol/esnext.symbol, es2019.intl, es2020.bigint/esnext.bigint, es2020.date, es2020.promise, es2020.sharedmemory, es2020.string, es2020.symbol.wellknown, es2020.intl, es2020.number, es2021.promise, es2021.string, es2021.weakref/esnext.weakref, es2021.intl, es2022.array, es2022.error, es2022.intl, es2022.object, es2022.string, es2022.regexp, es2023.array, es2023.collection, es2023.intl, es2024.arraybuffer, es2024.collection, es2024.object/esnext.object, es2024.promise, es2024.regexp/esnext.regexp, es2024.sharedmemory, es2024.string/esnext.string, esnext.array, esnext.collection, esnext.intl, esnext.disposable, esnext.promise, esnext.decorators, esnext.iterator, esnext.float16, esnext.typedarrays, esnext.error, esnext.sharedmemory, decorators, decorators.legacy +one or more: es5, es6/es2015, es7/es2016, es2017, es2018, es2019, es2020, es2021, es2022, es2023, es2024, esnext, dom, dom.iterable, dom.asynciterable, webworker, webworker.importscripts, webworker.iterable, webworker.asynciterable, scripthost, es2015.core, es2015.collection, es2015.generator, es2015.iterable, es2015.promise, es2015.proxy, es2015.reflect, es2015.symbol, es2015.symbol.wellknown, es2016.array.include, es2016.intl, es2017.arraybuffer, es2017.date, es2017.object, es2017.sharedmemory, es2017.string, es2017.intl, es2017.typedarrays, es2018.asyncgenerator, es2018.asynciterable/esnext.asynciterable, es2018.intl, es2018.promise, es2018.regexp, es2019.array, es2019.object, es2019.string, es2019.symbol/esnext.symbol, es2019.intl, es2020.bigint/esnext.bigint, es2020.date, es2020.promise, es2020.sharedmemory, es2020.string, es2020.symbol.wellknown, es2020.intl, es2020.number, es2021.promise, es2021.string, es2021.weakref/esnext.weakref, es2021.intl, es2022.array, es2022.error, es2022.intl, es2022.object, es2022.string, es2022.regexp, es2023.array, es2023.collection, es2023.intl, es2024.arraybuffer, es2024.collection, es2024.object/esnext.object, es2024.promise, es2024.regexp/esnext.regexp, es2024.sharedmemory, es2024.string/esnext.string, esnext.array, esnext.collection, esnext.intl, esnext.disposable, esnext.promise, esnext.decorators, esnext.iterator, esnext.float16, esnext.typedarrays, esnext.error, esnext.sharedmemory, esnext.temporal, decorators, decorators.legacy default: undefined --allowJs diff --git a/tests/baselines/reference/tsc/commandLine/show-help-with-ExitStatus.DiagnosticsPresent_OutputsSkipped.js b/tests/baselines/reference/tsc/commandLine/show-help-with-ExitStatus.DiagnosticsPresent_OutputsSkipped.js index 6341254d3e748..cca44a2a416c0 100644 --- a/tests/baselines/reference/tsc/commandLine/show-help-with-ExitStatus.DiagnosticsPresent_OutputsSkipped.js +++ b/tests/baselines/reference/tsc/commandLine/show-help-with-ExitStatus.DiagnosticsPresent_OutputsSkipped.js @@ -117,7 +117,7 @@ default: undefined --lib Specify a set of bundled library declaration files that describe the target runtime environment. -one or more: es5, es6/es2015, es7/es2016, es2017, es2018, es2019, es2020, es2021, es2022, es2023, es2024, esnext, dom, dom.iterable, dom.asynciterable, webworker, webworker.importscripts, webworker.iterable, webworker.asynciterable, scripthost, es2015.core, es2015.collection, es2015.generator, es2015.iterable, es2015.promise, es2015.proxy, es2015.reflect, es2015.symbol, es2015.symbol.wellknown, es2016.array.include, es2016.intl, es2017.arraybuffer, es2017.date, es2017.object, es2017.sharedmemory, es2017.string, es2017.intl, es2017.typedarrays, es2018.asyncgenerator, es2018.asynciterable/esnext.asynciterable, es2018.intl, es2018.promise, es2018.regexp, es2019.array, es2019.object, es2019.string, es2019.symbol/esnext.symbol, es2019.intl, es2020.bigint/esnext.bigint, es2020.date, es2020.promise, es2020.sharedmemory, es2020.string, es2020.symbol.wellknown, es2020.intl, es2020.number, es2021.promise, es2021.string, es2021.weakref/esnext.weakref, es2021.intl, es2022.array, es2022.error, es2022.intl, es2022.object, es2022.string, es2022.regexp, es2023.array, es2023.collection, es2023.intl, es2024.arraybuffer, es2024.collection, es2024.object/esnext.object, es2024.promise, es2024.regexp/esnext.regexp, es2024.sharedmemory, es2024.string/esnext.string, esnext.array, esnext.collection, esnext.intl, esnext.disposable, esnext.promise, esnext.decorators, esnext.iterator, esnext.float16, esnext.typedarrays, esnext.error, esnext.sharedmemory, decorators, decorators.legacy +one or more: es5, es6/es2015, es7/es2016, es2017, es2018, es2019, es2020, es2021, es2022, es2023, es2024, esnext, dom, dom.iterable, dom.asynciterable, webworker, webworker.importscripts, webworker.iterable, webworker.asynciterable, scripthost, es2015.core, es2015.collection, es2015.generator, es2015.iterable, es2015.promise, es2015.proxy, es2015.reflect, es2015.symbol, es2015.symbol.wellknown, es2016.array.include, es2016.intl, es2017.arraybuffer, es2017.date, es2017.object, es2017.sharedmemory, es2017.string, es2017.intl, es2017.typedarrays, es2018.asyncgenerator, es2018.asynciterable/esnext.asynciterable, es2018.intl, es2018.promise, es2018.regexp, es2019.array, es2019.object, es2019.string, es2019.symbol/esnext.symbol, es2019.intl, es2020.bigint/esnext.bigint, es2020.date, es2020.promise, es2020.sharedmemory, es2020.string, es2020.symbol.wellknown, es2020.intl, es2020.number, es2021.promise, es2021.string, es2021.weakref/esnext.weakref, es2021.intl, es2022.array, es2022.error, es2022.intl, es2022.object, es2022.string, es2022.regexp, es2023.array, es2023.collection, es2023.intl, es2024.arraybuffer, es2024.collection, es2024.object/esnext.object, es2024.promise, es2024.regexp/esnext.regexp, es2024.sharedmemory, es2024.string/esnext.string, esnext.array, esnext.collection, esnext.intl, esnext.disposable, esnext.promise, esnext.decorators, esnext.iterator, esnext.float16, esnext.typedarrays, esnext.error, esnext.sharedmemory, esnext.temporal, decorators, decorators.legacy default: undefined --allowJs diff --git a/tests/baselines/reference/tsc/ignoreConfig/without-any-options-when-config-file-absent-with---ignoreConfig.js b/tests/baselines/reference/tsc/ignoreConfig/without-any-options-when-config-file-absent-with---ignoreConfig.js index 1fa6fdc7af707..c2629a398ce95 100644 --- a/tests/baselines/reference/tsc/ignoreConfig/without-any-options-when-config-file-absent-with---ignoreConfig.js +++ b/tests/baselines/reference/tsc/ignoreConfig/without-any-options-when-config-file-absent-with---ignoreConfig.js @@ -126,7 +126,7 @@ default: undefined --lib Specify a set of bundled library declaration files that describe the target runtime environment. -one or more: es5, es6/es2015, es7/es2016, es2017, es2018, es2019, es2020, es2021, es2022, es2023, es2024, esnext, dom, dom.iterable, dom.asynciterable, webworker, webworker.importscripts, webworker.iterable, webworker.asynciterable, scripthost, es2015.core, es2015.collection, es2015.generator, es2015.iterable, es2015.promise, es2015.proxy, es2015.reflect, es2015.symbol, es2015.symbol.wellknown, es2016.array.include, es2016.intl, es2017.arraybuffer, es2017.date, es2017.object, es2017.sharedmemory, es2017.string, es2017.intl, es2017.typedarrays, es2018.asyncgenerator, es2018.asynciterable/esnext.asynciterable, es2018.intl, es2018.promise, es2018.regexp, es2019.array, es2019.object, es2019.string, es2019.symbol/esnext.symbol, es2019.intl, es2020.bigint/esnext.bigint, es2020.date, es2020.promise, es2020.sharedmemory, es2020.string, es2020.symbol.wellknown, es2020.intl, es2020.number, es2021.promise, es2021.string, es2021.weakref/esnext.weakref, es2021.intl, es2022.array, es2022.error, es2022.intl, es2022.object, es2022.string, es2022.regexp, es2023.array, es2023.collection, es2023.intl, es2024.arraybuffer, es2024.collection, es2024.object/esnext.object, es2024.promise, es2024.regexp/esnext.regexp, es2024.sharedmemory, es2024.string/esnext.string, esnext.array, esnext.collection, esnext.intl, esnext.disposable, esnext.promise, esnext.decorators, esnext.iterator, esnext.float16, esnext.typedarrays, esnext.error, esnext.sharedmemory, decorators, decorators.legacy +one or more: es5, es6/es2015, es7/es2016, es2017, es2018, es2019, es2020, es2021, es2022, es2023, es2024, esnext, dom, dom.iterable, dom.asynciterable, webworker, webworker.importscripts, webworker.iterable, webworker.asynciterable, scripthost, es2015.core, es2015.collection, es2015.generator, es2015.iterable, es2015.promise, es2015.proxy, es2015.reflect, es2015.symbol, es2015.symbol.wellknown, es2016.array.include, es2016.intl, es2017.arraybuffer, es2017.date, es2017.object, es2017.sharedmemory, es2017.string, es2017.intl, es2017.typedarrays, es2018.asyncgenerator, es2018.asynciterable/esnext.asynciterable, es2018.intl, es2018.promise, es2018.regexp, es2019.array, es2019.object, es2019.string, es2019.symbol/esnext.symbol, es2019.intl, es2020.bigint/esnext.bigint, es2020.date, es2020.promise, es2020.sharedmemory, es2020.string, es2020.symbol.wellknown, es2020.intl, es2020.number, es2021.promise, es2021.string, es2021.weakref/esnext.weakref, es2021.intl, es2022.array, es2022.error, es2022.intl, es2022.object, es2022.string, es2022.regexp, es2023.array, es2023.collection, es2023.intl, es2024.arraybuffer, es2024.collection, es2024.object/esnext.object, es2024.promise, es2024.regexp/esnext.regexp, es2024.sharedmemory, es2024.string/esnext.string, esnext.array, esnext.collection, esnext.intl, esnext.disposable, esnext.promise, esnext.decorators, esnext.iterator, esnext.float16, esnext.typedarrays, esnext.error, esnext.sharedmemory, esnext.temporal, decorators, decorators.legacy default: undefined --allowJs diff --git a/tests/baselines/reference/tsc/ignoreConfig/without-any-options-when-config-file-absent.js b/tests/baselines/reference/tsc/ignoreConfig/without-any-options-when-config-file-absent.js index 1fcbaf3afb591..bd81958091295 100644 --- a/tests/baselines/reference/tsc/ignoreConfig/without-any-options-when-config-file-absent.js +++ b/tests/baselines/reference/tsc/ignoreConfig/without-any-options-when-config-file-absent.js @@ -126,7 +126,7 @@ default: undefined --lib Specify a set of bundled library declaration files that describe the target runtime environment. -one or more: es5, es6/es2015, es7/es2016, es2017, es2018, es2019, es2020, es2021, es2022, es2023, es2024, esnext, dom, dom.iterable, dom.asynciterable, webworker, webworker.importscripts, webworker.iterable, webworker.asynciterable, scripthost, es2015.core, es2015.collection, es2015.generator, es2015.iterable, es2015.promise, es2015.proxy, es2015.reflect, es2015.symbol, es2015.symbol.wellknown, es2016.array.include, es2016.intl, es2017.arraybuffer, es2017.date, es2017.object, es2017.sharedmemory, es2017.string, es2017.intl, es2017.typedarrays, es2018.asyncgenerator, es2018.asynciterable/esnext.asynciterable, es2018.intl, es2018.promise, es2018.regexp, es2019.array, es2019.object, es2019.string, es2019.symbol/esnext.symbol, es2019.intl, es2020.bigint/esnext.bigint, es2020.date, es2020.promise, es2020.sharedmemory, es2020.string, es2020.symbol.wellknown, es2020.intl, es2020.number, es2021.promise, es2021.string, es2021.weakref/esnext.weakref, es2021.intl, es2022.array, es2022.error, es2022.intl, es2022.object, es2022.string, es2022.regexp, es2023.array, es2023.collection, es2023.intl, es2024.arraybuffer, es2024.collection, es2024.object/esnext.object, es2024.promise, es2024.regexp/esnext.regexp, es2024.sharedmemory, es2024.string/esnext.string, esnext.array, esnext.collection, esnext.intl, esnext.disposable, esnext.promise, esnext.decorators, esnext.iterator, esnext.float16, esnext.typedarrays, esnext.error, esnext.sharedmemory, decorators, decorators.legacy +one or more: es5, es6/es2015, es7/es2016, es2017, es2018, es2019, es2020, es2021, es2022, es2023, es2024, esnext, dom, dom.iterable, dom.asynciterable, webworker, webworker.importscripts, webworker.iterable, webworker.asynciterable, scripthost, es2015.core, es2015.collection, es2015.generator, es2015.iterable, es2015.promise, es2015.proxy, es2015.reflect, es2015.symbol, es2015.symbol.wellknown, es2016.array.include, es2016.intl, es2017.arraybuffer, es2017.date, es2017.object, es2017.sharedmemory, es2017.string, es2017.intl, es2017.typedarrays, es2018.asyncgenerator, es2018.asynciterable/esnext.asynciterable, es2018.intl, es2018.promise, es2018.regexp, es2019.array, es2019.object, es2019.string, es2019.symbol/esnext.symbol, es2019.intl, es2020.bigint/esnext.bigint, es2020.date, es2020.promise, es2020.sharedmemory, es2020.string, es2020.symbol.wellknown, es2020.intl, es2020.number, es2021.promise, es2021.string, es2021.weakref/esnext.weakref, es2021.intl, es2022.array, es2022.error, es2022.intl, es2022.object, es2022.string, es2022.regexp, es2023.array, es2023.collection, es2023.intl, es2024.arraybuffer, es2024.collection, es2024.object/esnext.object, es2024.promise, es2024.regexp/esnext.regexp, es2024.sharedmemory, es2024.string/esnext.string, esnext.array, esnext.collection, esnext.intl, esnext.disposable, esnext.promise, esnext.decorators, esnext.iterator, esnext.float16, esnext.typedarrays, esnext.error, esnext.sharedmemory, esnext.temporal, decorators, decorators.legacy default: undefined --allowJs diff --git a/tests/baselines/reference/tscWatch/symlinks/monorepo-style-sibling-packages-symlinked-Linux.js b/tests/baselines/reference/tscWatch/symlinks/monorepo-style-sibling-packages-symlinked-Linux.js index eec79d1b4d608..a9d7584a57057 100644 --- a/tests/baselines/reference/tscWatch/symlinks/monorepo-style-sibling-packages-symlinked-Linux.js +++ b/tests/baselines/reference/tscWatch/symlinks/monorepo-style-sibling-packages-symlinked-Linux.js @@ -180,12 +180,12 @@ Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/projects/project/p //// [/home/src/tslibs/TS/Lib/lib.es2016.full.d.ts] *Lib* Inode:: 31 -//// [/home/src/projects/project/packages/package2/dist/index.js] Inode:: 123 +//// [/home/src/projects/project/packages/package2/dist/index.js] Inode:: 124 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -//// [/home/src/projects/project/packages/package2/dist/index.d.ts] Inode:: 124 +//// [/home/src/projects/project/packages/package2/dist/index.d.ts] Inode:: 125 export {}; @@ -220,7 +220,7 @@ FsWatches:: /home/src/projects/project/packages/package2: *new* {"inode":11} /home/src/projects/project/packages/package2/dist: *new* - {"inode":122} + {"inode":123} /home/src/projects/project/packages/package2/package.json: *new* {"inode":12} /home/src/projects/project/packages/package2/src: *new* @@ -270,20 +270,20 @@ exitCode:: ExitStatus.undefined Change:: Build dependencies Input:: -//// [/home/src/projects/project/packages/package1/dist/index.js] Inode:: 126 +//// [/home/src/projects/project/packages/package1/dist/index.js] Inode:: 127 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -//// [/home/src/projects/project/packages/package1/dist/index.d.ts] Inode:: 127 +//// [/home/src/projects/project/packages/package1/dist/index.d.ts] Inode:: 128 export type FooType = "foo"; export type BarType = "bar"; -//// [/home/src/projects/project/packages/package1/tsconfig.tsbuildinfo] Inode:: 128 +//// [/home/src/projects/project/packages/package1/tsconfig.tsbuildinfo] Inode:: 129 {"root":["./src/index.ts"],"version":"FakeTSVersion"} -//// [/home/src/projects/project/packages/package1/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 129 +//// [/home/src/projects/project/packages/package1/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 130 { "root": [ "./src/index.ts" @@ -335,7 +335,7 @@ FsWatches:: /home/src/projects/project/packages/package1: {"inode":6} /home/src/projects/project/packages/package1/dist: *new* - {"inode":125} + {"inode":126} /home/src/projects/project/packages/package1/package.json: {"inode":7} /home/src/projects/project/packages/package1/src: @@ -343,7 +343,7 @@ FsWatches:: /home/src/projects/project/packages/package2: {"inode":11} /home/src/projects/project/packages/package2/dist: - {"inode":122} + {"inode":123} /home/src/projects/project/packages/package2/package.json: {"inode":12} /home/src/projects/project/packages/package2/src: @@ -421,8 +421,8 @@ packages/package2/src/index.ts -//// [/home/src/projects/project/packages/package2/dist/index.js] file written with same contents Inode:: 123 -//// [/home/src/projects/project/packages/package2/dist/index.d.ts] file written with same contents Inode:: 124 +//// [/home/src/projects/project/packages/package2/dist/index.js] file written with same contents Inode:: 124 +//// [/home/src/projects/project/packages/package2/dist/index.d.ts] file written with same contents Inode:: 125 PolledWatches:: /home/src/projects/node_modules/@types: @@ -450,9 +450,9 @@ FsWatches:: /home/src/projects/project/packages/package1: {"inode":6} /home/src/projects/project/packages/package1/dist: - {"inode":125} + {"inode":126} /home/src/projects/project/packages/package1/dist/index.d.ts: *new* - {"inode":127} + {"inode":128} /home/src/projects/project/packages/package1/package.json: {"inode":7} /home/src/projects/project/packages/package1/src: @@ -460,7 +460,7 @@ FsWatches:: /home/src/projects/project/packages/package2: {"inode":11} /home/src/projects/project/packages/package2/dist: - {"inode":122} + {"inode":123} /home/src/projects/project/packages/package2/package.json: {"inode":12} /home/src/projects/project/packages/package2/src: @@ -555,7 +555,7 @@ FsWatches:: /home/src/projects/project/packages/package2: {"inode":11} /home/src/projects/project/packages/package2/dist: - {"inode":122} + {"inode":123} /home/src/projects/project/packages/package2/package.json: {"inode":12} /home/src/projects/project/packages/package2/src: @@ -569,9 +569,9 @@ FsWatches:: FsWatches *deleted*:: /home/src/projects/project/packages/package1/dist: - {"inode":125} + {"inode":126} /home/src/projects/project/packages/package1/dist/index.d.ts: - {"inode":127} + {"inode":128} Timeout callback:: count: 2 10: timerToUpdateProgram *new* @@ -657,8 +657,8 @@ Scheduling invalidateFailedLookup, Cancelled earlier one Elapsed:: *ms DirectoryWatcher:: Triggered with /home/src/projects/project/node_modules/package1 :: WatchInfo: /home/src/projects/project/node_modules/package1 1 undefined Failed Lookup Locations -//// [/home/src/projects/project/packages/package2/dist/index.js] file written with same contents Inode:: 123 -//// [/home/src/projects/project/packages/package2/dist/index.d.ts] file written with same contents Inode:: 124 +//// [/home/src/projects/project/packages/package2/dist/index.js] file written with same contents Inode:: 124 +//// [/home/src/projects/project/packages/package2/dist/index.d.ts] file written with same contents Inode:: 125 PolledWatches:: /home/src/projects/node_modules: *new* @@ -696,7 +696,7 @@ FsWatches:: /home/src/projects/project/packages/package2: {"inode":11} /home/src/projects/project/packages/package2/dist: - {"inode":122} + {"inode":123} /home/src/projects/project/packages/package2/package.json: {"inode":12} /home/src/projects/project/packages/package2/src: @@ -874,14 +874,14 @@ exitCode:: ExitStatus.undefined Change:: Build dependencies Input:: -//// [/home/src/projects/project/packages/package1/tsconfig.tsbuildinfo] file written with same contents Inode:: 128 -//// [/home/src/projects/project/packages/package1/tsconfig.tsbuildinfo.readable.baseline.txt] file written with same contents Inode:: 129 -//// [/home/src/projects/project/packages/package1/dist/index.js] Inode:: 131 +//// [/home/src/projects/project/packages/package1/tsconfig.tsbuildinfo] file written with same contents Inode:: 129 +//// [/home/src/projects/project/packages/package1/tsconfig.tsbuildinfo.readable.baseline.txt] file written with same contents Inode:: 130 +//// [/home/src/projects/project/packages/package1/dist/index.js] Inode:: 132 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -//// [/home/src/projects/project/packages/package1/dist/index.d.ts] Inode:: 132 +//// [/home/src/projects/project/packages/package1/dist/index.d.ts] Inode:: 133 export type FooType = "foo"; export type BarType = "bar"; @@ -928,7 +928,7 @@ FsWatches:: /home/src/projects/project/packages/package1: {"inode":6} /home/src/projects/project/packages/package1/dist: *new* - {"inode":130} + {"inode":131} /home/src/projects/project/packages/package1/package.json: {"inode":7} /home/src/projects/project/packages/package1/src: @@ -936,7 +936,7 @@ FsWatches:: /home/src/projects/project/packages/package2: {"inode":11} /home/src/projects/project/packages/package2/dist: - {"inode":122} + {"inode":123} /home/src/projects/project/packages/package2/package.json: {"inode":12} /home/src/projects/project/packages/package2/src: @@ -1014,8 +1014,8 @@ packages/package2/src/index.ts -//// [/home/src/projects/project/packages/package2/dist/index.js] file written with same contents Inode:: 123 -//// [/home/src/projects/project/packages/package2/dist/index.d.ts] file written with same contents Inode:: 124 +//// [/home/src/projects/project/packages/package2/dist/index.js] file written with same contents Inode:: 124 +//// [/home/src/projects/project/packages/package2/dist/index.d.ts] file written with same contents Inode:: 125 PolledWatches:: /home/src/projects/node_modules/@types: @@ -1043,9 +1043,9 @@ FsWatches:: /home/src/projects/project/packages/package1: {"inode":6} /home/src/projects/project/packages/package1/dist: - {"inode":130} + {"inode":131} /home/src/projects/project/packages/package1/dist/index.d.ts: *new* - {"inode":132} + {"inode":133} /home/src/projects/project/packages/package1/package.json: {"inode":7} /home/src/projects/project/packages/package1/src: @@ -1053,7 +1053,7 @@ FsWatches:: /home/src/projects/project/packages/package2: {"inode":11} /home/src/projects/project/packages/package2/dist: - {"inode":122} + {"inode":123} /home/src/projects/project/packages/package2/package.json: {"inode":12} /home/src/projects/project/packages/package2/src: diff --git a/tests/baselines/reference/tscWatch/symlinks/monorepo-style-sibling-packages-symlinked-package1-built-Linux.js b/tests/baselines/reference/tscWatch/symlinks/monorepo-style-sibling-packages-symlinked-package1-built-Linux.js index b4be4b2b34d7f..5de3ecc7aeb03 100644 --- a/tests/baselines/reference/tscWatch/symlinks/monorepo-style-sibling-packages-symlinked-package1-built-Linux.js +++ b/tests/baselines/reference/tscWatch/symlinks/monorepo-style-sibling-packages-symlinked-package1-built-Linux.js @@ -83,20 +83,20 @@ declare const console: { log(msg: any): void; }; //// [/home/src/tslibs/TS/Lib/lib.es2016.full.d.ts] *Lib* Inode:: 31 -//// [/home/src/projects/project/packages/package1/dist/index.js] Inode:: 123 +//// [/home/src/projects/project/packages/package1/dist/index.js] Inode:: 124 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -//// [/home/src/projects/project/packages/package1/dist/index.d.ts] Inode:: 124 +//// [/home/src/projects/project/packages/package1/dist/index.d.ts] Inode:: 125 export type FooType = "foo"; export type BarType = "bar"; -//// [/home/src/projects/project/packages/package1/tsconfig.tsbuildinfo] Inode:: 125 +//// [/home/src/projects/project/packages/package1/tsconfig.tsbuildinfo] Inode:: 126 {"root":["./src/index.ts"],"version":"FakeTSVersion"} -//// [/home/src/projects/project/packages/package1/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 126 +//// [/home/src/projects/project/packages/package1/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 127 { "root": [ "./src/index.ts" @@ -176,12 +176,12 @@ DirectoryWatcher:: Added:: WatchInfo: /home/src/projects/project/packages/packag Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/projects/project/packages/package2 1 undefined Wild card directory -//// [/home/src/projects/project/packages/package2/dist/index.js] Inode:: 128 +//// [/home/src/projects/project/packages/package2/dist/index.js] Inode:: 129 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -//// [/home/src/projects/project/packages/package2/dist/index.d.ts] Inode:: 129 +//// [/home/src/projects/project/packages/package2/dist/index.d.ts] Inode:: 130 export {}; @@ -208,9 +208,9 @@ FsWatches:: /home/src/projects/project/packages/package1: *new* {"inode":6} /home/src/projects/project/packages/package1/dist: *new* - {"inode":122} + {"inode":123} /home/src/projects/project/packages/package1/dist/index.d.ts: *new* - {"inode":124} + {"inode":125} /home/src/projects/project/packages/package1/package.json: *new* {"inode":7} /home/src/projects/project/packages/package1/src: *new* @@ -218,7 +218,7 @@ FsWatches:: /home/src/projects/project/packages/package2: *new* {"inode":11} /home/src/projects/project/packages/package2/dist: *new* - {"inode":127} + {"inode":128} /home/src/projects/project/packages/package2/package.json: *new* {"inode":12} /home/src/projects/project/packages/package2/src: *new* @@ -314,7 +314,7 @@ FsWatches:: /home/src/projects/project/packages/package2: {"inode":11} /home/src/projects/project/packages/package2/dist: - {"inode":127} + {"inode":128} /home/src/projects/project/packages/package2/package.json: {"inode":12} /home/src/projects/project/packages/package2/src: @@ -328,9 +328,9 @@ FsWatches:: FsWatches *deleted*:: /home/src/projects/project/packages/package1/dist: - {"inode":122} + {"inode":123} /home/src/projects/project/packages/package1/dist/index.d.ts: - {"inode":124} + {"inode":125} Timeout callback:: count: 2 1: timerToUpdateProgram *new* @@ -419,8 +419,8 @@ Elapsed:: *ms DirectoryWatcher:: Triggered with /home/src/projects/project/node_ sysLog:: Elapsed:: *ms:: onTimerToUpdateChildWatches:: 0 undefined -//// [/home/src/projects/project/packages/package2/dist/index.js] file written with same contents Inode:: 128 -//// [/home/src/projects/project/packages/package2/dist/index.d.ts] file written with same contents Inode:: 129 +//// [/home/src/projects/project/packages/package2/dist/index.js] file written with same contents Inode:: 129 +//// [/home/src/projects/project/packages/package2/dist/index.d.ts] file written with same contents Inode:: 130 PolledWatches:: /home/src/projects/node_modules: *new* @@ -458,7 +458,7 @@ FsWatches:: /home/src/projects/project/packages/package2: {"inode":11} /home/src/projects/project/packages/package2/dist: - {"inode":127} + {"inode":128} /home/src/projects/project/packages/package2/package.json: {"inode":12} /home/src/projects/project/packages/package2/src: @@ -636,14 +636,14 @@ exitCode:: ExitStatus.undefined Change:: Build dependencies Input:: -//// [/home/src/projects/project/packages/package1/tsconfig.tsbuildinfo] file written with same contents Inode:: 125 -//// [/home/src/projects/project/packages/package1/tsconfig.tsbuildinfo.readable.baseline.txt] file written with same contents Inode:: 126 -//// [/home/src/projects/project/packages/package1/dist/index.js] Inode:: 131 +//// [/home/src/projects/project/packages/package1/tsconfig.tsbuildinfo] file written with same contents Inode:: 126 +//// [/home/src/projects/project/packages/package1/tsconfig.tsbuildinfo.readable.baseline.txt] file written with same contents Inode:: 127 +//// [/home/src/projects/project/packages/package1/dist/index.js] Inode:: 132 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -//// [/home/src/projects/project/packages/package1/dist/index.d.ts] Inode:: 132 +//// [/home/src/projects/project/packages/package1/dist/index.d.ts] Inode:: 133 export type FooType = "foo"; export type BarType = "bar"; @@ -690,7 +690,7 @@ FsWatches:: /home/src/projects/project/packages/package1: {"inode":6} /home/src/projects/project/packages/package1/dist: *new* - {"inode":130} + {"inode":131} /home/src/projects/project/packages/package1/package.json: {"inode":7} /home/src/projects/project/packages/package1/src: @@ -698,7 +698,7 @@ FsWatches:: /home/src/projects/project/packages/package2: {"inode":11} /home/src/projects/project/packages/package2/dist: - {"inode":127} + {"inode":128} /home/src/projects/project/packages/package2/package.json: {"inode":12} /home/src/projects/project/packages/package2/src: @@ -776,8 +776,8 @@ packages/package2/src/index.ts -//// [/home/src/projects/project/packages/package2/dist/index.js] file written with same contents Inode:: 128 -//// [/home/src/projects/project/packages/package2/dist/index.d.ts] file written with same contents Inode:: 129 +//// [/home/src/projects/project/packages/package2/dist/index.js] file written with same contents Inode:: 129 +//// [/home/src/projects/project/packages/package2/dist/index.d.ts] file written with same contents Inode:: 130 PolledWatches:: /home/src/projects/node_modules/@types: @@ -805,9 +805,9 @@ FsWatches:: /home/src/projects/project/packages/package1: {"inode":6} /home/src/projects/project/packages/package1/dist: - {"inode":130} + {"inode":131} /home/src/projects/project/packages/package1/dist/index.d.ts: *new* - {"inode":132} + {"inode":133} /home/src/projects/project/packages/package1/package.json: {"inode":7} /home/src/projects/project/packages/package1/src: @@ -815,7 +815,7 @@ FsWatches:: /home/src/projects/project/packages/package2: {"inode":11} /home/src/projects/project/packages/package2/dist: - {"inode":127} + {"inode":128} /home/src/projects/project/packages/package2/package.json: {"inode":12} /home/src/projects/project/packages/package2/src: diff --git a/tests/baselines/reference/tscWatch/symlinks/packages-outside-project-folder-Linux.js b/tests/baselines/reference/tscWatch/symlinks/packages-outside-project-folder-Linux.js index a6ff0220d8f39..da4361f0c93af 100644 --- a/tests/baselines/reference/tscWatch/symlinks/packages-outside-project-folder-Linux.js +++ b/tests/baselines/reference/tscWatch/symlinks/packages-outside-project-folder-Linux.js @@ -203,7 +203,7 @@ DirectoryWatcher:: Added:: WatchInfo: /home/src/projects/b/2/b-impl/b/src 1 unde Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/projects/b/2/b-impl/b/src 1 undefined Wild card directory -//// [/home/src/projects/b/2/b-impl/b/lib/index.js] Inode:: 144 +//// [/home/src/projects/b/2/b-impl/b/lib/index.js] Inode:: 145 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); @@ -291,7 +291,7 @@ exitCode:: ExitStatus.undefined Change:: change in unrelated folder in a Input:: -//// [/home/src/projects/a/2/unrelated/somethingUnrelated.ts] Inode:: 145 +//// [/home/src/projects/a/2/unrelated/somethingUnrelated.ts] Inode:: 146 export const a = 10; @@ -309,7 +309,7 @@ exitCode:: ExitStatus.undefined Change:: change in unrelated folder in c Input:: -//// [/home/src/projects/c/4/unrelated/somethingUnrelated.ts] Inode:: 146 +//// [/home/src/projects/c/4/unrelated/somethingUnrelated.ts] Inode:: 147 export const a = 10; @@ -327,18 +327,18 @@ exitCode:: ExitStatus.undefined Change:: Build dependencies Input:: -//// [/home/src/projects/c/3/c-impl/c/lib/c.js] Inode:: 148 +//// [/home/src/projects/c/3/c-impl/c/lib/c.js] Inode:: 149 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.c = void 0; exports.c = 'test'; -//// [/home/src/projects/c/3/c-impl/c/lib/c.d.ts] Inode:: 149 +//// [/home/src/projects/c/3/c-impl/c/lib/c.d.ts] Inode:: 150 export declare const c: string; -//// [/home/src/projects/c/3/c-impl/c/lib/index.js] Inode:: 150 +//// [/home/src/projects/c/3/c-impl/c/lib/index.js] Inode:: 151 "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; @@ -358,14 +358,14 @@ Object.defineProperty(exports, "__esModule", { value: true }); __exportStar(require("./c"), exports); -//// [/home/src/projects/c/3/c-impl/c/lib/index.d.ts] Inode:: 151 +//// [/home/src/projects/c/3/c-impl/c/lib/index.d.ts] Inode:: 152 export * from './c'; -//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo] Inode:: 152 +//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo] Inode:: 153 {"root":["../src/c.ts","../src/index.ts"],"version":"FakeTSVersion"} -//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 153 +//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 154 { "root": [ "../src/c.ts", @@ -375,18 +375,18 @@ export * from './c'; "size": 68 } -//// [/home/src/projects/a/1/a-impl/a/lib/a.js] Inode:: 155 +//// [/home/src/projects/a/1/a-impl/a/lib/a.js] Inode:: 156 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.a = void 0; exports.a = 'test'; -//// [/home/src/projects/a/1/a-impl/a/lib/a.d.ts] Inode:: 156 +//// [/home/src/projects/a/1/a-impl/a/lib/a.d.ts] Inode:: 157 export declare const a: string; -//// [/home/src/projects/a/1/a-impl/a/lib/index.js] Inode:: 157 +//// [/home/src/projects/a/1/a-impl/a/lib/index.js] Inode:: 158 "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; @@ -407,15 +407,15 @@ __exportStar(require("./a"), exports); __exportStar(require("c"), exports); -//// [/home/src/projects/a/1/a-impl/a/lib/index.d.ts] Inode:: 158 +//// [/home/src/projects/a/1/a-impl/a/lib/index.d.ts] Inode:: 159 export * from './a'; export * from 'c'; -//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo] Inode:: 159 +//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo] Inode:: 160 {"root":["../src/a.ts","../src/index.ts"],"version":"FakeTSVersion"} -//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 160 +//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 161 { "root": [ "../src/a.ts", @@ -469,7 +469,7 @@ FsWatches:: /home/src/projects/a/1/a-impl/a: {"inode":19} /home/src/projects/a/1/a-impl/a/lib: *new* - {"inode":154} + {"inode":155} /home/src/projects/a/1/a-impl/a/node_modules: {"inode":25} /home/src/projects/a/1/a-impl/a/package.json: @@ -625,7 +625,7 @@ src/index.ts -//// [/home/src/projects/b/2/b-impl/b/lib/index.js] file written with same contents Inode:: 144 +//// [/home/src/projects/b/2/b-impl/b/lib/index.js] file written with same contents Inode:: 145 PolledWatches:: /home/src/projects/a/1/a-impl/a/lib/node_modules: *new* @@ -655,11 +655,11 @@ FsWatches:: /home/src/projects: {"inode":3} /home/src/projects/a/1/a-impl/a/lib: - {"inode":154} + {"inode":155} /home/src/projects/a/1/a-impl/a/lib/a.d.ts: *new* - {"inode":156} + {"inode":157} /home/src/projects/a/1/a-impl/a/lib/index.d.ts: *new* - {"inode":158} + {"inode":159} /home/src/projects/a/1/a-impl/a/node_modules: {"inode":25} /home/src/projects/a/1/a-impl/a/package.json: @@ -681,11 +681,11 @@ FsWatches:: /home/src/projects/b/2/b-impl/b/tsconfig.json: {"inode":36} /home/src/projects/c/3/c-impl/c/lib: *new* - {"inode":147} + {"inode":148} /home/src/projects/c/3/c-impl/c/lib/c.d.ts: *new* - {"inode":149} + {"inode":150} /home/src/projects/c/3/c-impl/c/lib/index.d.ts: *new* - {"inode":151} + {"inode":152} /home/src/projects/c/3/c-impl/c/package.json: *new* {"inode":12} /home/src/tslibs/TS/Lib/lib.d.ts: @@ -740,7 +740,7 @@ exitCode:: ExitStatus.undefined Change:: change in unrelated folder in a Input:: -//// [/home/src/projects/a/2/unrelated/anotherFile.ts] Inode:: 161 +//// [/home/src/projects/a/2/unrelated/anotherFile.ts] Inode:: 162 export const a = 10; @@ -758,7 +758,7 @@ exitCode:: ExitStatus.undefined Change:: change in unrelated folder in c Input:: -//// [/home/src/projects/c/4/unrelated/anotherFile.ts] Inode:: 162 +//// [/home/src/projects/c/4/unrelated/anotherFile.ts] Inode:: 163 export const a = 10; @@ -908,17 +908,17 @@ FsWatches:: FsWatches *deleted*:: /home/src/projects/a/1/a-impl/a/lib: - {"inode":154} + {"inode":155} /home/src/projects/a/1/a-impl/a/lib/a.d.ts: - {"inode":156} + {"inode":157} /home/src/projects/a/1/a-impl/a/lib/index.d.ts: - {"inode":158} + {"inode":159} /home/src/projects/c/3/c-impl/c/lib: - {"inode":147} + {"inode":148} /home/src/projects/c/3/c-impl/c/lib/c.d.ts: - {"inode":149} + {"inode":150} /home/src/projects/c/3/c-impl/c/lib/index.d.ts: - {"inode":151} + {"inode":152} Timeout callback:: count: 2 18: timerToUpdateProgram *new* @@ -1022,7 +1022,7 @@ src/index.ts -//// [/home/src/projects/b/2/b-impl/b/lib/index.js] file written with same contents Inode:: 144 +//// [/home/src/projects/b/2/b-impl/b/lib/index.js] file written with same contents Inode:: 145 PolledWatches:: /home/src/projects/b/2/b-impl/b/node_modules/@types: @@ -1147,18 +1147,18 @@ exitCode:: ExitStatus.undefined Change:: Build dependencies Input:: -//// [/home/src/projects/c/3/c-impl/c/lib/c.js] Inode:: 164 +//// [/home/src/projects/c/3/c-impl/c/lib/c.js] Inode:: 165 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.c = void 0; exports.c = 'test'; -//// [/home/src/projects/c/3/c-impl/c/lib/c.d.ts] Inode:: 165 +//// [/home/src/projects/c/3/c-impl/c/lib/c.d.ts] Inode:: 166 export declare const c: string; -//// [/home/src/projects/c/3/c-impl/c/lib/index.js] Inode:: 166 +//// [/home/src/projects/c/3/c-impl/c/lib/index.js] Inode:: 167 "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; @@ -1178,14 +1178,14 @@ Object.defineProperty(exports, "__esModule", { value: true }); __exportStar(require("./c"), exports); -//// [/home/src/projects/c/3/c-impl/c/lib/index.d.ts] Inode:: 167 +//// [/home/src/projects/c/3/c-impl/c/lib/index.d.ts] Inode:: 168 export * from './c'; -//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo] Inode:: 168 +//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo] Inode:: 169 {"root":["../src/c.ts","../src/index.ts"],"version":"FakeTSVersion"} -//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 169 +//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 170 { "root": [ "../src/c.ts", @@ -1195,18 +1195,18 @@ export * from './c'; "size": 68 } -//// [/home/src/projects/a/1/a-impl/a/lib/a.js] Inode:: 171 +//// [/home/src/projects/a/1/a-impl/a/lib/a.js] Inode:: 172 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.a = void 0; exports.a = 'test'; -//// [/home/src/projects/a/1/a-impl/a/lib/a.d.ts] Inode:: 172 +//// [/home/src/projects/a/1/a-impl/a/lib/a.d.ts] Inode:: 173 export declare const a: string; -//// [/home/src/projects/a/1/a-impl/a/lib/index.js] Inode:: 173 +//// [/home/src/projects/a/1/a-impl/a/lib/index.js] Inode:: 174 "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; @@ -1227,15 +1227,15 @@ __exportStar(require("./a"), exports); __exportStar(require("c"), exports); -//// [/home/src/projects/a/1/a-impl/a/lib/index.d.ts] Inode:: 174 +//// [/home/src/projects/a/1/a-impl/a/lib/index.d.ts] Inode:: 175 export * from './a'; export * from 'c'; -//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo] Inode:: 175 +//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo] Inode:: 176 {"root":["../src/a.ts","../src/index.ts"],"version":"FakeTSVersion"} -//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 176 +//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 177 { "root": [ "../src/a.ts", @@ -1289,7 +1289,7 @@ FsWatches:: /home/src/projects/a/1/a-impl/a: {"inode":19} /home/src/projects/a/1/a-impl/a/lib: *new* - {"inode":170} + {"inode":171} /home/src/projects/a/1/a-impl/a/node_modules: {"inode":25} /home/src/projects/a/1/a-impl/a/package.json: @@ -1443,7 +1443,7 @@ src/index.ts -//// [/home/src/projects/b/2/b-impl/b/lib/index.js] file written with same contents Inode:: 144 +//// [/home/src/projects/b/2/b-impl/b/lib/index.js] file written with same contents Inode:: 145 PolledWatches:: /home/src/projects/a/1/a-impl/a/lib/node_modules: *new* @@ -1473,11 +1473,11 @@ FsWatches:: /home/src/projects: {"inode":3} /home/src/projects/a/1/a-impl/a/lib: - {"inode":170} + {"inode":171} /home/src/projects/a/1/a-impl/a/lib/a.d.ts: *new* - {"inode":172} + {"inode":173} /home/src/projects/a/1/a-impl/a/lib/index.d.ts: *new* - {"inode":174} + {"inode":175} /home/src/projects/a/1/a-impl/a/node_modules: {"inode":25} /home/src/projects/a/1/a-impl/a/package.json: @@ -1499,11 +1499,11 @@ FsWatches:: /home/src/projects/b/2/b-impl/b/tsconfig.json: {"inode":36} /home/src/projects/c/3/c-impl/c/lib: *new* - {"inode":163} + {"inode":164} /home/src/projects/c/3/c-impl/c/lib/c.d.ts: *new* - {"inode":165} + {"inode":166} /home/src/projects/c/3/c-impl/c/lib/index.d.ts: *new* - {"inode":167} + {"inode":168} /home/src/projects/c/3/c-impl/c/package.json: *new* {"inode":12} /home/src/tslibs/TS/Lib/lib.d.ts: diff --git a/tests/baselines/reference/tscWatch/symlinks/packages-outside-project-folder-MacOs.js b/tests/baselines/reference/tscWatch/symlinks/packages-outside-project-folder-MacOs.js index 6deef5d471e4b..7df25cac1d7a8 100644 --- a/tests/baselines/reference/tscWatch/symlinks/packages-outside-project-folder-MacOs.js +++ b/tests/baselines/reference/tscWatch/symlinks/packages-outside-project-folder-MacOs.js @@ -203,7 +203,7 @@ DirectoryWatcher:: Added:: WatchInfo: /home/src/projects/b/2/b-impl/b/src 1 unde Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/projects/b/2/b-impl/b/src 1 undefined Wild card directory -//// [/home/src/projects/b/2/b-impl/b/lib/index.js] Inode:: 144 +//// [/home/src/projects/b/2/b-impl/b/lib/index.js] Inode:: 145 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); @@ -287,7 +287,7 @@ exitCode:: ExitStatus.undefined Change:: change in unrelated folder in a Input:: -//// [/home/src/projects/a/2/unrelated/somethingUnrelated.ts] Inode:: 145 +//// [/home/src/projects/a/2/unrelated/somethingUnrelated.ts] Inode:: 146 export const a = 10; @@ -305,7 +305,7 @@ exitCode:: ExitStatus.undefined Change:: change in unrelated folder in c Input:: -//// [/home/src/projects/c/4/unrelated/somethingUnrelated.ts] Inode:: 146 +//// [/home/src/projects/c/4/unrelated/somethingUnrelated.ts] Inode:: 147 export const a = 10; @@ -323,18 +323,18 @@ exitCode:: ExitStatus.undefined Change:: Build dependencies Input:: -//// [/home/src/projects/c/3/c-impl/c/lib/c.js] Inode:: 148 +//// [/home/src/projects/c/3/c-impl/c/lib/c.js] Inode:: 149 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.c = void 0; exports.c = 'test'; -//// [/home/src/projects/c/3/c-impl/c/lib/c.d.ts] Inode:: 149 +//// [/home/src/projects/c/3/c-impl/c/lib/c.d.ts] Inode:: 150 export declare const c: string; -//// [/home/src/projects/c/3/c-impl/c/lib/index.js] Inode:: 150 +//// [/home/src/projects/c/3/c-impl/c/lib/index.js] Inode:: 151 "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; @@ -354,14 +354,14 @@ Object.defineProperty(exports, "__esModule", { value: true }); __exportStar(require("./c"), exports); -//// [/home/src/projects/c/3/c-impl/c/lib/index.d.ts] Inode:: 151 +//// [/home/src/projects/c/3/c-impl/c/lib/index.d.ts] Inode:: 152 export * from './c'; -//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo] Inode:: 152 +//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo] Inode:: 153 {"root":["../src/c.ts","../src/index.ts"],"version":"FakeTSVersion"} -//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 153 +//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 154 { "root": [ "../src/c.ts", @@ -371,18 +371,18 @@ export * from './c'; "size": 68 } -//// [/home/src/projects/a/1/a-impl/a/lib/a.js] Inode:: 155 +//// [/home/src/projects/a/1/a-impl/a/lib/a.js] Inode:: 156 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.a = void 0; exports.a = 'test'; -//// [/home/src/projects/a/1/a-impl/a/lib/a.d.ts] Inode:: 156 +//// [/home/src/projects/a/1/a-impl/a/lib/a.d.ts] Inode:: 157 export declare const a: string; -//// [/home/src/projects/a/1/a-impl/a/lib/index.js] Inode:: 157 +//// [/home/src/projects/a/1/a-impl/a/lib/index.js] Inode:: 158 "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; @@ -403,15 +403,15 @@ __exportStar(require("./a"), exports); __exportStar(require("c"), exports); -//// [/home/src/projects/a/1/a-impl/a/lib/index.d.ts] Inode:: 158 +//// [/home/src/projects/a/1/a-impl/a/lib/index.d.ts] Inode:: 159 export * from './a'; export * from 'c'; -//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo] Inode:: 159 +//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo] Inode:: 160 {"root":["../src/a.ts","../src/index.ts"],"version":"FakeTSVersion"} -//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 160 +//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 161 { "root": [ "../src/a.ts", @@ -574,7 +574,7 @@ src/index.ts -//// [/home/src/projects/b/2/b-impl/b/lib/index.js] file written with same contents Inode:: 144 +//// [/home/src/projects/b/2/b-impl/b/lib/index.js] file written with same contents Inode:: 145 PolledWatches:: /home/src/projects/a/1/a-impl/a/lib/node_modules: *new* @@ -604,9 +604,9 @@ FsWatches:: /home/src/projects: {"inode":3} /home/src/projects/a/1/a-impl/a/lib/a.d.ts: *new* - {"inode":156} + {"inode":157} /home/src/projects/a/1/a-impl/a/lib/index.d.ts: *new* - {"inode":158} + {"inode":159} /home/src/projects/a/1/a-impl/a/package.json: {"inode":24} /home/src/projects/b: @@ -622,9 +622,9 @@ FsWatches:: /home/src/projects/b/2/b-impl/b/tsconfig.json: {"inode":36} /home/src/projects/c/3/c-impl/c/lib/c.d.ts: *new* - {"inode":149} + {"inode":150} /home/src/projects/c/3/c-impl/c/lib/index.d.ts: *new* - {"inode":151} + {"inode":152} /home/src/projects/c/3/c-impl/c/package.json: *new* {"inode":12} /home/src/tslibs/TS/Lib/lib.d.ts: @@ -691,7 +691,7 @@ exitCode:: ExitStatus.undefined Change:: change in unrelated folder in a Input:: -//// [/home/src/projects/a/2/unrelated/anotherFile.ts] Inode:: 161 +//// [/home/src/projects/a/2/unrelated/anotherFile.ts] Inode:: 162 export const a = 10; @@ -720,7 +720,7 @@ exitCode:: ExitStatus.undefined Change:: change in unrelated folder in c Input:: -//// [/home/src/projects/c/4/unrelated/anotherFile.ts] Inode:: 162 +//// [/home/src/projects/c/4/unrelated/anotherFile.ts] Inode:: 163 export const a = 10; @@ -869,13 +869,13 @@ FsWatches:: FsWatches *deleted*:: /home/src/projects/a/1/a-impl/a/lib/a.d.ts: - {"inode":156} + {"inode":157} /home/src/projects/a/1/a-impl/a/lib/index.d.ts: - {"inode":158} + {"inode":159} /home/src/projects/c/3/c-impl/c/lib/c.d.ts: - {"inode":149} + {"inode":150} /home/src/projects/c/3/c-impl/c/lib/index.d.ts: - {"inode":151} + {"inode":152} FsWatchesRecursive:: /home/src/projects/a: @@ -991,7 +991,7 @@ src/index.ts -//// [/home/src/projects/b/2/b-impl/b/lib/index.js] file written with same contents Inode:: 144 +//// [/home/src/projects/b/2/b-impl/b/lib/index.js] file written with same contents Inode:: 145 PolledWatches:: /home/src/projects/b/2/b-impl/b/node_modules/@types: @@ -1097,18 +1097,18 @@ exitCode:: ExitStatus.undefined Change:: Build dependencies Input:: -//// [/home/src/projects/c/3/c-impl/c/lib/c.js] Inode:: 164 +//// [/home/src/projects/c/3/c-impl/c/lib/c.js] Inode:: 165 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.c = void 0; exports.c = 'test'; -//// [/home/src/projects/c/3/c-impl/c/lib/c.d.ts] Inode:: 165 +//// [/home/src/projects/c/3/c-impl/c/lib/c.d.ts] Inode:: 166 export declare const c: string; -//// [/home/src/projects/c/3/c-impl/c/lib/index.js] Inode:: 166 +//// [/home/src/projects/c/3/c-impl/c/lib/index.js] Inode:: 167 "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; @@ -1128,14 +1128,14 @@ Object.defineProperty(exports, "__esModule", { value: true }); __exportStar(require("./c"), exports); -//// [/home/src/projects/c/3/c-impl/c/lib/index.d.ts] Inode:: 167 +//// [/home/src/projects/c/3/c-impl/c/lib/index.d.ts] Inode:: 168 export * from './c'; -//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo] Inode:: 168 +//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo] Inode:: 169 {"root":["../src/c.ts","../src/index.ts"],"version":"FakeTSVersion"} -//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 169 +//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 170 { "root": [ "../src/c.ts", @@ -1145,18 +1145,18 @@ export * from './c'; "size": 68 } -//// [/home/src/projects/a/1/a-impl/a/lib/a.js] Inode:: 171 +//// [/home/src/projects/a/1/a-impl/a/lib/a.js] Inode:: 172 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.a = void 0; exports.a = 'test'; -//// [/home/src/projects/a/1/a-impl/a/lib/a.d.ts] Inode:: 172 +//// [/home/src/projects/a/1/a-impl/a/lib/a.d.ts] Inode:: 173 export declare const a: string; -//// [/home/src/projects/a/1/a-impl/a/lib/index.js] Inode:: 173 +//// [/home/src/projects/a/1/a-impl/a/lib/index.js] Inode:: 174 "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; @@ -1177,15 +1177,15 @@ __exportStar(require("./a"), exports); __exportStar(require("c"), exports); -//// [/home/src/projects/a/1/a-impl/a/lib/index.d.ts] Inode:: 174 +//// [/home/src/projects/a/1/a-impl/a/lib/index.d.ts] Inode:: 175 export * from './a'; export * from 'c'; -//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo] Inode:: 175 +//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo] Inode:: 176 {"root":["../src/a.ts","../src/index.ts"],"version":"FakeTSVersion"} -//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 176 +//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 177 { "root": [ "../src/a.ts", @@ -1346,7 +1346,7 @@ src/index.ts -//// [/home/src/projects/b/2/b-impl/b/lib/index.js] file written with same contents Inode:: 144 +//// [/home/src/projects/b/2/b-impl/b/lib/index.js] file written with same contents Inode:: 145 PolledWatches:: /home/src/projects/a/1/a-impl/a/lib/node_modules: *new* @@ -1376,9 +1376,9 @@ FsWatches:: /home/src/projects: {"inode":3} /home/src/projects/a/1/a-impl/a/lib/a.d.ts: *new* - {"inode":172} + {"inode":173} /home/src/projects/a/1/a-impl/a/lib/index.d.ts: *new* - {"inode":174} + {"inode":175} /home/src/projects/a/1/a-impl/a/package.json: {"inode":24} /home/src/projects/b: @@ -1394,9 +1394,9 @@ FsWatches:: /home/src/projects/b/2/b-impl/b/tsconfig.json: {"inode":36} /home/src/projects/c/3/c-impl/c/lib/c.d.ts: *new* - {"inode":165} + {"inode":166} /home/src/projects/c/3/c-impl/c/lib/index.d.ts: *new* - {"inode":167} + {"inode":168} /home/src/projects/c/3/c-impl/c/package.json: *new* {"inode":12} /home/src/tslibs/TS/Lib/lib.d.ts: diff --git a/tests/baselines/reference/tscWatch/symlinks/packages-outside-project-folder-built-Linux.js b/tests/baselines/reference/tscWatch/symlinks/packages-outside-project-folder-built-Linux.js index ebe2c84ced5f2..45d715974e609 100644 --- a/tests/baselines/reference/tscWatch/symlinks/packages-outside-project-folder-built-Linux.js +++ b/tests/baselines/reference/tscWatch/symlinks/packages-outside-project-folder-built-Linux.js @@ -87,18 +87,18 @@ interface Array { length: number; [n: number]: T; } interface ReadonlyArray {} declare const console: { log(msg: any): void; }; -//// [/home/src/projects/c/3/c-impl/c/lib/c.js] Inode:: 144 +//// [/home/src/projects/c/3/c-impl/c/lib/c.js] Inode:: 145 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.c = void 0; exports.c = 'test'; -//// [/home/src/projects/c/3/c-impl/c/lib/c.d.ts] Inode:: 145 +//// [/home/src/projects/c/3/c-impl/c/lib/c.d.ts] Inode:: 146 export declare const c: string; -//// [/home/src/projects/c/3/c-impl/c/lib/index.js] Inode:: 146 +//// [/home/src/projects/c/3/c-impl/c/lib/index.js] Inode:: 147 "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; @@ -118,14 +118,14 @@ Object.defineProperty(exports, "__esModule", { value: true }); __exportStar(require("./c"), exports); -//// [/home/src/projects/c/3/c-impl/c/lib/index.d.ts] Inode:: 147 +//// [/home/src/projects/c/3/c-impl/c/lib/index.d.ts] Inode:: 148 export * from './c'; -//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo] Inode:: 148 +//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo] Inode:: 149 {"root":["../src/c.ts","../src/index.ts"],"version":"FakeTSVersion"} -//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 149 +//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 150 { "root": [ "../src/c.ts", @@ -135,18 +135,18 @@ export * from './c'; "size": 68 } -//// [/home/src/projects/a/1/a-impl/a/lib/a.js] Inode:: 151 +//// [/home/src/projects/a/1/a-impl/a/lib/a.js] Inode:: 152 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.a = void 0; exports.a = 'test'; -//// [/home/src/projects/a/1/a-impl/a/lib/a.d.ts] Inode:: 152 +//// [/home/src/projects/a/1/a-impl/a/lib/a.d.ts] Inode:: 153 export declare const a: string; -//// [/home/src/projects/a/1/a-impl/a/lib/index.js] Inode:: 153 +//// [/home/src/projects/a/1/a-impl/a/lib/index.js] Inode:: 154 "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; @@ -167,15 +167,15 @@ __exportStar(require("./a"), exports); __exportStar(require("c"), exports); -//// [/home/src/projects/a/1/a-impl/a/lib/index.d.ts] Inode:: 154 +//// [/home/src/projects/a/1/a-impl/a/lib/index.d.ts] Inode:: 155 export * from './a'; export * from 'c'; -//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo] Inode:: 155 +//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo] Inode:: 156 {"root":["../src/a.ts","../src/index.ts"],"version":"FakeTSVersion"} -//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 156 +//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 157 { "root": [ "../src/a.ts", @@ -317,7 +317,7 @@ DirectoryWatcher:: Added:: WatchInfo: /home/src/projects/b/2/b-impl/b/src 1 unde Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/projects/b/2/b-impl/b/src 1 undefined Wild card directory -//// [/home/src/projects/b/2/b-impl/b/lib/index.js] Inode:: 158 +//// [/home/src/projects/b/2/b-impl/b/lib/index.js] Inode:: 159 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); @@ -341,11 +341,11 @@ FsWatches:: /home/src/projects: *new* {"inode":3} /home/src/projects/a/1/a-impl/a/lib: *new* - {"inode":150} + {"inode":151} /home/src/projects/a/1/a-impl/a/lib/a.d.ts: *new* - {"inode":152} + {"inode":153} /home/src/projects/a/1/a-impl/a/lib/index.d.ts: *new* - {"inode":154} + {"inode":155} /home/src/projects/a/1/a-impl/a/node_modules: *new* {"inode":25} /home/src/projects/a/1/a-impl/a/package.json: *new* @@ -367,11 +367,11 @@ FsWatches:: /home/src/projects/b/2/b-impl/b/tsconfig.json: *new* {"inode":36} /home/src/projects/c/3/c-impl/c/lib: *new* - {"inode":143} + {"inode":144} /home/src/projects/c/3/c-impl/c/lib/c.d.ts: *new* - {"inode":145} + {"inode":146} /home/src/projects/c/3/c-impl/c/lib/index.d.ts: *new* - {"inode":147} + {"inode":148} /home/src/projects/c/3/c-impl/c/package.json: *new* {"inode":12} /home/src/tslibs/TS/Lib/lib.d.ts: *new* @@ -419,7 +419,7 @@ exitCode:: ExitStatus.undefined Change:: change in unrelated folder in a Input:: -//// [/home/src/projects/a/2/unrelated/somethingUnrelated.ts] Inode:: 159 +//// [/home/src/projects/a/2/unrelated/somethingUnrelated.ts] Inode:: 160 export const a = 10; @@ -437,7 +437,7 @@ exitCode:: ExitStatus.undefined Change:: change in unrelated folder in c Input:: -//// [/home/src/projects/c/4/unrelated/somethingUnrelated.ts] Inode:: 160 +//// [/home/src/projects/c/4/unrelated/somethingUnrelated.ts] Inode:: 161 export const a = 10; @@ -455,7 +455,7 @@ exitCode:: ExitStatus.undefined Change:: change in unrelated folder in a Input:: -//// [/home/src/projects/a/2/unrelated/anotherFile.ts] Inode:: 161 +//// [/home/src/projects/a/2/unrelated/anotherFile.ts] Inode:: 162 export const a = 10; @@ -473,7 +473,7 @@ exitCode:: ExitStatus.undefined Change:: change in unrelated folder in c Input:: -//// [/home/src/projects/c/4/unrelated/anotherFile.ts] Inode:: 162 +//// [/home/src/projects/c/4/unrelated/anotherFile.ts] Inode:: 163 export const a = 10; @@ -623,17 +623,17 @@ FsWatches:: FsWatches *deleted*:: /home/src/projects/a/1/a-impl/a/lib: - {"inode":150} + {"inode":151} /home/src/projects/a/1/a-impl/a/lib/a.d.ts: - {"inode":152} + {"inode":153} /home/src/projects/a/1/a-impl/a/lib/index.d.ts: - {"inode":154} + {"inode":155} /home/src/projects/c/3/c-impl/c/lib: - {"inode":143} + {"inode":144} /home/src/projects/c/3/c-impl/c/lib/c.d.ts: - {"inode":145} + {"inode":146} /home/src/projects/c/3/c-impl/c/lib/index.d.ts: - {"inode":147} + {"inode":148} Timeout callback:: count: 2 13: timerToUpdateProgram *new* @@ -737,7 +737,7 @@ src/index.ts -//// [/home/src/projects/b/2/b-impl/b/lib/index.js] file written with same contents Inode:: 158 +//// [/home/src/projects/b/2/b-impl/b/lib/index.js] file written with same contents Inode:: 159 PolledWatches:: /home/src/projects/b/2/b-impl/b/node_modules/@types: @@ -862,18 +862,18 @@ exitCode:: ExitStatus.undefined Change:: Build dependencies Input:: -//// [/home/src/projects/c/3/c-impl/c/lib/c.js] Inode:: 164 +//// [/home/src/projects/c/3/c-impl/c/lib/c.js] Inode:: 165 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.c = void 0; exports.c = 'test'; -//// [/home/src/projects/c/3/c-impl/c/lib/c.d.ts] Inode:: 165 +//// [/home/src/projects/c/3/c-impl/c/lib/c.d.ts] Inode:: 166 export declare const c: string; -//// [/home/src/projects/c/3/c-impl/c/lib/index.js] Inode:: 166 +//// [/home/src/projects/c/3/c-impl/c/lib/index.js] Inode:: 167 "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; @@ -893,14 +893,14 @@ Object.defineProperty(exports, "__esModule", { value: true }); __exportStar(require("./c"), exports); -//// [/home/src/projects/c/3/c-impl/c/lib/index.d.ts] Inode:: 167 +//// [/home/src/projects/c/3/c-impl/c/lib/index.d.ts] Inode:: 168 export * from './c'; -//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo] Inode:: 168 +//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo] Inode:: 169 {"root":["../src/c.ts","../src/index.ts"],"version":"FakeTSVersion"} -//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 169 +//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 170 { "root": [ "../src/c.ts", @@ -910,18 +910,18 @@ export * from './c'; "size": 68 } -//// [/home/src/projects/a/1/a-impl/a/lib/a.js] Inode:: 171 +//// [/home/src/projects/a/1/a-impl/a/lib/a.js] Inode:: 172 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.a = void 0; exports.a = 'test'; -//// [/home/src/projects/a/1/a-impl/a/lib/a.d.ts] Inode:: 172 +//// [/home/src/projects/a/1/a-impl/a/lib/a.d.ts] Inode:: 173 export declare const a: string; -//// [/home/src/projects/a/1/a-impl/a/lib/index.js] Inode:: 173 +//// [/home/src/projects/a/1/a-impl/a/lib/index.js] Inode:: 174 "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; @@ -942,15 +942,15 @@ __exportStar(require("./a"), exports); __exportStar(require("c"), exports); -//// [/home/src/projects/a/1/a-impl/a/lib/index.d.ts] Inode:: 174 +//// [/home/src/projects/a/1/a-impl/a/lib/index.d.ts] Inode:: 175 export * from './a'; export * from 'c'; -//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo] Inode:: 175 +//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo] Inode:: 176 {"root":["../src/a.ts","../src/index.ts"],"version":"FakeTSVersion"} -//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 176 +//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 177 { "root": [ "../src/a.ts", @@ -1004,7 +1004,7 @@ FsWatches:: /home/src/projects/a/1/a-impl/a: {"inode":19} /home/src/projects/a/1/a-impl/a/lib: *new* - {"inode":170} + {"inode":171} /home/src/projects/a/1/a-impl/a/node_modules: {"inode":25} /home/src/projects/a/1/a-impl/a/package.json: @@ -1158,7 +1158,7 @@ src/index.ts -//// [/home/src/projects/b/2/b-impl/b/lib/index.js] file written with same contents Inode:: 158 +//// [/home/src/projects/b/2/b-impl/b/lib/index.js] file written with same contents Inode:: 159 PolledWatches:: /home/src/projects/a/1/a-impl/a/lib/node_modules: *new* @@ -1188,11 +1188,11 @@ FsWatches:: /home/src/projects: {"inode":3} /home/src/projects/a/1/a-impl/a/lib: - {"inode":170} + {"inode":171} /home/src/projects/a/1/a-impl/a/lib/a.d.ts: *new* - {"inode":172} + {"inode":173} /home/src/projects/a/1/a-impl/a/lib/index.d.ts: *new* - {"inode":174} + {"inode":175} /home/src/projects/a/1/a-impl/a/node_modules: {"inode":25} /home/src/projects/a/1/a-impl/a/package.json: @@ -1214,11 +1214,11 @@ FsWatches:: /home/src/projects/b/2/b-impl/b/tsconfig.json: {"inode":36} /home/src/projects/c/3/c-impl/c/lib: *new* - {"inode":163} + {"inode":164} /home/src/projects/c/3/c-impl/c/lib/c.d.ts: *new* - {"inode":165} + {"inode":166} /home/src/projects/c/3/c-impl/c/lib/index.d.ts: *new* - {"inode":167} + {"inode":168} /home/src/projects/c/3/c-impl/c/package.json: *new* {"inode":12} /home/src/tslibs/TS/Lib/lib.d.ts: diff --git a/tests/baselines/reference/tscWatch/symlinks/packages-outside-project-folder-built-MacOs.js b/tests/baselines/reference/tscWatch/symlinks/packages-outside-project-folder-built-MacOs.js index b471f04a17c72..dbb5c3bf8cab3 100644 --- a/tests/baselines/reference/tscWatch/symlinks/packages-outside-project-folder-built-MacOs.js +++ b/tests/baselines/reference/tscWatch/symlinks/packages-outside-project-folder-built-MacOs.js @@ -87,18 +87,18 @@ interface Array { length: number; [n: number]: T; } interface ReadonlyArray {} declare const console: { log(msg: any): void; }; -//// [/home/src/projects/c/3/c-impl/c/lib/c.js] Inode:: 144 +//// [/home/src/projects/c/3/c-impl/c/lib/c.js] Inode:: 145 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.c = void 0; exports.c = 'test'; -//// [/home/src/projects/c/3/c-impl/c/lib/c.d.ts] Inode:: 145 +//// [/home/src/projects/c/3/c-impl/c/lib/c.d.ts] Inode:: 146 export declare const c: string; -//// [/home/src/projects/c/3/c-impl/c/lib/index.js] Inode:: 146 +//// [/home/src/projects/c/3/c-impl/c/lib/index.js] Inode:: 147 "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; @@ -118,14 +118,14 @@ Object.defineProperty(exports, "__esModule", { value: true }); __exportStar(require("./c"), exports); -//// [/home/src/projects/c/3/c-impl/c/lib/index.d.ts] Inode:: 147 +//// [/home/src/projects/c/3/c-impl/c/lib/index.d.ts] Inode:: 148 export * from './c'; -//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo] Inode:: 148 +//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo] Inode:: 149 {"root":["../src/c.ts","../src/index.ts"],"version":"FakeTSVersion"} -//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 149 +//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 150 { "root": [ "../src/c.ts", @@ -135,18 +135,18 @@ export * from './c'; "size": 68 } -//// [/home/src/projects/a/1/a-impl/a/lib/a.js] Inode:: 151 +//// [/home/src/projects/a/1/a-impl/a/lib/a.js] Inode:: 152 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.a = void 0; exports.a = 'test'; -//// [/home/src/projects/a/1/a-impl/a/lib/a.d.ts] Inode:: 152 +//// [/home/src/projects/a/1/a-impl/a/lib/a.d.ts] Inode:: 153 export declare const a: string; -//// [/home/src/projects/a/1/a-impl/a/lib/index.js] Inode:: 153 +//// [/home/src/projects/a/1/a-impl/a/lib/index.js] Inode:: 154 "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; @@ -167,15 +167,15 @@ __exportStar(require("./a"), exports); __exportStar(require("c"), exports); -//// [/home/src/projects/a/1/a-impl/a/lib/index.d.ts] Inode:: 154 +//// [/home/src/projects/a/1/a-impl/a/lib/index.d.ts] Inode:: 155 export * from './a'; export * from 'c'; -//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo] Inode:: 155 +//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo] Inode:: 156 {"root":["../src/a.ts","../src/index.ts"],"version":"FakeTSVersion"} -//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 156 +//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 157 { "root": [ "../src/a.ts", @@ -317,7 +317,7 @@ DirectoryWatcher:: Added:: WatchInfo: /home/src/projects/b/2/b-impl/b/src 1 unde Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/projects/b/2/b-impl/b/src 1 undefined Wild card directory -//// [/home/src/projects/b/2/b-impl/b/lib/index.js] Inode:: 158 +//// [/home/src/projects/b/2/b-impl/b/lib/index.js] Inode:: 159 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); @@ -341,9 +341,9 @@ FsWatches:: /home/src/projects: *new* {"inode":3} /home/src/projects/a/1/a-impl/a/lib/a.d.ts: *new* - {"inode":152} + {"inode":153} /home/src/projects/a/1/a-impl/a/lib/index.d.ts: *new* - {"inode":154} + {"inode":155} /home/src/projects/a/1/a-impl/a/package.json: *new* {"inode":24} /home/src/projects/b: *new* @@ -359,9 +359,9 @@ FsWatches:: /home/src/projects/b/2/b-impl/b/tsconfig.json: *new* {"inode":36} /home/src/projects/c/3/c-impl/c/lib/c.d.ts: *new* - {"inode":145} + {"inode":146} /home/src/projects/c/3/c-impl/c/lib/index.d.ts: *new* - {"inode":147} + {"inode":148} /home/src/projects/c/3/c-impl/c/package.json: *new* {"inode":12} /home/src/tslibs/TS/Lib/lib.d.ts: *new* @@ -421,7 +421,7 @@ exitCode:: ExitStatus.undefined Change:: change in unrelated folder in a Input:: -//// [/home/src/projects/a/2/unrelated/somethingUnrelated.ts] Inode:: 159 +//// [/home/src/projects/a/2/unrelated/somethingUnrelated.ts] Inode:: 160 export const a = 10; @@ -450,7 +450,7 @@ exitCode:: ExitStatus.undefined Change:: change in unrelated folder in c Input:: -//// [/home/src/projects/c/4/unrelated/somethingUnrelated.ts] Inode:: 160 +//// [/home/src/projects/c/4/unrelated/somethingUnrelated.ts] Inode:: 161 export const a = 10; @@ -479,7 +479,7 @@ exitCode:: ExitStatus.undefined Change:: change in unrelated folder in a Input:: -//// [/home/src/projects/a/2/unrelated/anotherFile.ts] Inode:: 161 +//// [/home/src/projects/a/2/unrelated/anotherFile.ts] Inode:: 162 export const a = 10; @@ -508,7 +508,7 @@ exitCode:: ExitStatus.undefined Change:: change in unrelated folder in c Input:: -//// [/home/src/projects/c/4/unrelated/anotherFile.ts] Inode:: 162 +//// [/home/src/projects/c/4/unrelated/anotherFile.ts] Inode:: 163 export const a = 10; @@ -657,13 +657,13 @@ FsWatches:: FsWatches *deleted*:: /home/src/projects/a/1/a-impl/a/lib/a.d.ts: - {"inode":152} + {"inode":153} /home/src/projects/a/1/a-impl/a/lib/index.d.ts: - {"inode":154} + {"inode":155} /home/src/projects/c/3/c-impl/c/lib/c.d.ts: - {"inode":145} + {"inode":146} /home/src/projects/c/3/c-impl/c/lib/index.d.ts: - {"inode":147} + {"inode":148} FsWatchesRecursive:: /home/src/projects/a: @@ -779,7 +779,7 @@ src/index.ts -//// [/home/src/projects/b/2/b-impl/b/lib/index.js] file written with same contents Inode:: 158 +//// [/home/src/projects/b/2/b-impl/b/lib/index.js] file written with same contents Inode:: 159 PolledWatches:: /home/src/projects/b/2/b-impl/b/node_modules/@types: @@ -885,18 +885,18 @@ exitCode:: ExitStatus.undefined Change:: Build dependencies Input:: -//// [/home/src/projects/c/3/c-impl/c/lib/c.js] Inode:: 164 +//// [/home/src/projects/c/3/c-impl/c/lib/c.js] Inode:: 165 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.c = void 0; exports.c = 'test'; -//// [/home/src/projects/c/3/c-impl/c/lib/c.d.ts] Inode:: 165 +//// [/home/src/projects/c/3/c-impl/c/lib/c.d.ts] Inode:: 166 export declare const c: string; -//// [/home/src/projects/c/3/c-impl/c/lib/index.js] Inode:: 166 +//// [/home/src/projects/c/3/c-impl/c/lib/index.js] Inode:: 167 "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; @@ -916,14 +916,14 @@ Object.defineProperty(exports, "__esModule", { value: true }); __exportStar(require("./c"), exports); -//// [/home/src/projects/c/3/c-impl/c/lib/index.d.ts] Inode:: 167 +//// [/home/src/projects/c/3/c-impl/c/lib/index.d.ts] Inode:: 168 export * from './c'; -//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo] Inode:: 168 +//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo] Inode:: 169 {"root":["../src/c.ts","../src/index.ts"],"version":"FakeTSVersion"} -//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 169 +//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 170 { "root": [ "../src/c.ts", @@ -933,18 +933,18 @@ export * from './c'; "size": 68 } -//// [/home/src/projects/a/1/a-impl/a/lib/a.js] Inode:: 171 +//// [/home/src/projects/a/1/a-impl/a/lib/a.js] Inode:: 172 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.a = void 0; exports.a = 'test'; -//// [/home/src/projects/a/1/a-impl/a/lib/a.d.ts] Inode:: 172 +//// [/home/src/projects/a/1/a-impl/a/lib/a.d.ts] Inode:: 173 export declare const a: string; -//// [/home/src/projects/a/1/a-impl/a/lib/index.js] Inode:: 173 +//// [/home/src/projects/a/1/a-impl/a/lib/index.js] Inode:: 174 "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; @@ -965,15 +965,15 @@ __exportStar(require("./a"), exports); __exportStar(require("c"), exports); -//// [/home/src/projects/a/1/a-impl/a/lib/index.d.ts] Inode:: 174 +//// [/home/src/projects/a/1/a-impl/a/lib/index.d.ts] Inode:: 175 export * from './a'; export * from 'c'; -//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo] Inode:: 175 +//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo] Inode:: 176 {"root":["../src/a.ts","../src/index.ts"],"version":"FakeTSVersion"} -//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 176 +//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 177 { "root": [ "../src/a.ts", @@ -1134,7 +1134,7 @@ src/index.ts -//// [/home/src/projects/b/2/b-impl/b/lib/index.js] file written with same contents Inode:: 158 +//// [/home/src/projects/b/2/b-impl/b/lib/index.js] file written with same contents Inode:: 159 PolledWatches:: /home/src/projects/a/1/a-impl/a/lib/node_modules: *new* @@ -1164,9 +1164,9 @@ FsWatches:: /home/src/projects: {"inode":3} /home/src/projects/a/1/a-impl/a/lib/a.d.ts: *new* - {"inode":172} + {"inode":173} /home/src/projects/a/1/a-impl/a/lib/index.d.ts: *new* - {"inode":174} + {"inode":175} /home/src/projects/a/1/a-impl/a/package.json: {"inode":24} /home/src/projects/b: @@ -1182,9 +1182,9 @@ FsWatches:: /home/src/projects/b/2/b-impl/b/tsconfig.json: {"inode":36} /home/src/projects/c/3/c-impl/c/lib/c.d.ts: *new* - {"inode":165} + {"inode":166} /home/src/projects/c/3/c-impl/c/lib/index.d.ts: *new* - {"inode":167} + {"inode":168} /home/src/projects/c/3/c-impl/c/package.json: *new* {"inode":12} /home/src/tslibs/TS/Lib/lib.d.ts: diff --git a/tests/baselines/reference/tscWatch/watchEnvironment/fsWatch/fsWatchWithTimestamp-true-useFsEventsOnParentDirectory.js b/tests/baselines/reference/tscWatch/watchEnvironment/fsWatch/fsWatchWithTimestamp-true-useFsEventsOnParentDirectory.js index 142589037bb49..c97926c12a2bd 100644 --- a/tests/baselines/reference/tscWatch/watchEnvironment/fsWatch/fsWatchWithTimestamp-true-useFsEventsOnParentDirectory.js +++ b/tests/baselines/reference/tscWatch/watchEnvironment/fsWatch/fsWatchWithTimestamp-true-useFsEventsOnParentDirectory.js @@ -45,7 +45,7 @@ Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/node -//// [/user/username/projects/myproject/main.js] Inode:: 113 +//// [/user/username/projects/myproject/main.js] Inode:: 114 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.x = void 0; @@ -131,7 +131,7 @@ CreatingProgramWith:: -//// [/user/username/projects/myproject/main.js] Inode:: 113 +//// [/user/username/projects/myproject/main.js] Inode:: 114 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.y = exports.x = void 0; diff --git a/tests/baselines/reference/tscWatch/watchEnvironment/fsWatch/fsWatchWithTimestamp-true.js b/tests/baselines/reference/tscWatch/watchEnvironment/fsWatch/fsWatchWithTimestamp-true.js index 8b662c6214ec0..708ae17fe6b64 100644 --- a/tests/baselines/reference/tscWatch/watchEnvironment/fsWatch/fsWatchWithTimestamp-true.js +++ b/tests/baselines/reference/tscWatch/watchEnvironment/fsWatch/fsWatchWithTimestamp-true.js @@ -45,7 +45,7 @@ Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/node -//// [/user/username/projects/myproject/main.js] Inode:: 113 +//// [/user/username/projects/myproject/main.js] Inode:: 114 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.x = void 0; @@ -133,7 +133,7 @@ CreatingProgramWith:: -//// [/user/username/projects/myproject/main.js] Inode:: 113 +//// [/user/username/projects/myproject/main.js] Inode:: 114 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.y = exports.x = void 0; diff --git a/tests/baselines/reference/tscWatch/watchEnvironment/fsWatch/when-using-file-watching-thats-on-inode-when-rename-event-ends-with-tilde.js b/tests/baselines/reference/tscWatch/watchEnvironment/fsWatch/when-using-file-watching-thats-on-inode-when-rename-event-ends-with-tilde.js index 7bf2808276f81..1a0065607d1af 100644 --- a/tests/baselines/reference/tscWatch/watchEnvironment/fsWatch/when-using-file-watching-thats-on-inode-when-rename-event-ends-with-tilde.js +++ b/tests/baselines/reference/tscWatch/watchEnvironment/fsWatch/when-using-file-watching-thats-on-inode-when-rename-event-ends-with-tilde.js @@ -57,7 +57,7 @@ Elapsed:: *ms DirectoryWatcher:: Triggered with /user/username/projects/myprojec -//// [/user/username/projects/myproject/main.js] Inode:: 114 +//// [/user/username/projects/myproject/main.js] Inode:: 115 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var foo_1 = require("./foo"); @@ -113,7 +113,7 @@ exitCode:: ExitStatus.undefined Change:: Replace file with rename event that introduces error Input:: -//// [/user/username/projects/myproject/foo.d.ts] Inode:: 115 +//// [/user/username/projects/myproject/foo.d.ts] Inode:: 116 export function foo2(): string; @@ -162,7 +162,7 @@ FsWatches:: /user/username/projects/myproject: {"inode":4} /user/username/projects/myproject/foo.d.ts: - {"inode":115} *new* + {"inode":116} *new* /user/username/projects/myproject/main.ts: {"inode":5} /user/username/projects/myproject/tsconfig.json: @@ -203,7 +203,7 @@ CreatingProgramWith:: -//// [/user/username/projects/myproject/main.js] file written with same contents Inode:: 114 +//// [/user/username/projects/myproject/main.js] file written with same contents Inode:: 115 Timeout callback:: count: 0 9: timerToInvalidateFailedLookupResolutions *deleted* @@ -237,7 +237,7 @@ exitCode:: ExitStatus.undefined Change:: Replace file with rename event that fixes error Input:: -//// [/user/username/projects/myproject/foo.d.ts] Inode:: 116 +//// [/user/username/projects/myproject/foo.d.ts] Inode:: 117 export function foo(): string; @@ -286,7 +286,7 @@ FsWatches:: /user/username/projects/myproject: {"inode":4} /user/username/projects/myproject/foo.d.ts: - {"inode":116} *new* + {"inode":117} *new* /user/username/projects/myproject/main.ts: {"inode":5} /user/username/projects/myproject/tsconfig.json: @@ -294,7 +294,7 @@ FsWatches:: FsWatches *deleted*:: /user/username/projects/myproject/foo.d.ts: - {"inode":115} + {"inode":116} Timeout callback:: count: 2 16: timerToUpdateProgram *new* @@ -317,7 +317,7 @@ CreatingProgramWith:: -//// [/user/username/projects/myproject/main.js] file written with same contents Inode:: 114 +//// [/user/username/projects/myproject/main.js] file written with same contents Inode:: 115 Timeout callback:: count: 0 18: timerToInvalidateFailedLookupResolutions *deleted* diff --git a/tests/baselines/reference/tscWatch/watchEnvironment/fsWatch/when-using-file-watching-thats-on-inode-when-rename-occurs-when-file-is-still-on-the-disk.js b/tests/baselines/reference/tscWatch/watchEnvironment/fsWatch/when-using-file-watching-thats-on-inode-when-rename-occurs-when-file-is-still-on-the-disk.js index b9cea974a56f4..95668866db5d2 100644 --- a/tests/baselines/reference/tscWatch/watchEnvironment/fsWatch/when-using-file-watching-thats-on-inode-when-rename-occurs-when-file-is-still-on-the-disk.js +++ b/tests/baselines/reference/tscWatch/watchEnvironment/fsWatch/when-using-file-watching-thats-on-inode-when-rename-occurs-when-file-is-still-on-the-disk.js @@ -53,12 +53,12 @@ Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/node -//// [/user/username/projects/myproject/foo.js] Inode:: 114 +//// [/user/username/projects/myproject/foo.js] Inode:: 115 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -//// [/user/username/projects/myproject/main.js] Inode:: 115 +//// [/user/username/projects/myproject/main.js] Inode:: 116 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var foo_1 = require("./foo"); @@ -112,7 +112,7 @@ exitCode:: ExitStatus.undefined Change:: Introduce error such that when callback happens file is already appeared Input:: -//// [/user/username/projects/myproject/foo.ts] Inode:: 116 +//// [/user/username/projects/myproject/foo.ts] Inode:: 117 export declare function foo2(): string; @@ -172,8 +172,8 @@ CreatingProgramWith:: -//// [/user/username/projects/myproject/foo.js] file written with same contents Inode:: 114 -//// [/user/username/projects/myproject/main.js] file written with same contents Inode:: 115 +//// [/user/username/projects/myproject/foo.js] file written with same contents Inode:: 115 +//// [/user/username/projects/myproject/main.js] file written with same contents Inode:: 116 Program root files: [ @@ -204,7 +204,7 @@ exitCode:: ExitStatus.undefined Change:: Replace file with rename event that fixes error Input:: -//// [/user/username/projects/myproject/foo.ts] Inode:: 117 +//// [/user/username/projects/myproject/foo.ts] Inode:: 118 export declare function foo(): string; @@ -233,7 +233,7 @@ FsWatches:: /home/src/tslibs/TS/Lib/lib.d.ts: {"inode":13} /user/username/projects/myproject/foo.ts: - {"inode":117} *new* + {"inode":118} *new* /user/username/projects/myproject/main.ts: {"inode":5} /user/username/projects/myproject/tsconfig.json: @@ -262,8 +262,8 @@ CreatingProgramWith:: -//// [/user/username/projects/myproject/foo.js] file written with same contents Inode:: 114 -//// [/user/username/projects/myproject/main.js] file written with same contents Inode:: 115 +//// [/user/username/projects/myproject/foo.js] file written with same contents Inode:: 115 +//// [/user/username/projects/myproject/main.js] file written with same contents Inode:: 116 Program root files: [ diff --git a/tests/baselines/reference/tscWatch/watchEnvironment/fsWatch/when-using-file-watching-thats-on-inode.js b/tests/baselines/reference/tscWatch/watchEnvironment/fsWatch/when-using-file-watching-thats-on-inode.js index d6e0456dddd54..53ef95b9bf469 100644 --- a/tests/baselines/reference/tscWatch/watchEnvironment/fsWatch/when-using-file-watching-thats-on-inode.js +++ b/tests/baselines/reference/tscWatch/watchEnvironment/fsWatch/when-using-file-watching-thats-on-inode.js @@ -57,7 +57,7 @@ Elapsed:: *ms DirectoryWatcher:: Triggered with /user/username/projects/myprojec -//// [/user/username/projects/myproject/main.js] Inode:: 114 +//// [/user/username/projects/myproject/main.js] Inode:: 115 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var foo_1 = require("./foo"); @@ -113,7 +113,7 @@ exitCode:: ExitStatus.undefined Change:: Replace file with rename event that introduces error Input:: -//// [/user/username/projects/myproject/foo.d.ts] Inode:: 115 +//// [/user/username/projects/myproject/foo.d.ts] Inode:: 116 export function foo2(): string; @@ -150,7 +150,7 @@ FsWatches:: /user/username/projects/myproject: {"inode":4} /user/username/projects/myproject/foo.d.ts: - {"inode":115} *new* + {"inode":116} *new* /user/username/projects/myproject/main.ts: {"inode":5} /user/username/projects/myproject/tsconfig.json: @@ -191,7 +191,7 @@ CreatingProgramWith:: -//// [/user/username/projects/myproject/main.js] file written with same contents Inode:: 114 +//// [/user/username/projects/myproject/main.js] file written with same contents Inode:: 115 Timeout callback:: count: 0 5: timerToInvalidateFailedLookupResolutions *deleted* @@ -225,7 +225,7 @@ exitCode:: ExitStatus.undefined Change:: Replace file with rename event that fixes error Input:: -//// [/user/username/projects/myproject/foo.d.ts] Inode:: 116 +//// [/user/username/projects/myproject/foo.d.ts] Inode:: 117 export function foo(): string; @@ -262,7 +262,7 @@ FsWatches:: /user/username/projects/myproject: {"inode":4} /user/username/projects/myproject/foo.d.ts: - {"inode":116} *new* + {"inode":117} *new* /user/username/projects/myproject/main.ts: {"inode":5} /user/username/projects/myproject/tsconfig.json: @@ -270,7 +270,7 @@ FsWatches:: FsWatches *deleted*:: /user/username/projects/myproject/foo.d.ts: - {"inode":115} + {"inode":116} Timeout callback:: count: 2 9: timerToUpdateProgram *new* @@ -293,7 +293,7 @@ CreatingProgramWith:: -//// [/user/username/projects/myproject/main.js] file written with same contents Inode:: 114 +//// [/user/username/projects/myproject/main.js] file written with same contents Inode:: 115 Timeout callback:: count: 0 10: timerToInvalidateFailedLookupResolutions *deleted* diff --git a/tests/baselines/reference/tscWatch/watchEnvironment/watchDirectories/uses-non-recursive-dynamic-polling-when-renaming-file-in-subfolder.js b/tests/baselines/reference/tscWatch/watchEnvironment/watchDirectories/uses-non-recursive-dynamic-polling-when-renaming-file-in-subfolder.js index e2e364f0c0f54..05cd4145c7856 100644 --- a/tests/baselines/reference/tscWatch/watchEnvironment/watchDirectories/uses-non-recursive-dynamic-polling-when-renaming-file-in-subfolder.js +++ b/tests/baselines/reference/tscWatch/watchEnvironment/watchDirectories/uses-non-recursive-dynamic-polling-when-renaming-file-in-subfolder.js @@ -34,7 +34,7 @@ Output:: -//// [/a/username/projects/project/src/file1.js] Inode:: 114 +//// [/a/username/projects/project/src/file1.js] Inode:: 115 @@ -74,7 +74,7 @@ exitCode:: ExitStatus.undefined Change:: Rename file1 to file2 Input:: -//// [/a/username/projects/project/src/file2.ts] Inode:: 115 +//// [/a/username/projects/project/src/file2.ts] Inode:: 116 //// [/a/username/projects/project/src/file1.ts] deleted @@ -128,7 +128,7 @@ Output:: -//// [/a/username/projects/project/src/file2.js] Inode:: 116 +//// [/a/username/projects/project/src/file2.js] Inode:: 117 @@ -138,7 +138,7 @@ PolledWatches *deleted*:: FsWatches:: /a/username/projects/project/src/file2.ts: *new* - {"inode":115} + {"inode":116} /a/username/projects/project/tsconfig.json: {"inode":7} /home/src/tslibs/TS/Lib/lib.d.ts: diff --git a/tests/baselines/reference/tscWatch/watchEnvironment/watchDirectories/uses-non-recursive-watchDirectory-when-renaming-file-in-subfolder.js b/tests/baselines/reference/tscWatch/watchEnvironment/watchDirectories/uses-non-recursive-watchDirectory-when-renaming-file-in-subfolder.js index 9ee5326f30217..84bb2e109d82b 100644 --- a/tests/baselines/reference/tscWatch/watchEnvironment/watchDirectories/uses-non-recursive-watchDirectory-when-renaming-file-in-subfolder.js +++ b/tests/baselines/reference/tscWatch/watchEnvironment/watchDirectories/uses-non-recursive-watchDirectory-when-renaming-file-in-subfolder.js @@ -34,7 +34,7 @@ Output:: -//// [/a/username/projects/project/src/file1.js] Inode:: 114 +//// [/a/username/projects/project/src/file1.js] Inode:: 115 @@ -81,7 +81,7 @@ exitCode:: ExitStatus.undefined Change:: Rename file1 to file2 Input:: -//// [/a/username/projects/project/src/file2.ts] Inode:: 115 +//// [/a/username/projects/project/src/file2.ts] Inode:: 116 //// [/a/username/projects/project/src/file1.ts] deleted @@ -128,7 +128,7 @@ Output:: -//// [/a/username/projects/project/src/file2.js] Inode:: 116 +//// [/a/username/projects/project/src/file2.js] Inode:: 117 @@ -148,7 +148,7 @@ FsWatches:: /a/username/projects/project/src: {"inode":5} /a/username/projects/project/src/file2.ts: *new* - {"inode":115} + {"inode":116} /a/username/projects/project/tsconfig.json: {"inode":7} /home/src/tslibs/TS/Lib/lib.d.ts: diff --git a/tests/baselines/reference/tscWatch/watchEnvironment/watchDirectories/uses-watchFile-when-renaming-file-in-subfolder.js b/tests/baselines/reference/tscWatch/watchEnvironment/watchDirectories/uses-watchFile-when-renaming-file-in-subfolder.js index c3d70bc3a9d07..530acb147ec77 100644 --- a/tests/baselines/reference/tscWatch/watchEnvironment/watchDirectories/uses-watchFile-when-renaming-file-in-subfolder.js +++ b/tests/baselines/reference/tscWatch/watchEnvironment/watchDirectories/uses-watchFile-when-renaming-file-in-subfolder.js @@ -34,7 +34,7 @@ Output:: -//// [/a/username/projects/project/src/file1.js] Inode:: 114 +//// [/a/username/projects/project/src/file1.js] Inode:: 115 @@ -81,7 +81,7 @@ exitCode:: ExitStatus.undefined Change:: Rename file1 to file2 Input:: -//// [/a/username/projects/project/src/file2.ts] Inode:: 115 +//// [/a/username/projects/project/src/file2.ts] Inode:: 116 //// [/a/username/projects/project/src/file1.ts] deleted @@ -128,7 +128,7 @@ Output:: -//// [/a/username/projects/project/src/file2.js] Inode:: 116 +//// [/a/username/projects/project/src/file2.js] Inode:: 117 @@ -148,7 +148,7 @@ PolledWatches *deleted*:: FsWatches:: /a/username/projects/project/src/file2.ts: *new* - {"inode":115} + {"inode":116} /a/username/projects/project/tsconfig.json: {"inode":7} /home/src/tslibs/TS/Lib/lib.d.ts: diff --git a/tests/baselines/reference/tscWatch/watchEnvironment/watchDirectories/when-there-are-symlinks-to-folders-in-recursive-folders-with-synchronousWatchDirectory.js b/tests/baselines/reference/tscWatch/watchEnvironment/watchDirectories/when-there-are-symlinks-to-folders-in-recursive-folders-with-synchronousWatchDirectory.js index f4a96e025b24c..735f76eeb8c6b 100644 --- a/tests/baselines/reference/tscWatch/watchEnvironment/watchDirectories/when-there-are-symlinks-to-folders-in-recursive-folders-with-synchronousWatchDirectory.js +++ b/tests/baselines/reference/tscWatch/watchEnvironment/watchDirectories/when-there-are-symlinks-to-folders-in-recursive-folders-with-synchronousWatchDirectory.js @@ -110,7 +110,7 @@ DirectoryWatcher:: Added:: WatchInfo: /home/user/projects/myproject 1 {"synchron Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/user/projects/myproject 1 {"synchronousWatchDirectory":true} Wild card directory -//// [/home/user/projects/myproject/src/file.js] Inode:: 124 +//// [/home/user/projects/myproject/src/file.js] Inode:: 125 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); @@ -335,7 +335,7 @@ FileWatcher:: Close:: WatchInfo: /home/user/projects/package.json 2000 {"synchro -//// [/home/user/projects/myproject/src/file.js] file written with same contents Inode:: 124 +//// [/home/user/projects/myproject/src/file.js] file written with same contents Inode:: 125 PolledWatches:: /home/user/projects/myproject/node_modules/@types: diff --git a/tests/baselines/reference/tscWatch/watchEnvironment/watchDirectories/when-there-are-symlinks-to-folders-in-recursive-folders.js b/tests/baselines/reference/tscWatch/watchEnvironment/watchDirectories/when-there-are-symlinks-to-folders-in-recursive-folders.js index 92c164219a94f..4e800e71ccc5a 100644 --- a/tests/baselines/reference/tscWatch/watchEnvironment/watchDirectories/when-there-are-symlinks-to-folders-in-recursive-folders.js +++ b/tests/baselines/reference/tscWatch/watchEnvironment/watchDirectories/when-there-are-symlinks-to-folders-in-recursive-folders.js @@ -105,7 +105,7 @@ DirectoryWatcher:: Added:: WatchInfo: /home/user/projects/myproject 1 undefined Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/user/projects/myproject 1 undefined Wild card directory -//// [/home/user/projects/myproject/src/file.js] Inode:: 124 +//// [/home/user/projects/myproject/src/file.js] Inode:: 125 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); @@ -341,7 +341,7 @@ Elapsed:: *ms DirectoryWatcher:: Triggered with /home/user/projects/myproject/no sysLog:: Elapsed:: *ms:: onTimerToUpdateChildWatches:: 0 undefined -//// [/home/user/projects/myproject/src/file.js] file written with same contents Inode:: 124 +//// [/home/user/projects/myproject/src/file.js] file written with same contents Inode:: 125 PolledWatches:: /home/user/projects/myproject/node_modules/@types: diff --git a/tests/baselines/reference/tscWatch/watchEnvironment/watchDirectories/with-non-synchronous-watch-directory-renaming-a-file.js b/tests/baselines/reference/tscWatch/watchEnvironment/watchDirectories/with-non-synchronous-watch-directory-renaming-a-file.js index 1edcadc5543e6..dd0e79906a110 100644 --- a/tests/baselines/reference/tscWatch/watchEnvironment/watchDirectories/with-non-synchronous-watch-directory-renaming-a-file.js +++ b/tests/baselines/reference/tscWatch/watchEnvironment/watchDirectories/with-non-synchronous-watch-directory-renaming-a-file.js @@ -37,14 +37,14 @@ Output:: -//// [/user/username/projects/myproject/dist/file2.js] Inode:: 116 +//// [/user/username/projects/myproject/dist/file2.js] Inode:: 117 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.x = void 0; exports.x = 10; -//// [/user/username/projects/myproject/dist/file1.js] Inode:: 117 +//// [/user/username/projects/myproject/dist/file1.js] Inode:: 118 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); @@ -62,7 +62,7 @@ FsWatches:: /user/username/projects/myproject: *new* {"inode":4} /user/username/projects/myproject/dist: *new* - {"inode":115} + {"inode":116} /user/username/projects/myproject/src: *new* {"inode":5} /user/username/projects/myproject/src/file1.ts: *new* @@ -109,7 +109,7 @@ exitCode:: ExitStatus.undefined Change:: rename the file Input:: -//// [/user/username/projects/myproject/src/renamed.ts] Inode:: 118 +//// [/user/username/projects/myproject/src/renamed.ts] Inode:: 119 export const x = 10; //// [/user/username/projects/myproject/src/file2.ts] deleted @@ -132,7 +132,7 @@ FsWatches:: /user/username/projects/myproject: {"inode":4} /user/username/projects/myproject/dist: - {"inode":115} + {"inode":116} /user/username/projects/myproject/src: {"inode":5} /user/username/projects/myproject/src/file1.ts: @@ -166,7 +166,7 @@ Output:: -//// [/user/username/projects/myproject/dist/file1.js] file written with same contents Inode:: 117 +//// [/user/username/projects/myproject/dist/file1.js] file written with same contents Inode:: 118 PolledWatches:: /user/username/projects/myproject/node_modules/@types: @@ -186,7 +186,7 @@ FsWatches:: /user/username/projects/myproject: {"inode":4} /user/username/projects/myproject/dist: - {"inode":115} + {"inode":116} /user/username/projects/myproject/src: {"inode":5} /user/username/projects/myproject/src/file1.ts: @@ -249,7 +249,7 @@ Output:: -//// [/user/username/projects/myproject/dist/renamed.js] Inode:: 119 +//// [/user/username/projects/myproject/dist/renamed.js] Inode:: 120 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.x = void 0; @@ -273,13 +273,13 @@ FsWatches:: /user/username/projects/myproject: {"inode":4} /user/username/projects/myproject/dist: - {"inode":115} + {"inode":116} /user/username/projects/myproject/src: {"inode":5} /user/username/projects/myproject/src/file1.ts: {"inode":6} /user/username/projects/myproject/src/renamed.ts: *new* - {"inode":118} + {"inode":119} /user/username/projects/myproject/tsconfig.json: {"inode":8} diff --git a/tests/baselines/reference/tscWatch/watchEnvironment/watchDirectories/with-non-synchronous-watch-directory-with-outDir-and-declaration-enabled.js b/tests/baselines/reference/tscWatch/watchEnvironment/watchDirectories/with-non-synchronous-watch-directory-with-outDir-and-declaration-enabled.js index cf3ec378910ca..bb41a714508cf 100644 --- a/tests/baselines/reference/tscWatch/watchEnvironment/watchDirectories/with-non-synchronous-watch-directory-with-outDir-and-declaration-enabled.js +++ b/tests/baselines/reference/tscWatch/watchEnvironment/watchDirectories/with-non-synchronous-watch-directory-with-outDir-and-declaration-enabled.js @@ -38,12 +38,12 @@ Output:: -//// [/user/username/projects/myproject/dist/file1.js] Inode:: 118 +//// [/user/username/projects/myproject/dist/file1.js] Inode:: 119 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -//// [/user/username/projects/myproject/dist/file1.d.ts] Inode:: 119 +//// [/user/username/projects/myproject/dist/file1.d.ts] Inode:: 120 export {}; @@ -70,7 +70,7 @@ FsWatches:: /user/username/projects/myproject: *new* {"inode":4} /user/username/projects/myproject/dist: *new* - {"inode":117} + {"inode":118} /user/username/projects/myproject/node_modules: *new* {"inode":7} /user/username/projects/myproject/node_modules/file2: *new* @@ -121,7 +121,7 @@ exitCode:: ExitStatus.undefined Change:: Add new file, should schedule and run timeout to update directory watcher Input:: -//// [/user/username/projects/myproject/src/file3.ts] Inode:: 120 +//// [/user/username/projects/myproject/src/file3.ts] Inode:: 121 export const y = 10; @@ -159,14 +159,14 @@ Output:: -//// [/user/username/projects/myproject/dist/file3.js] Inode:: 121 +//// [/user/username/projects/myproject/dist/file3.js] Inode:: 122 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.y = void 0; exports.y = 10; -//// [/user/username/projects/myproject/dist/file3.d.ts] Inode:: 122 +//// [/user/username/projects/myproject/dist/file3.d.ts] Inode:: 123 export declare const y = 10; @@ -193,7 +193,7 @@ FsWatches:: /user/username/projects/myproject: {"inode":4} /user/username/projects/myproject/dist: - {"inode":117} + {"inode":118} /user/username/projects/myproject/node_modules: {"inode":7} /user/username/projects/myproject/node_modules/file2: @@ -205,7 +205,7 @@ FsWatches:: /user/username/projects/myproject/src/file1.ts: {"inode":6} /user/username/projects/myproject/src/file3.ts: *new* - {"inode":120} + {"inode":121} /user/username/projects/myproject/tsconfig.json: {"inode":10} diff --git a/tests/baselines/reference/tscWatch/watchEnvironment/watchDirectories/with-non-synchronous-watch-directory.js b/tests/baselines/reference/tscWatch/watchEnvironment/watchDirectories/with-non-synchronous-watch-directory.js index 14f43fb747164..217387010fe2b 100644 --- a/tests/baselines/reference/tscWatch/watchEnvironment/watchDirectories/with-non-synchronous-watch-directory.js +++ b/tests/baselines/reference/tscWatch/watchEnvironment/watchDirectories/with-non-synchronous-watch-directory.js @@ -39,7 +39,7 @@ Output:: -//// [/user/username/projects/myproject/src/file1.js] Inode:: 117 +//// [/user/username/projects/myproject/src/file1.js] Inode:: 118 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); @@ -191,7 +191,7 @@ Output:: -//// [/user/username/projects/myproject/src/file1.js] file written with same contents Inode:: 117 +//// [/user/username/projects/myproject/src/file1.js] file written with same contents Inode:: 118 PolledWatches:: /user/username/projects/myproject/node_modules: @@ -343,7 +343,7 @@ FsWatches:: /user/username/projects/myproject: {"inode":4} /user/username/projects/myproject/node_modules: *new* - {"inode":118} + {"inode":119} /user/username/projects/myproject/src: {"inode":5} /user/username/projects/myproject/src/file1.ts: @@ -371,7 +371,7 @@ exitCode:: ExitStatus.undefined Change:: npm install index file in file2 Input:: -//// [/user/username/projects/myproject/node_modules/file2/index.d.ts] Inode:: 120 +//// [/user/username/projects/myproject/node_modules/file2/index.d.ts] Inode:: 121 export const x = 10; @@ -401,9 +401,9 @@ FsWatches:: /user/username/projects/myproject: {"inode":4} /user/username/projects/myproject/node_modules: - {"inode":118} -/user/username/projects/myproject/node_modules/file2: *new* {"inode":119} +/user/username/projects/myproject/node_modules/file2: *new* + {"inode":120} /user/username/projects/myproject/src: {"inode":5} /user/username/projects/myproject/src/file1.ts: @@ -459,7 +459,7 @@ Output:: -//// [/user/username/projects/myproject/src/file1.js] file written with same contents Inode:: 117 +//// [/user/username/projects/myproject/src/file1.js] file written with same contents Inode:: 118 PolledWatches:: /user/username/projects/myproject/node_modules/@types: @@ -485,11 +485,11 @@ FsWatches:: /user/username/projects/myproject: {"inode":4} /user/username/projects/myproject/node_modules: - {"inode":118} -/user/username/projects/myproject/node_modules/file2: {"inode":119} -/user/username/projects/myproject/node_modules/file2/index.d.ts: *new* +/user/username/projects/myproject/node_modules/file2: {"inode":120} +/user/username/projects/myproject/node_modules/file2/index.d.ts: *new* + {"inode":121} /user/username/projects/myproject/src: {"inode":5} /user/username/projects/myproject/src/file1.ts: diff --git a/tests/baselines/reference/tscWatch/watchEnvironment/watchOptions/with-excludeDirectories-option-with-recursive-directory-watching-extendedDiagnostics.js b/tests/baselines/reference/tscWatch/watchEnvironment/watchOptions/with-excludeDirectories-option-with-recursive-directory-watching-extendedDiagnostics.js index 15617dab79225..5be5625625763 100644 --- a/tests/baselines/reference/tscWatch/watchEnvironment/watchOptions/with-excludeDirectories-option-with-recursive-directory-watching-extendedDiagnostics.js +++ b/tests/baselines/reference/tscWatch/watchEnvironment/watchOptions/with-excludeDirectories-option-with-recursive-directory-watching-extendedDiagnostics.js @@ -78,7 +78,7 @@ DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/myproject 1 {"excl Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/myproject 1 {"excludeDirectories":["/user/username/projects/myproject/**/temp"]} Wild card directory -//// [/user/username/projects/myproject/src/main.js] Inode:: 121 +//// [/user/username/projects/myproject/src/main.js] Inode:: 122 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var bar_1 = require("bar"); @@ -180,7 +180,7 @@ exitCode:: ExitStatus.undefined Change:: add new folder to temp Input:: -//// [/user/username/projects/myproject/node_modules/bar/temp/fooBar/index.d.ts] Inode:: 123 +//// [/user/username/projects/myproject/node_modules/bar/temp/fooBar/index.d.ts] Inode:: 124 export function temp(): string; diff --git a/tests/baselines/reference/tscWatch/watchEnvironment/watchOptions/with-excludeDirectories-option-with-recursive-directory-watching.js b/tests/baselines/reference/tscWatch/watchEnvironment/watchOptions/with-excludeDirectories-option-with-recursive-directory-watching.js index 3ef6aec249df8..0a663c86ac9e2 100644 --- a/tests/baselines/reference/tscWatch/watchEnvironment/watchOptions/with-excludeDirectories-option-with-recursive-directory-watching.js +++ b/tests/baselines/reference/tscWatch/watchEnvironment/watchOptions/with-excludeDirectories-option-with-recursive-directory-watching.js @@ -51,7 +51,7 @@ Output:: -//// [/user/username/projects/myproject/src/main.js] Inode:: 121 +//// [/user/username/projects/myproject/src/main.js] Inode:: 122 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var bar_1 = require("bar"); @@ -141,7 +141,7 @@ exitCode:: ExitStatus.undefined Change:: add new folder to temp Input:: -//// [/user/username/projects/myproject/node_modules/bar/temp/fooBar/index.d.ts] Inode:: 123 +//// [/user/username/projects/myproject/node_modules/bar/temp/fooBar/index.d.ts] Inode:: 124 export function temp(): string; diff --git a/tests/baselines/reference/tscWatch/watchEnvironment/watchOptions/with-fallbackPolling-option.js b/tests/baselines/reference/tscWatch/watchEnvironment/watchOptions/with-fallbackPolling-option.js index 1c36f990a3745..36f09e06376bb 100644 --- a/tests/baselines/reference/tscWatch/watchEnvironment/watchOptions/with-fallbackPolling-option.js +++ b/tests/baselines/reference/tscWatch/watchEnvironment/watchOptions/with-fallbackPolling-option.js @@ -42,11 +42,11 @@ sysLog:: /home/src/tslibs/TS/Lib/lib.d.ts:: Changing to watchFile sysLog:: /user/username/projects/project:: Changing to watchFile -//// [/user/username/projects/project/commonFile1.js] Inode:: 114 +//// [/user/username/projects/project/commonFile1.js] Inode:: 115 var x = 1; -//// [/user/username/projects/project/commonFile2.js] Inode:: 115 +//// [/user/username/projects/project/commonFile2.js] Inode:: 116 var y = 1; diff --git a/tests/baselines/reference/tscWatch/watchEnvironment/watchOptions/with-watchDirectory-option.js b/tests/baselines/reference/tscWatch/watchEnvironment/watchOptions/with-watchDirectory-option.js index 84489381d1703..9e333354c90b3 100644 --- a/tests/baselines/reference/tscWatch/watchEnvironment/watchOptions/with-watchDirectory-option.js +++ b/tests/baselines/reference/tscWatch/watchEnvironment/watchOptions/with-watchDirectory-option.js @@ -37,11 +37,11 @@ Output:: -//// [/user/username/projects/project/commonFile1.js] Inode:: 114 +//// [/user/username/projects/project/commonFile1.js] Inode:: 115 var x = 1; -//// [/user/username/projects/project/commonFile2.js] Inode:: 115 +//// [/user/username/projects/project/commonFile2.js] Inode:: 116 var y = 1; diff --git a/tests/baselines/reference/tsserver/projectErrors/file-rename-on-wsl2.js b/tests/baselines/reference/tsserver/projectErrors/file-rename-on-wsl2.js index b3ff41c92a64e..29aea416971b2 100644 --- a/tests/baselines/reference/tsserver/projectErrors/file-rename-on-wsl2.js +++ b/tests/baselines/reference/tsserver/projectErrors/file-rename-on-wsl2.js @@ -216,7 +216,7 @@ Info seq [hh:mm:ss:mss] Scheduled: /home/username/workspaces/project/tsconfig.j Info seq [hh:mm:ss:mss] Scheduled: *ensureProjectForOpenFiles* Info seq [hh:mm:ss:mss] Elapsed:: *ms FileWatcher:: Triggered with /home/username/workspaces/project/src/b.ts 2:: WatchInfo: /home/username/workspaces/project/src/b.ts 500 undefined WatchType: Closed Script info Before request -//// [/home/username/workspaces/project/src/c.ts] Inode:: 117 +//// [/home/username/workspaces/project/src/c.ts] Inode:: 118 export const b = 10; //// [/home/username/workspaces/project/src/b.ts] deleted @@ -494,7 +494,7 @@ FsWatches:: /home/username/workspaces/project/src: {"inode":5} /home/username/workspaces/project/src/c.ts: *new* - {"inode":117} + {"inode":118} /home/username/workspaces/project/tsconfig.json: {"inode":8} diff --git a/tests/baselines/reference/tsserver/resolutionCache/when-resolution-fails-in-global-typings-location-with-currentDirectory-at-root.js b/tests/baselines/reference/tsserver/resolutionCache/when-resolution-fails-in-global-typings-location-with-currentDirectory-at-root.js index e8c43ce051f64..503fc2b860eec 100644 --- a/tests/baselines/reference/tsserver/resolutionCache/when-resolution-fails-in-global-typings-location-with-currentDirectory-at-root.js +++ b/tests/baselines/reference/tsserver/resolutionCache/when-resolution-fails-in-global-typings-location-with-currentDirectory-at-root.js @@ -118,10 +118,10 @@ TI:: [hh:mm:ss:mss] Updating types-registry npm package... TI:: [hh:mm:ss:mss] npm install --ignore-scripts types-registry@latest TI:: [hh:mm:ss:mss] Updated types-registry npm package TI:: typing installer creation complete -//// [/home/src/Library/Caches/typescript/package.json] Inode:: 110 +//// [/home/src/Library/Caches/typescript/package.json] Inode:: 111 { "private": true } -//// [/home/src/Library/Caches/typescript/node_modules/types-registry/index.json] Inode:: 113 +//// [/home/src/Library/Caches/typescript/node_modules/types-registry/index.json] Inode:: 114 { "entries": {} } diff --git a/tests/baselines/reference/tsserver/resolutionCache/when-resolution-fails-in-global-typings-location.js b/tests/baselines/reference/tsserver/resolutionCache/when-resolution-fails-in-global-typings-location.js index 37651532a6c33..820227692296e 100644 --- a/tests/baselines/reference/tsserver/resolutionCache/when-resolution-fails-in-global-typings-location.js +++ b/tests/baselines/reference/tsserver/resolutionCache/when-resolution-fails-in-global-typings-location.js @@ -175,10 +175,10 @@ TI:: [hh:mm:ss:mss] Updating types-registry npm package... TI:: [hh:mm:ss:mss] npm install --ignore-scripts types-registry@latest TI:: [hh:mm:ss:mss] Updated types-registry npm package TI:: typing installer creation complete -//// [/home/src/Library/Caches/typescript/package.json] Inode:: 113 +//// [/home/src/Library/Caches/typescript/package.json] Inode:: 114 { "private": true } -//// [/home/src/Library/Caches/typescript/node_modules/types-registry/index.json] Inode:: 116 +//// [/home/src/Library/Caches/typescript/node_modules/types-registry/index.json] Inode:: 117 { "entries": {} } diff --git a/tests/baselines/reference/tsserver/resolutionCache/when-resolution-is-succeeds-in-global-typings-location-with-import-from-the-cache-file-failing-with-currentDirectory-at-root.js b/tests/baselines/reference/tsserver/resolutionCache/when-resolution-is-succeeds-in-global-typings-location-with-import-from-the-cache-file-failing-with-currentDirectory-at-root.js index b56f473343f03..a86bbd397669b 100644 --- a/tests/baselines/reference/tsserver/resolutionCache/when-resolution-is-succeeds-in-global-typings-location-with-import-from-the-cache-file-failing-with-currentDirectory-at-root.js +++ b/tests/baselines/reference/tsserver/resolutionCache/when-resolution-is-succeeds-in-global-typings-location-with-import-from-the-cache-file-failing-with-currentDirectory-at-root.js @@ -22,10 +22,10 @@ interface Array { length: number; [n: number]: T; } interface ReadonlyArray {} declare const console: { log(msg: any): void; }; -//// [/home/src/Library/Caches/typescript/package.json] Inode:: 114 +//// [/home/src/Library/Caches/typescript/package.json] Inode:: 115 { "private": true } -//// [/home/src/Library/Caches/typescript/node_modules/types-registry/index.json] Inode:: 116 +//// [/home/src/Library/Caches/typescript/node_modules/types-registry/index.json] Inode:: 117 { "entries": {} } @@ -152,7 +152,7 @@ PolledWatches:: FsWatches:: /home/src/Library/Caches/typescript/package.json: *new* - {"inode":114} + {"inode":115} /home/src/tslibs/TS/Lib/lib.es2020.full.d.ts: *new* {"inode":19} diff --git a/tests/baselines/reference/tsserver/resolutionCache/when-resolution-is-succeeds-in-global-typings-location-with-import-from-the-cache-file-failing.js b/tests/baselines/reference/tsserver/resolutionCache/when-resolution-is-succeeds-in-global-typings-location-with-import-from-the-cache-file-failing.js index f905530b5b012..1269c60a80684 100644 --- a/tests/baselines/reference/tsserver/resolutionCache/when-resolution-is-succeeds-in-global-typings-location-with-import-from-the-cache-file-failing.js +++ b/tests/baselines/reference/tsserver/resolutionCache/when-resolution-is-succeeds-in-global-typings-location-with-import-from-the-cache-file-failing.js @@ -22,10 +22,10 @@ interface Array { length: number; [n: number]: T; } interface ReadonlyArray {} declare const console: { log(msg: any): void; }; -//// [/home/src/Library/Caches/typescript/package.json] Inode:: 117 +//// [/home/src/Library/Caches/typescript/package.json] Inode:: 118 { "private": true } -//// [/home/src/Library/Caches/typescript/node_modules/types-registry/index.json] Inode:: 119 +//// [/home/src/Library/Caches/typescript/node_modules/types-registry/index.json] Inode:: 120 { "entries": {} } @@ -201,7 +201,7 @@ PolledWatches:: FsWatches:: /home/src/Library/Caches/typescript/package.json: *new* - {"inode":117} + {"inode":118} /home/src/Vscode: *new* {"inode":10} /home/src/Vscode/Projects: *new* @@ -401,7 +401,7 @@ PolledWatches:: FsWatches:: /home/src/Library/Caches/typescript/package.json: - {"inode":117} + {"inode":118} /home/src/Vscode: {"inode":10} /home/src/Vscode/Projects: diff --git a/tests/baselines/reference/tsserver/resolutionCache/when-resolution-is-succeeds-in-global-typings-location-with-import-from-the-cache-file-with-currentDirectory-at-root.js b/tests/baselines/reference/tsserver/resolutionCache/when-resolution-is-succeeds-in-global-typings-location-with-import-from-the-cache-file-with-currentDirectory-at-root.js index d6e561c2adccb..37a13dd5f33fa 100644 --- a/tests/baselines/reference/tsserver/resolutionCache/when-resolution-is-succeeds-in-global-typings-location-with-import-from-the-cache-file-with-currentDirectory-at-root.js +++ b/tests/baselines/reference/tsserver/resolutionCache/when-resolution-is-succeeds-in-global-typings-location-with-import-from-the-cache-file-with-currentDirectory-at-root.js @@ -26,10 +26,10 @@ interface Array { length: number; [n: number]: T; } interface ReadonlyArray {} declare const console: { log(msg: any): void; }; -//// [/home/src/Library/Caches/typescript/package.json] Inode:: 116 +//// [/home/src/Library/Caches/typescript/package.json] Inode:: 117 { "private": true } -//// [/home/src/Library/Caches/typescript/node_modules/types-registry/index.json] Inode:: 118 +//// [/home/src/Library/Caches/typescript/node_modules/types-registry/index.json] Inode:: 119 { "entries": {} } @@ -161,7 +161,7 @@ PolledWatches:: FsWatches:: /home/src/Library/Caches/typescript/package.json: *new* - {"inode":116} + {"inode":117} /home/src/tslibs/TS/Lib/lib.es2020.full.d.ts: *new* {"inode":21} diff --git a/tests/baselines/reference/tsserver/resolutionCache/when-resolution-is-succeeds-in-global-typings-location-with-import-from-the-cache-file.js b/tests/baselines/reference/tsserver/resolutionCache/when-resolution-is-succeeds-in-global-typings-location-with-import-from-the-cache-file.js index c06a5ecae2c7e..5c43f5fabc833 100644 --- a/tests/baselines/reference/tsserver/resolutionCache/when-resolution-is-succeeds-in-global-typings-location-with-import-from-the-cache-file.js +++ b/tests/baselines/reference/tsserver/resolutionCache/when-resolution-is-succeeds-in-global-typings-location-with-import-from-the-cache-file.js @@ -26,10 +26,10 @@ interface Array { length: number; [n: number]: T; } interface ReadonlyArray {} declare const console: { log(msg: any): void; }; -//// [/home/src/Library/Caches/typescript/package.json] Inode:: 119 +//// [/home/src/Library/Caches/typescript/package.json] Inode:: 120 { "private": true } -//// [/home/src/Library/Caches/typescript/node_modules/types-registry/index.json] Inode:: 121 +//// [/home/src/Library/Caches/typescript/node_modules/types-registry/index.json] Inode:: 122 { "entries": {} } @@ -210,7 +210,7 @@ PolledWatches:: FsWatches:: /home/src/Library/Caches/typescript/package.json: *new* - {"inode":119} + {"inode":120} /home/src/Vscode: *new* {"inode":12} /home/src/Vscode/Projects: *new* @@ -406,7 +406,7 @@ PolledWatches:: FsWatches:: /home/src/Library/Caches/typescript/package.json: - {"inode":119} + {"inode":120} /home/src/Vscode: {"inode":12} /home/src/Vscode/Projects: diff --git a/tests/baselines/reference/tsserver/resolutionCache/when-resolution-is-succeeds-in-global-typings-location-with-relative-import-from-the-cache-file-with-currentDirectory-at-root.js b/tests/baselines/reference/tsserver/resolutionCache/when-resolution-is-succeeds-in-global-typings-location-with-relative-import-from-the-cache-file-with-currentDirectory-at-root.js index 026a25dfed3cc..7c0bf5288dbbd 100644 --- a/tests/baselines/reference/tsserver/resolutionCache/when-resolution-is-succeeds-in-global-typings-location-with-relative-import-from-the-cache-file-with-currentDirectory-at-root.js +++ b/tests/baselines/reference/tsserver/resolutionCache/when-resolution-is-succeeds-in-global-typings-location-with-relative-import-from-the-cache-file-with-currentDirectory-at-root.js @@ -26,10 +26,10 @@ interface Array { length: number; [n: number]: T; } interface ReadonlyArray {} declare const console: { log(msg: any): void; }; -//// [/home/src/Library/Caches/typescript/package.json] Inode:: 115 +//// [/home/src/Library/Caches/typescript/package.json] Inode:: 116 { "private": true } -//// [/home/src/Library/Caches/typescript/node_modules/types-registry/index.json] Inode:: 117 +//// [/home/src/Library/Caches/typescript/node_modules/types-registry/index.json] Inode:: 118 { "entries": {} } @@ -148,7 +148,7 @@ PolledWatches:: FsWatches:: /home/src/Library/Caches/typescript/package.json: *new* - {"inode":115} + {"inode":116} /home/src/tslibs/TS/Lib/lib.es2020.full.d.ts: *new* {"inode":20} diff --git a/tests/baselines/reference/tsserver/resolutionCache/when-resolution-is-succeeds-in-global-typings-location-with-relative-import-from-the-cache-file.js b/tests/baselines/reference/tsserver/resolutionCache/when-resolution-is-succeeds-in-global-typings-location-with-relative-import-from-the-cache-file.js index 7bbeef1b9eb4e..3f3fb92fd3d8c 100644 --- a/tests/baselines/reference/tsserver/resolutionCache/when-resolution-is-succeeds-in-global-typings-location-with-relative-import-from-the-cache-file.js +++ b/tests/baselines/reference/tsserver/resolutionCache/when-resolution-is-succeeds-in-global-typings-location-with-relative-import-from-the-cache-file.js @@ -26,10 +26,10 @@ interface Array { length: number; [n: number]: T; } interface ReadonlyArray {} declare const console: { log(msg: any): void; }; -//// [/home/src/Library/Caches/typescript/package.json] Inode:: 118 +//// [/home/src/Library/Caches/typescript/package.json] Inode:: 119 { "private": true } -//// [/home/src/Library/Caches/typescript/node_modules/types-registry/index.json] Inode:: 120 +//// [/home/src/Library/Caches/typescript/node_modules/types-registry/index.json] Inode:: 121 { "entries": {} } @@ -197,7 +197,7 @@ PolledWatches:: FsWatches:: /home/src/Library/Caches/typescript/package.json: *new* - {"inode":118} + {"inode":119} /home/src/Vscode: *new* {"inode":11} /home/src/Vscode/Projects: *new* @@ -391,7 +391,7 @@ PolledWatches:: FsWatches:: /home/src/Library/Caches/typescript/package.json: - {"inode":118} + {"inode":119} /home/src/Vscode: {"inode":11} /home/src/Vscode/Projects: diff --git a/tests/baselines/reference/tsserver/symLinks/monorepo-style-sibling-packages-symlinked-Linux-canUseWatchEvents.js b/tests/baselines/reference/tsserver/symLinks/monorepo-style-sibling-packages-symlinked-Linux-canUseWatchEvents.js index 19c1bee7d6914..cf22a075f9cfc 100644 --- a/tests/baselines/reference/tsserver/symLinks/monorepo-style-sibling-packages-symlinked-Linux-canUseWatchEvents.js +++ b/tests/baselines/reference/tsserver/symLinks/monorepo-style-sibling-packages-symlinked-Linux-canUseWatchEvents.js @@ -685,20 +685,20 @@ Custom watchDirectory:: Triggered Ignored:: {"id":8,"path":"/home/src/projects/p Custom watchDirectory:: Triggered Ignored:: {"id":8,"path":"/home/src/projects/project/node_modules/package1","recursive":true,"ignoreUpdate":true}:: /home/src/projects/project/node_modules/package1/tsconfig.tsbuildinfo.readable.baseline.txt created Custom watchDirectory:: Triggered Ignored:: {"id":8,"path":"/home/src/projects/project/node_modules/package1","recursive":true,"ignoreUpdate":true}:: /home/src/projects/project/node_modules/package1/tsconfig.tsbuildinfo.readable.baseline.txt updated Before request -//// [/home/src/projects/project/packages/package1/dist/index.js] Inode:: 126 +//// [/home/src/projects/project/packages/package1/dist/index.js] Inode:: 127 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -//// [/home/src/projects/project/packages/package1/dist/index.d.ts] Inode:: 127 +//// [/home/src/projects/project/packages/package1/dist/index.d.ts] Inode:: 128 export type FooType = "foo"; export type BarType = "bar"; -//// [/home/src/projects/project/packages/package1/tsconfig.tsbuildinfo] Inode:: 128 +//// [/home/src/projects/project/packages/package1/tsconfig.tsbuildinfo] Inode:: 129 {"root":["./src/index.ts"],"version":"FakeTSVersion"} -//// [/home/src/projects/project/packages/package1/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 129 +//// [/home/src/projects/project/packages/package1/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 130 { "root": [ "./src/index.ts" @@ -1429,14 +1429,14 @@ Custom watchDirectory:: Triggered Ignored:: {"id":8,"path":"/home/src/projects/p Custom watchDirectory:: Triggered Ignored:: {"id":8,"path":"/home/src/projects/project/node_modules/package1","recursive":true,"ignoreUpdate":true}:: /home/src/projects/project/node_modules/package1/tsconfig.tsbuildinfo updated Custom watchDirectory:: Triggered Ignored:: {"id":8,"path":"/home/src/projects/project/node_modules/package1","recursive":true,"ignoreUpdate":true}:: /home/src/projects/project/node_modules/package1/tsconfig.tsbuildinfo.readable.baseline.txt updated Before request -//// [/home/src/projects/project/packages/package1/tsconfig.tsbuildinfo] file written with same contents Inode:: 128 -//// [/home/src/projects/project/packages/package1/tsconfig.tsbuildinfo.readable.baseline.txt] file written with same contents Inode:: 129 -//// [/home/src/projects/project/packages/package1/dist/index.js] Inode:: 131 +//// [/home/src/projects/project/packages/package1/tsconfig.tsbuildinfo] file written with same contents Inode:: 129 +//// [/home/src/projects/project/packages/package1/tsconfig.tsbuildinfo.readable.baseline.txt] file written with same contents Inode:: 130 +//// [/home/src/projects/project/packages/package1/dist/index.js] Inode:: 132 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -//// [/home/src/projects/project/packages/package1/dist/index.d.ts] Inode:: 132 +//// [/home/src/projects/project/packages/package1/dist/index.d.ts] Inode:: 133 export type FooType = "foo"; export type BarType = "bar"; diff --git a/tests/baselines/reference/tsserver/symLinks/monorepo-style-sibling-packages-symlinked-Linux.js b/tests/baselines/reference/tsserver/symLinks/monorepo-style-sibling-packages-symlinked-Linux.js index bd058ce7a79ca..226c174afde5e 100644 --- a/tests/baselines/reference/tsserver/symLinks/monorepo-style-sibling-packages-symlinked-Linux.js +++ b/tests/baselines/reference/tsserver/symLinks/monorepo-style-sibling-packages-symlinked-Linux.js @@ -495,20 +495,20 @@ After running Immedidate callback:: count: 0 Build dependencies Before running Timeout callback:: count: 1 7: timerToUpdateChildWatches -//// [/home/src/projects/project/packages/package1/dist/index.js] Inode:: 126 +//// [/home/src/projects/project/packages/package1/dist/index.js] Inode:: 127 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -//// [/home/src/projects/project/packages/package1/dist/index.d.ts] Inode:: 127 +//// [/home/src/projects/project/packages/package1/dist/index.d.ts] Inode:: 128 export type FooType = "foo"; export type BarType = "bar"; -//// [/home/src/projects/project/packages/package1/tsconfig.tsbuildinfo] Inode:: 128 +//// [/home/src/projects/project/packages/package1/tsconfig.tsbuildinfo] Inode:: 129 {"root":["./src/index.ts"],"version":"FakeTSVersion"} -//// [/home/src/projects/project/packages/package1/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 129 +//// [/home/src/projects/project/packages/package1/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 130 { "root": [ "./src/index.ts" @@ -554,7 +554,7 @@ FsWatches:: /home/src/projects/project/packages/package1: {"inode":6} /home/src/projects/project/packages/package1/dist: *new* - {"inode":125} + {"inode":126} /home/src/projects/project/packages/package1/package.json: {"inode":7} /home/src/projects/project/packages/package1/src: @@ -699,9 +699,9 @@ FsWatches:: /home/src/projects/project/packages/package1: {"inode":6} /home/src/projects/project/packages/package1/dist: - {"inode":125} + {"inode":126} /home/src/projects/project/packages/package1/dist/index.d.ts: *new* - {"inode":127} + {"inode":128} /home/src/projects/project/packages/package1/package.json: {"inode":7} /home/src/projects/project/packages/package1/src: @@ -910,9 +910,9 @@ FsWatches:: FsWatches *deleted*:: /home/src/projects/project/packages/package1/dist: - {"inode":125} + {"inode":126} /home/src/projects/project/packages/package1/dist/index.d.ts: - {"inode":127} + {"inode":128} Timeout callback:: count: 3 13: /home/src/projects/project/packages/package2/tsconfig.json *new* @@ -1348,14 +1348,14 @@ Info seq [hh:mm:ss:mss] FileWatcher:: Triggered with /home/src/projects/project Info seq [hh:mm:ss:mss] Elapsed:: *ms FileWatcher:: Triggered with /home/src/projects/project/packages/package1/dist/index.d.ts 0:: WatchInfo: /home/src/projects/project/packages/package1/dist/index.d.ts 500 undefined WatchType: Closed Script info Before running Timeout callback:: count: 1 25: timerToUpdateChildWatches -//// [/home/src/projects/project/packages/package1/tsconfig.tsbuildinfo] file written with same contents Inode:: 128 -//// [/home/src/projects/project/packages/package1/tsconfig.tsbuildinfo.readable.baseline.txt] file written with same contents Inode:: 129 -//// [/home/src/projects/project/packages/package1/dist/index.js] Inode:: 131 +//// [/home/src/projects/project/packages/package1/tsconfig.tsbuildinfo] file written with same contents Inode:: 129 +//// [/home/src/projects/project/packages/package1/tsconfig.tsbuildinfo.readable.baseline.txt] file written with same contents Inode:: 130 +//// [/home/src/projects/project/packages/package1/dist/index.js] Inode:: 132 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -//// [/home/src/projects/project/packages/package1/dist/index.d.ts] Inode:: 132 +//// [/home/src/projects/project/packages/package1/dist/index.d.ts] Inode:: 133 export type FooType = "foo"; export type BarType = "bar"; @@ -1389,7 +1389,7 @@ FsWatches:: /home/src/projects/project/packages/package1: {"inode":6} /home/src/projects/project/packages/package1/dist/index.d.ts: *new* - {"inode":132} + {"inode":133} /home/src/projects/project/packages/package1/package.json: {"inode":7} /home/src/projects/project/packages/package1/src: @@ -1455,9 +1455,9 @@ FsWatches:: /home/src/projects/project/packages/package1: {"inode":6} /home/src/projects/project/packages/package1/dist: *new* - {"inode":130} + {"inode":131} /home/src/projects/project/packages/package1/dist/index.d.ts: - {"inode":132} + {"inode":133} /home/src/projects/project/packages/package1/package.json: {"inode":7} /home/src/projects/project/packages/package1/src: @@ -1600,9 +1600,9 @@ FsWatches:: /home/src/projects/project/packages/package1: {"inode":6} /home/src/projects/project/packages/package1/dist: - {"inode":130} + {"inode":131} /home/src/projects/project/packages/package1/dist/index.d.ts: - {"inode":132} + {"inode":133} /home/src/projects/project/packages/package1/package.json: {"inode":7} /home/src/projects/project/packages/package1/src: diff --git a/tests/baselines/reference/tsserver/symLinks/monorepo-style-sibling-packages-symlinked-package1-built-Linux-canUseWatchEvents.js b/tests/baselines/reference/tsserver/symLinks/monorepo-style-sibling-packages-symlinked-package1-built-Linux-canUseWatchEvents.js index 35c3b91ef00c3..f894acf295042 100644 --- a/tests/baselines/reference/tsserver/symLinks/monorepo-style-sibling-packages-symlinked-package1-built-Linux-canUseWatchEvents.js +++ b/tests/baselines/reference/tsserver/symLinks/monorepo-style-sibling-packages-symlinked-package1-built-Linux-canUseWatchEvents.js @@ -86,20 +86,20 @@ declare const console: { log(msg: any): void; }; //// [/home/src/tslibs/TS/Lib/lib.es2016.full.d.ts] *Lib* Inode:: 34 -//// [/home/src/projects/project/packages/package1/dist/index.js] Inode:: 126 +//// [/home/src/projects/project/packages/package1/dist/index.js] Inode:: 127 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -//// [/home/src/projects/project/packages/package1/dist/index.d.ts] Inode:: 127 +//// [/home/src/projects/project/packages/package1/dist/index.d.ts] Inode:: 128 export type FooType = "foo"; export type BarType = "bar"; -//// [/home/src/projects/project/packages/package1/tsconfig.tsbuildinfo] Inode:: 128 +//// [/home/src/projects/project/packages/package1/tsconfig.tsbuildinfo] Inode:: 129 {"root":["./src/index.ts"],"version":"FakeTSVersion"} -//// [/home/src/projects/project/packages/package1/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 129 +//// [/home/src/projects/project/packages/package1/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 130 { "root": [ "./src/index.ts" @@ -1047,14 +1047,14 @@ Custom watchDirectory:: Triggered Ignored:: {"id":9,"path":"/home/src/projects/p Custom watchDirectory:: Triggered Ignored:: {"id":9,"path":"/home/src/projects/project/node_modules/package1","recursive":true,"ignoreUpdate":true}:: /home/src/projects/project/node_modules/package1/tsconfig.tsbuildinfo updated Custom watchDirectory:: Triggered Ignored:: {"id":9,"path":"/home/src/projects/project/node_modules/package1","recursive":true,"ignoreUpdate":true}:: /home/src/projects/project/node_modules/package1/tsconfig.tsbuildinfo.readable.baseline.txt updated Before request -//// [/home/src/projects/project/packages/package1/tsconfig.tsbuildinfo] file written with same contents Inode:: 128 -//// [/home/src/projects/project/packages/package1/tsconfig.tsbuildinfo.readable.baseline.txt] file written with same contents Inode:: 129 -//// [/home/src/projects/project/packages/package1/dist/index.js] Inode:: 131 +//// [/home/src/projects/project/packages/package1/tsconfig.tsbuildinfo] file written with same contents Inode:: 129 +//// [/home/src/projects/project/packages/package1/tsconfig.tsbuildinfo.readable.baseline.txt] file written with same contents Inode:: 130 +//// [/home/src/projects/project/packages/package1/dist/index.js] Inode:: 132 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -//// [/home/src/projects/project/packages/package1/dist/index.d.ts] Inode:: 132 +//// [/home/src/projects/project/packages/package1/dist/index.d.ts] Inode:: 133 export type FooType = "foo"; export type BarType = "bar"; diff --git a/tests/baselines/reference/tsserver/symLinks/monorepo-style-sibling-packages-symlinked-package1-built-Linux.js b/tests/baselines/reference/tsserver/symLinks/monorepo-style-sibling-packages-symlinked-package1-built-Linux.js index d879209b4f58c..66603227a4624 100644 --- a/tests/baselines/reference/tsserver/symLinks/monorepo-style-sibling-packages-symlinked-package1-built-Linux.js +++ b/tests/baselines/reference/tsserver/symLinks/monorepo-style-sibling-packages-symlinked-package1-built-Linux.js @@ -86,20 +86,20 @@ declare const console: { log(msg: any): void; }; //// [/home/src/tslibs/TS/Lib/lib.es2016.full.d.ts] *Lib* Inode:: 34 -//// [/home/src/projects/project/packages/package1/dist/index.js] Inode:: 126 +//// [/home/src/projects/project/packages/package1/dist/index.js] Inode:: 127 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -//// [/home/src/projects/project/packages/package1/dist/index.d.ts] Inode:: 127 +//// [/home/src/projects/project/packages/package1/dist/index.d.ts] Inode:: 128 export type FooType = "foo"; export type BarType = "bar"; -//// [/home/src/projects/project/packages/package1/tsconfig.tsbuildinfo] Inode:: 128 +//// [/home/src/projects/project/packages/package1/tsconfig.tsbuildinfo] Inode:: 129 {"root":["./src/index.ts"],"version":"FakeTSVersion"} -//// [/home/src/projects/project/packages/package1/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 129 +//// [/home/src/projects/project/packages/package1/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 130 { "root": [ "./src/index.ts" @@ -330,9 +330,9 @@ FsWatches:: /home/src/projects/project/packages/package1: *new* {"inode":6} /home/src/projects/project/packages/package1/dist: *new* - {"inode":125} + {"inode":126} /home/src/projects/project/packages/package1/dist/index.d.ts: *new* - {"inode":127} + {"inode":128} /home/src/projects/project/packages/package1/package.json: *new* {"inode":7} /home/src/projects/project/packages/package1/src: *new* @@ -540,9 +540,9 @@ FsWatches:: FsWatches *deleted*:: /home/src/projects/project/packages/package1/dist: - {"inode":125} + {"inode":126} /home/src/projects/project/packages/package1/dist/index.d.ts: - {"inode":127} + {"inode":128} Timeout callback:: count: 3 2: /home/src/projects/project/packages/package2/tsconfig.json *new* @@ -983,14 +983,14 @@ Info seq [hh:mm:ss:mss] FileWatcher:: Triggered with /home/src/projects/project Info seq [hh:mm:ss:mss] Elapsed:: *ms FileWatcher:: Triggered with /home/src/projects/project/packages/package1/dist/index.d.ts 0:: WatchInfo: /home/src/projects/project/packages/package1/dist/index.d.ts 500 undefined WatchType: Closed Script info Before running Timeout callback:: count: 1 14: timerToUpdateChildWatches -//// [/home/src/projects/project/packages/package1/tsconfig.tsbuildinfo] file written with same contents Inode:: 128 -//// [/home/src/projects/project/packages/package1/tsconfig.tsbuildinfo.readable.baseline.txt] file written with same contents Inode:: 129 -//// [/home/src/projects/project/packages/package1/dist/index.js] Inode:: 131 +//// [/home/src/projects/project/packages/package1/tsconfig.tsbuildinfo] file written with same contents Inode:: 129 +//// [/home/src/projects/project/packages/package1/tsconfig.tsbuildinfo.readable.baseline.txt] file written with same contents Inode:: 130 +//// [/home/src/projects/project/packages/package1/dist/index.js] Inode:: 132 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -//// [/home/src/projects/project/packages/package1/dist/index.d.ts] Inode:: 132 +//// [/home/src/projects/project/packages/package1/dist/index.d.ts] Inode:: 133 export type FooType = "foo"; export type BarType = "bar"; @@ -1024,7 +1024,7 @@ FsWatches:: /home/src/projects/project/packages/package1: {"inode":6} /home/src/projects/project/packages/package1/dist/index.d.ts: *new* - {"inode":132} + {"inode":133} /home/src/projects/project/packages/package1/package.json: {"inode":7} /home/src/projects/project/packages/package1/src: @@ -1090,9 +1090,9 @@ FsWatches:: /home/src/projects/project/packages/package1: {"inode":6} /home/src/projects/project/packages/package1/dist: *new* - {"inode":130} + {"inode":131} /home/src/projects/project/packages/package1/dist/index.d.ts: - {"inode":132} + {"inode":133} /home/src/projects/project/packages/package1/package.json: {"inode":7} /home/src/projects/project/packages/package1/src: @@ -1235,9 +1235,9 @@ FsWatches:: /home/src/projects/project/packages/package1: {"inode":6} /home/src/projects/project/packages/package1/dist: - {"inode":130} + {"inode":131} /home/src/projects/project/packages/package1/dist/index.d.ts: - {"inode":132} + {"inode":133} /home/src/projects/project/packages/package1/package.json: {"inode":7} /home/src/projects/project/packages/package1/src: diff --git a/tests/baselines/reference/tsserver/symLinks/packages-outside-project-folder-Linux-canUseWatchEvents.js b/tests/baselines/reference/tsserver/symLinks/packages-outside-project-folder-Linux-canUseWatchEvents.js index 7dba2f4820933..d09f35306a249 100644 --- a/tests/baselines/reference/tsserver/symLinks/packages-outside-project-folder-Linux-canUseWatchEvents.js +++ b/tests/baselines/reference/tsserver/symLinks/packages-outside-project-folder-Linux-canUseWatchEvents.js @@ -688,7 +688,7 @@ After running Immedidate callback:: count: 0 change in unrelated folder in a Before running Timeout callback:: count: 0 -//// [/home/src/projects/a/2/unrelated/somethingUnrelated.ts] Inode:: 146 +//// [/home/src/projects/a/2/unrelated/somethingUnrelated.ts] Inode:: 147 export const a = 10; @@ -818,7 +818,7 @@ After running Immedidate callback:: count: 0 change in unrelated folder in c Before running Timeout callback:: count: 0 -//// [/home/src/projects/c/4/unrelated/somethingUnrelated.ts] Inode:: 147 +//// [/home/src/projects/c/4/unrelated/somethingUnrelated.ts] Inode:: 148 export const a = 10; @@ -968,18 +968,18 @@ Custom watchDirectory:: Triggered Ignored:: {"id":9,"path":"/home/src/projects/b Custom watchDirectory:: Triggered Ignored:: {"id":9,"path":"/home/src/projects/b/2/b-impl/b/node_modules/a","recursive":true,"ignoreUpdate":true}:: /home/src/projects/b/2/b-impl/b/node_modules/a/lib/tsconfig.tsbuildinfo.readable.baseline.txt updated Custom watchDirectory:: Triggered Ignored:: {"id":9,"path":"/home/src/projects/b/2/b-impl/b/node_modules/a","recursive":true,"ignoreUpdate":true}:: /home/src/projects/b/2/b-impl/b/node_modules/a/lib updated Before request -//// [/home/src/projects/c/3/c-impl/c/lib/c.js] Inode:: 149 +//// [/home/src/projects/c/3/c-impl/c/lib/c.js] Inode:: 150 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.c = void 0; exports.c = 'test'; -//// [/home/src/projects/c/3/c-impl/c/lib/c.d.ts] Inode:: 150 +//// [/home/src/projects/c/3/c-impl/c/lib/c.d.ts] Inode:: 151 export declare const c: string; -//// [/home/src/projects/c/3/c-impl/c/lib/index.js] Inode:: 151 +//// [/home/src/projects/c/3/c-impl/c/lib/index.js] Inode:: 152 "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; @@ -999,14 +999,14 @@ Object.defineProperty(exports, "__esModule", { value: true }); __exportStar(require("./c"), exports); -//// [/home/src/projects/c/3/c-impl/c/lib/index.d.ts] Inode:: 152 +//// [/home/src/projects/c/3/c-impl/c/lib/index.d.ts] Inode:: 153 export * from './c'; -//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo] Inode:: 153 +//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo] Inode:: 154 {"root":["../src/c.ts","../src/index.ts"],"version":"FakeTSVersion"} -//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 154 +//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 155 { "root": [ "../src/c.ts", @@ -1016,18 +1016,18 @@ export * from './c'; "size": 68 } -//// [/home/src/projects/a/1/a-impl/a/lib/a.js] Inode:: 156 +//// [/home/src/projects/a/1/a-impl/a/lib/a.js] Inode:: 157 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.a = void 0; exports.a = 'test'; -//// [/home/src/projects/a/1/a-impl/a/lib/a.d.ts] Inode:: 157 +//// [/home/src/projects/a/1/a-impl/a/lib/a.d.ts] Inode:: 158 export declare const a: string; -//// [/home/src/projects/a/1/a-impl/a/lib/index.js] Inode:: 158 +//// [/home/src/projects/a/1/a-impl/a/lib/index.js] Inode:: 159 "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; @@ -1048,15 +1048,15 @@ __exportStar(require("./a"), exports); __exportStar(require("c"), exports); -//// [/home/src/projects/a/1/a-impl/a/lib/index.d.ts] Inode:: 159 +//// [/home/src/projects/a/1/a-impl/a/lib/index.d.ts] Inode:: 160 export * from './a'; export * from 'c'; -//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo] Inode:: 160 +//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo] Inode:: 161 {"root":["../src/a.ts","../src/index.ts"],"version":"FakeTSVersion"} -//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 161 +//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 162 { "root": [ "../src/a.ts", @@ -1579,7 +1579,7 @@ After running Immedidate callback:: count: 0 change in unrelated folder in a Before running Timeout callback:: count: 0 -//// [/home/src/projects/a/2/unrelated/anotherFile.ts] Inode:: 162 +//// [/home/src/projects/a/2/unrelated/anotherFile.ts] Inode:: 163 export const a = 10; @@ -1695,7 +1695,7 @@ After running Immedidate callback:: count: 0 change in unrelated folder in c Before running Timeout callback:: count: 0 -//// [/home/src/projects/c/4/unrelated/anotherFile.ts] Inode:: 163 +//// [/home/src/projects/c/4/unrelated/anotherFile.ts] Inode:: 164 export const a = 10; @@ -2403,18 +2403,18 @@ Custom watchDirectory:: Triggered Ignored:: {"id":30,"path":"/home/src/projects/ Custom watchDirectory:: Triggered Ignored:: {"id":30,"path":"/home/src/projects/b/2/b-impl/b/node_modules/a","recursive":true,"ignoreUpdate":true}:: /home/src/projects/b/2/b-impl/b/node_modules/a/lib/tsconfig.tsbuildinfo.readable.baseline.txt updated Custom watchDirectory:: Triggered Ignored:: {"id":30,"path":"/home/src/projects/b/2/b-impl/b/node_modules/a","recursive":true,"ignoreUpdate":true}:: /home/src/projects/b/2/b-impl/b/node_modules/a/lib updated Before request -//// [/home/src/projects/c/3/c-impl/c/lib/c.js] Inode:: 165 +//// [/home/src/projects/c/3/c-impl/c/lib/c.js] Inode:: 166 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.c = void 0; exports.c = 'test'; -//// [/home/src/projects/c/3/c-impl/c/lib/c.d.ts] Inode:: 166 +//// [/home/src/projects/c/3/c-impl/c/lib/c.d.ts] Inode:: 167 export declare const c: string; -//// [/home/src/projects/c/3/c-impl/c/lib/index.js] Inode:: 167 +//// [/home/src/projects/c/3/c-impl/c/lib/index.js] Inode:: 168 "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; @@ -2434,14 +2434,14 @@ Object.defineProperty(exports, "__esModule", { value: true }); __exportStar(require("./c"), exports); -//// [/home/src/projects/c/3/c-impl/c/lib/index.d.ts] Inode:: 168 +//// [/home/src/projects/c/3/c-impl/c/lib/index.d.ts] Inode:: 169 export * from './c'; -//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo] Inode:: 169 +//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo] Inode:: 170 {"root":["../src/c.ts","../src/index.ts"],"version":"FakeTSVersion"} -//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 170 +//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 171 { "root": [ "../src/c.ts", @@ -2451,18 +2451,18 @@ export * from './c'; "size": 68 } -//// [/home/src/projects/a/1/a-impl/a/lib/a.js] Inode:: 172 +//// [/home/src/projects/a/1/a-impl/a/lib/a.js] Inode:: 173 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.a = void 0; exports.a = 'test'; -//// [/home/src/projects/a/1/a-impl/a/lib/a.d.ts] Inode:: 173 +//// [/home/src/projects/a/1/a-impl/a/lib/a.d.ts] Inode:: 174 export declare const a: string; -//// [/home/src/projects/a/1/a-impl/a/lib/index.js] Inode:: 174 +//// [/home/src/projects/a/1/a-impl/a/lib/index.js] Inode:: 175 "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; @@ -2483,15 +2483,15 @@ __exportStar(require("./a"), exports); __exportStar(require("c"), exports); -//// [/home/src/projects/a/1/a-impl/a/lib/index.d.ts] Inode:: 175 +//// [/home/src/projects/a/1/a-impl/a/lib/index.d.ts] Inode:: 176 export * from './a'; export * from 'c'; -//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo] Inode:: 176 +//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo] Inode:: 177 {"root":["../src/a.ts","../src/index.ts"],"version":"FakeTSVersion"} -//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 177 +//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 178 { "root": [ "../src/a.ts", diff --git a/tests/baselines/reference/tsserver/symLinks/packages-outside-project-folder-Linux.js b/tests/baselines/reference/tsserver/symLinks/packages-outside-project-folder-Linux.js index 1c42da9dbfb57..75073a5a68442 100644 --- a/tests/baselines/reference/tsserver/symLinks/packages-outside-project-folder-Linux.js +++ b/tests/baselines/reference/tsserver/symLinks/packages-outside-project-folder-Linux.js @@ -443,7 +443,7 @@ After running Immedidate callback:: count: 0 change in unrelated folder in a Before running Timeout callback:: count: 0 -//// [/home/src/projects/a/2/unrelated/somethingUnrelated.ts] Inode:: 146 +//// [/home/src/projects/a/2/unrelated/somethingUnrelated.ts] Inode:: 147 export const a = 10; @@ -573,7 +573,7 @@ After running Immedidate callback:: count: 0 change in unrelated folder in c Before running Timeout callback:: count: 0 -//// [/home/src/projects/c/4/unrelated/somethingUnrelated.ts] Inode:: 147 +//// [/home/src/projects/c/4/unrelated/somethingUnrelated.ts] Inode:: 148 export const a = 10; @@ -704,18 +704,18 @@ After running Immedidate callback:: count: 0 Build dependencies Before running Timeout callback:: count: 1 5: timerToUpdateChildWatches -//// [/home/src/projects/c/3/c-impl/c/lib/c.js] Inode:: 149 +//// [/home/src/projects/c/3/c-impl/c/lib/c.js] Inode:: 150 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.c = void 0; exports.c = 'test'; -//// [/home/src/projects/c/3/c-impl/c/lib/c.d.ts] Inode:: 150 +//// [/home/src/projects/c/3/c-impl/c/lib/c.d.ts] Inode:: 151 export declare const c: string; -//// [/home/src/projects/c/3/c-impl/c/lib/index.js] Inode:: 151 +//// [/home/src/projects/c/3/c-impl/c/lib/index.js] Inode:: 152 "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; @@ -735,14 +735,14 @@ Object.defineProperty(exports, "__esModule", { value: true }); __exportStar(require("./c"), exports); -//// [/home/src/projects/c/3/c-impl/c/lib/index.d.ts] Inode:: 152 +//// [/home/src/projects/c/3/c-impl/c/lib/index.d.ts] Inode:: 153 export * from './c'; -//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo] Inode:: 153 +//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo] Inode:: 154 {"root":["../src/c.ts","../src/index.ts"],"version":"FakeTSVersion"} -//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 154 +//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 155 { "root": [ "../src/c.ts", @@ -752,18 +752,18 @@ export * from './c'; "size": 68 } -//// [/home/src/projects/a/1/a-impl/a/lib/a.js] Inode:: 156 +//// [/home/src/projects/a/1/a-impl/a/lib/a.js] Inode:: 157 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.a = void 0; exports.a = 'test'; -//// [/home/src/projects/a/1/a-impl/a/lib/a.d.ts] Inode:: 157 +//// [/home/src/projects/a/1/a-impl/a/lib/a.d.ts] Inode:: 158 export declare const a: string; -//// [/home/src/projects/a/1/a-impl/a/lib/index.js] Inode:: 158 +//// [/home/src/projects/a/1/a-impl/a/lib/index.js] Inode:: 159 "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; @@ -784,15 +784,15 @@ __exportStar(require("./a"), exports); __exportStar(require("c"), exports); -//// [/home/src/projects/a/1/a-impl/a/lib/index.d.ts] Inode:: 159 +//// [/home/src/projects/a/1/a-impl/a/lib/index.d.ts] Inode:: 160 export * from './a'; export * from 'c'; -//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo] Inode:: 160 +//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo] Inode:: 161 {"root":["../src/a.ts","../src/index.ts"],"version":"FakeTSVersion"} -//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 161 +//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 162 { "root": [ "../src/a.ts", @@ -840,7 +840,7 @@ FsWatches:: /home/src/projects/a/1/a-impl/a: {"inode":19} /home/src/projects/a/1/a-impl/a/lib: *new* - {"inode":155} + {"inode":156} /home/src/projects/a/1/a-impl/a/node_modules: {"inode":25} /home/src/projects/a/1/a-impl/a/package.json: @@ -1001,11 +1001,11 @@ FsWatches:: /home/src/projects: {"inode":3} /home/src/projects/a/1/a-impl/a/lib: - {"inode":155} + {"inode":156} /home/src/projects/a/1/a-impl/a/lib/a.d.ts: *new* - {"inode":157} + {"inode":158} /home/src/projects/a/1/a-impl/a/lib/index.d.ts: *new* - {"inode":159} + {"inode":160} /home/src/projects/a/1/a-impl/a/node_modules: {"inode":25} /home/src/projects/a/1/a-impl/a/package.json: @@ -1025,11 +1025,11 @@ FsWatches:: /home/src/projects/b/2/b-impl/b/tsconfig.json: {"inode":36} /home/src/projects/c/3/c-impl/c/lib: *new* - {"inode":148} + {"inode":149} /home/src/projects/c/3/c-impl/c/lib/c.d.ts: *new* - {"inode":150} + {"inode":151} /home/src/projects/c/3/c-impl/c/lib/index.d.ts: *new* - {"inode":152} + {"inode":153} /home/src/projects/c/3/c-impl/c/package.json: *new* {"inode":12} /home/src/tslibs/TS/Lib/lib.d.ts: @@ -1182,7 +1182,7 @@ After running Immedidate callback:: count: 0 change in unrelated folder in a Before running Timeout callback:: count: 0 -//// [/home/src/projects/a/2/unrelated/anotherFile.ts] Inode:: 162 +//// [/home/src/projects/a/2/unrelated/anotherFile.ts] Inode:: 163 export const a = 10; @@ -1298,7 +1298,7 @@ After running Immedidate callback:: count: 0 change in unrelated folder in c Before running Timeout callback:: count: 0 -//// [/home/src/projects/c/4/unrelated/anotherFile.ts] Inode:: 163 +//// [/home/src/projects/c/4/unrelated/anotherFile.ts] Inode:: 164 export const a = 10; @@ -1542,17 +1542,17 @@ FsWatches:: FsWatches *deleted*:: /home/src/projects/a/1/a-impl/a/lib: - {"inode":155} + {"inode":156} /home/src/projects/a/1/a-impl/a/lib/a.d.ts: - {"inode":157} + {"inode":158} /home/src/projects/a/1/a-impl/a/lib/index.d.ts: - {"inode":159} + {"inode":160} /home/src/projects/c/3/c-impl/c/lib: - {"inode":148} + {"inode":149} /home/src/projects/c/3/c-impl/c/lib/c.d.ts: - {"inode":150} + {"inode":151} /home/src/projects/c/3/c-impl/c/lib/index.d.ts: - {"inode":152} + {"inode":153} Timeout callback:: count: 3 28: /home/src/projects/b/2/b-impl/b/tsconfig.json *new* @@ -1888,18 +1888,18 @@ Info seq [hh:mm:ss:mss] FileWatcher:: Triggered with /home/src/projects/a/1/a-i Info seq [hh:mm:ss:mss] Elapsed:: *ms FileWatcher:: Triggered with /home/src/projects/a/1/a-impl/a/lib/index.d.ts 0:: WatchInfo: /home/src/projects/a/1/a-impl/a/lib/index.d.ts 500 undefined WatchType: Closed Script info Before running Timeout callback:: count: 1 37: timerToUpdateChildWatches -//// [/home/src/projects/c/3/c-impl/c/lib/c.js] Inode:: 165 +//// [/home/src/projects/c/3/c-impl/c/lib/c.js] Inode:: 166 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.c = void 0; exports.c = 'test'; -//// [/home/src/projects/c/3/c-impl/c/lib/c.d.ts] Inode:: 166 +//// [/home/src/projects/c/3/c-impl/c/lib/c.d.ts] Inode:: 167 export declare const c: string; -//// [/home/src/projects/c/3/c-impl/c/lib/index.js] Inode:: 167 +//// [/home/src/projects/c/3/c-impl/c/lib/index.js] Inode:: 168 "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; @@ -1919,14 +1919,14 @@ Object.defineProperty(exports, "__esModule", { value: true }); __exportStar(require("./c"), exports); -//// [/home/src/projects/c/3/c-impl/c/lib/index.d.ts] Inode:: 168 +//// [/home/src/projects/c/3/c-impl/c/lib/index.d.ts] Inode:: 169 export * from './c'; -//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo] Inode:: 169 +//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo] Inode:: 170 {"root":["../src/c.ts","../src/index.ts"],"version":"FakeTSVersion"} -//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 170 +//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 171 { "root": [ "../src/c.ts", @@ -1936,18 +1936,18 @@ export * from './c'; "size": 68 } -//// [/home/src/projects/a/1/a-impl/a/lib/a.js] Inode:: 172 +//// [/home/src/projects/a/1/a-impl/a/lib/a.js] Inode:: 173 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.a = void 0; exports.a = 'test'; -//// [/home/src/projects/a/1/a-impl/a/lib/a.d.ts] Inode:: 173 +//// [/home/src/projects/a/1/a-impl/a/lib/a.d.ts] Inode:: 174 export declare const a: string; -//// [/home/src/projects/a/1/a-impl/a/lib/index.js] Inode:: 174 +//// [/home/src/projects/a/1/a-impl/a/lib/index.js] Inode:: 175 "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; @@ -1968,15 +1968,15 @@ __exportStar(require("./a"), exports); __exportStar(require("c"), exports); -//// [/home/src/projects/a/1/a-impl/a/lib/index.d.ts] Inode:: 175 +//// [/home/src/projects/a/1/a-impl/a/lib/index.d.ts] Inode:: 176 export * from './a'; export * from 'c'; -//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo] Inode:: 176 +//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo] Inode:: 177 {"root":["../src/a.ts","../src/index.ts"],"version":"FakeTSVersion"} -//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 177 +//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 178 { "root": [ "../src/a.ts", @@ -2023,9 +2023,9 @@ FsWatches:: /home/src/projects/a/1/a-impl/a: {"inode":19} /home/src/projects/a/1/a-impl/a/lib/a.d.ts: *new* - {"inode":173} + {"inode":174} /home/src/projects/a/1/a-impl/a/lib/index.d.ts: *new* - {"inode":175} + {"inode":176} /home/src/projects/a/1/a-impl/a/node_modules: {"inode":25} /home/src/projects/a/1/a-impl/a/package.json: @@ -2049,9 +2049,9 @@ FsWatches:: /home/src/projects/b/2/b-impl/b/tsconfig.json: {"inode":36} /home/src/projects/c/3/c-impl/c/lib/c.d.ts: *new* - {"inode":166} + {"inode":167} /home/src/projects/c/3/c-impl/c/lib/index.d.ts: *new* - {"inode":168} + {"inode":169} /home/src/tslibs/TS/Lib/lib.d.ts: {"inode":45} @@ -2122,11 +2122,11 @@ FsWatches:: /home/src/projects/a/1/a-impl/a: {"inode":19} /home/src/projects/a/1/a-impl/a/lib: *new* - {"inode":171} + {"inode":172} /home/src/projects/a/1/a-impl/a/lib/a.d.ts: - {"inode":173} + {"inode":174} /home/src/projects/a/1/a-impl/a/lib/index.d.ts: - {"inode":175} + {"inode":176} /home/src/projects/a/1/a-impl/a/node_modules: {"inode":25} /home/src/projects/a/1/a-impl/a/package.json: @@ -2150,9 +2150,9 @@ FsWatches:: /home/src/projects/b/2/b-impl/b/tsconfig.json: {"inode":36} /home/src/projects/c/3/c-impl/c/lib/c.d.ts: - {"inode":166} + {"inode":167} /home/src/projects/c/3/c-impl/c/lib/index.d.ts: - {"inode":168} + {"inode":169} /home/src/tslibs/TS/Lib/lib.d.ts: {"inode":45} @@ -2286,11 +2286,11 @@ FsWatches:: /home/src/projects: {"inode":3} /home/src/projects/a/1/a-impl/a/lib: - {"inode":171} + {"inode":172} /home/src/projects/a/1/a-impl/a/lib/a.d.ts: - {"inode":173} + {"inode":174} /home/src/projects/a/1/a-impl/a/lib/index.d.ts: - {"inode":175} + {"inode":176} /home/src/projects/a/1/a-impl/a/node_modules: {"inode":25} /home/src/projects/a/1/a-impl/a/package.json: @@ -2310,11 +2310,11 @@ FsWatches:: /home/src/projects/b/2/b-impl/b/tsconfig.json: {"inode":36} /home/src/projects/c/3/c-impl/c/lib: *new* - {"inode":164} + {"inode":165} /home/src/projects/c/3/c-impl/c/lib/c.d.ts: - {"inode":166} + {"inode":167} /home/src/projects/c/3/c-impl/c/lib/index.d.ts: - {"inode":168} + {"inode":169} /home/src/projects/c/3/c-impl/c/package.json: *new* {"inode":12} /home/src/tslibs/TS/Lib/lib.d.ts: diff --git a/tests/baselines/reference/tsserver/symLinks/packages-outside-project-folder-MacOs-canUseWatchEvents.js b/tests/baselines/reference/tsserver/symLinks/packages-outside-project-folder-MacOs-canUseWatchEvents.js index 5a4e918921212..cb6f35a4b0a73 100644 --- a/tests/baselines/reference/tsserver/symLinks/packages-outside-project-folder-MacOs-canUseWatchEvents.js +++ b/tests/baselines/reference/tsserver/symLinks/packages-outside-project-folder-MacOs-canUseWatchEvents.js @@ -688,7 +688,7 @@ After running Immedidate callback:: count: 0 change in unrelated folder in a Before running Timeout callback:: count: 0 -//// [/home/src/projects/a/2/unrelated/somethingUnrelated.ts] Inode:: 146 +//// [/home/src/projects/a/2/unrelated/somethingUnrelated.ts] Inode:: 147 export const a = 10; @@ -818,7 +818,7 @@ After running Immedidate callback:: count: 0 change in unrelated folder in c Before running Timeout callback:: count: 0 -//// [/home/src/projects/c/4/unrelated/somethingUnrelated.ts] Inode:: 147 +//// [/home/src/projects/c/4/unrelated/somethingUnrelated.ts] Inode:: 148 export const a = 10; @@ -955,18 +955,18 @@ Custom watchDirectory:: Triggered Ignored:: {"id":9,"path":"/home/src/projects/b Custom watchDirectory:: Triggered Ignored:: {"id":9,"path":"/home/src/projects/b/2/b-impl/b/node_modules/a","recursive":true,"ignoreUpdate":true}:: /home/src/projects/b/2/b-impl/b/node_modules/a/lib/tsconfig.tsbuildinfo created Custom watchDirectory:: Triggered Ignored:: {"id":9,"path":"/home/src/projects/b/2/b-impl/b/node_modules/a","recursive":true,"ignoreUpdate":true}:: /home/src/projects/b/2/b-impl/b/node_modules/a/lib/tsconfig.tsbuildinfo.readable.baseline.txt created Before request -//// [/home/src/projects/c/3/c-impl/c/lib/c.js] Inode:: 149 +//// [/home/src/projects/c/3/c-impl/c/lib/c.js] Inode:: 150 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.c = void 0; exports.c = 'test'; -//// [/home/src/projects/c/3/c-impl/c/lib/c.d.ts] Inode:: 150 +//// [/home/src/projects/c/3/c-impl/c/lib/c.d.ts] Inode:: 151 export declare const c: string; -//// [/home/src/projects/c/3/c-impl/c/lib/index.js] Inode:: 151 +//// [/home/src/projects/c/3/c-impl/c/lib/index.js] Inode:: 152 "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; @@ -986,14 +986,14 @@ Object.defineProperty(exports, "__esModule", { value: true }); __exportStar(require("./c"), exports); -//// [/home/src/projects/c/3/c-impl/c/lib/index.d.ts] Inode:: 152 +//// [/home/src/projects/c/3/c-impl/c/lib/index.d.ts] Inode:: 153 export * from './c'; -//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo] Inode:: 153 +//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo] Inode:: 154 {"root":["../src/c.ts","../src/index.ts"],"version":"FakeTSVersion"} -//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 154 +//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 155 { "root": [ "../src/c.ts", @@ -1003,18 +1003,18 @@ export * from './c'; "size": 68 } -//// [/home/src/projects/a/1/a-impl/a/lib/a.js] Inode:: 156 +//// [/home/src/projects/a/1/a-impl/a/lib/a.js] Inode:: 157 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.a = void 0; exports.a = 'test'; -//// [/home/src/projects/a/1/a-impl/a/lib/a.d.ts] Inode:: 157 +//// [/home/src/projects/a/1/a-impl/a/lib/a.d.ts] Inode:: 158 export declare const a: string; -//// [/home/src/projects/a/1/a-impl/a/lib/index.js] Inode:: 158 +//// [/home/src/projects/a/1/a-impl/a/lib/index.js] Inode:: 159 "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; @@ -1035,15 +1035,15 @@ __exportStar(require("./a"), exports); __exportStar(require("c"), exports); -//// [/home/src/projects/a/1/a-impl/a/lib/index.d.ts] Inode:: 159 +//// [/home/src/projects/a/1/a-impl/a/lib/index.d.ts] Inode:: 160 export * from './a'; export * from 'c'; -//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo] Inode:: 160 +//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo] Inode:: 161 {"root":["../src/a.ts","../src/index.ts"],"version":"FakeTSVersion"} -//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 161 +//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 162 { "root": [ "../src/a.ts", @@ -1566,7 +1566,7 @@ After running Immedidate callback:: count: 0 change in unrelated folder in a Before running Timeout callback:: count: 0 -//// [/home/src/projects/a/2/unrelated/anotherFile.ts] Inode:: 162 +//// [/home/src/projects/a/2/unrelated/anotherFile.ts] Inode:: 163 export const a = 10; @@ -1682,7 +1682,7 @@ After running Immedidate callback:: count: 0 change in unrelated folder in c Before running Timeout callback:: count: 0 -//// [/home/src/projects/c/4/unrelated/anotherFile.ts] Inode:: 163 +//// [/home/src/projects/c/4/unrelated/anotherFile.ts] Inode:: 164 export const a = 10; @@ -2377,18 +2377,18 @@ Custom watchDirectory:: Triggered Ignored:: {"id":30,"path":"/home/src/projects/ Custom watchDirectory:: Triggered Ignored:: {"id":30,"path":"/home/src/projects/b/2/b-impl/b/node_modules/a","recursive":true,"ignoreUpdate":true}:: /home/src/projects/b/2/b-impl/b/node_modules/a/lib/tsconfig.tsbuildinfo created Custom watchDirectory:: Triggered Ignored:: {"id":30,"path":"/home/src/projects/b/2/b-impl/b/node_modules/a","recursive":true,"ignoreUpdate":true}:: /home/src/projects/b/2/b-impl/b/node_modules/a/lib/tsconfig.tsbuildinfo.readable.baseline.txt created Before request -//// [/home/src/projects/c/3/c-impl/c/lib/c.js] Inode:: 165 +//// [/home/src/projects/c/3/c-impl/c/lib/c.js] Inode:: 166 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.c = void 0; exports.c = 'test'; -//// [/home/src/projects/c/3/c-impl/c/lib/c.d.ts] Inode:: 166 +//// [/home/src/projects/c/3/c-impl/c/lib/c.d.ts] Inode:: 167 export declare const c: string; -//// [/home/src/projects/c/3/c-impl/c/lib/index.js] Inode:: 167 +//// [/home/src/projects/c/3/c-impl/c/lib/index.js] Inode:: 168 "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; @@ -2408,14 +2408,14 @@ Object.defineProperty(exports, "__esModule", { value: true }); __exportStar(require("./c"), exports); -//// [/home/src/projects/c/3/c-impl/c/lib/index.d.ts] Inode:: 168 +//// [/home/src/projects/c/3/c-impl/c/lib/index.d.ts] Inode:: 169 export * from './c'; -//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo] Inode:: 169 +//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo] Inode:: 170 {"root":["../src/c.ts","../src/index.ts"],"version":"FakeTSVersion"} -//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 170 +//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 171 { "root": [ "../src/c.ts", @@ -2425,18 +2425,18 @@ export * from './c'; "size": 68 } -//// [/home/src/projects/a/1/a-impl/a/lib/a.js] Inode:: 172 +//// [/home/src/projects/a/1/a-impl/a/lib/a.js] Inode:: 173 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.a = void 0; exports.a = 'test'; -//// [/home/src/projects/a/1/a-impl/a/lib/a.d.ts] Inode:: 173 +//// [/home/src/projects/a/1/a-impl/a/lib/a.d.ts] Inode:: 174 export declare const a: string; -//// [/home/src/projects/a/1/a-impl/a/lib/index.js] Inode:: 174 +//// [/home/src/projects/a/1/a-impl/a/lib/index.js] Inode:: 175 "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; @@ -2457,15 +2457,15 @@ __exportStar(require("./a"), exports); __exportStar(require("c"), exports); -//// [/home/src/projects/a/1/a-impl/a/lib/index.d.ts] Inode:: 175 +//// [/home/src/projects/a/1/a-impl/a/lib/index.d.ts] Inode:: 176 export * from './a'; export * from 'c'; -//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo] Inode:: 176 +//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo] Inode:: 177 {"root":["../src/a.ts","../src/index.ts"],"version":"FakeTSVersion"} -//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 177 +//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 178 { "root": [ "../src/a.ts", diff --git a/tests/baselines/reference/tsserver/symLinks/packages-outside-project-folder-MacOs.js b/tests/baselines/reference/tsserver/symLinks/packages-outside-project-folder-MacOs.js index e8af2d175ad79..aed62e132d867 100644 --- a/tests/baselines/reference/tsserver/symLinks/packages-outside-project-folder-MacOs.js +++ b/tests/baselines/reference/tsserver/symLinks/packages-outside-project-folder-MacOs.js @@ -439,7 +439,7 @@ After running Immedidate callback:: count: 0 change in unrelated folder in a Before running Timeout callback:: count: 0 -//// [/home/src/projects/a/2/unrelated/somethingUnrelated.ts] Inode:: 146 +//// [/home/src/projects/a/2/unrelated/somethingUnrelated.ts] Inode:: 147 export const a = 10; @@ -569,7 +569,7 @@ After running Immedidate callback:: count: 0 change in unrelated folder in c Before running Timeout callback:: count: 0 -//// [/home/src/projects/c/4/unrelated/somethingUnrelated.ts] Inode:: 147 +//// [/home/src/projects/c/4/unrelated/somethingUnrelated.ts] Inode:: 148 export const a = 10; @@ -721,18 +721,18 @@ Info seq [hh:mm:ss:mss] Scheduled: /home/src/projects/b/2/b-impl/b/tsconfig.jso Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Triggered with /home/src/projects/b/2/b-impl/b/node_modules/a/lib/tsconfig.tsbuildinfo.readable.baseline.txt :: WatchInfo: /home/src/projects/b/2/b-impl/b/node_modules/a 1 undefined Project: /home/src/projects/b/2/b-impl/b/tsconfig.json WatchType: Failed Lookup Locations Before running Timeout callback:: count: 1 10: /home/src/projects/b/2/b-impl/b/tsconfig.jsonFailedLookupInvalidation -//// [/home/src/projects/c/3/c-impl/c/lib/c.js] Inode:: 149 +//// [/home/src/projects/c/3/c-impl/c/lib/c.js] Inode:: 150 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.c = void 0; exports.c = 'test'; -//// [/home/src/projects/c/3/c-impl/c/lib/c.d.ts] Inode:: 150 +//// [/home/src/projects/c/3/c-impl/c/lib/c.d.ts] Inode:: 151 export declare const c: string; -//// [/home/src/projects/c/3/c-impl/c/lib/index.js] Inode:: 151 +//// [/home/src/projects/c/3/c-impl/c/lib/index.js] Inode:: 152 "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; @@ -752,14 +752,14 @@ Object.defineProperty(exports, "__esModule", { value: true }); __exportStar(require("./c"), exports); -//// [/home/src/projects/c/3/c-impl/c/lib/index.d.ts] Inode:: 152 +//// [/home/src/projects/c/3/c-impl/c/lib/index.d.ts] Inode:: 153 export * from './c'; -//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo] Inode:: 153 +//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo] Inode:: 154 {"root":["../src/c.ts","../src/index.ts"],"version":"FakeTSVersion"} -//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 154 +//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 155 { "root": [ "../src/c.ts", @@ -769,18 +769,18 @@ export * from './c'; "size": 68 } -//// [/home/src/projects/a/1/a-impl/a/lib/a.js] Inode:: 156 +//// [/home/src/projects/a/1/a-impl/a/lib/a.js] Inode:: 157 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.a = void 0; exports.a = 'test'; -//// [/home/src/projects/a/1/a-impl/a/lib/a.d.ts] Inode:: 157 +//// [/home/src/projects/a/1/a-impl/a/lib/a.d.ts] Inode:: 158 export declare const a: string; -//// [/home/src/projects/a/1/a-impl/a/lib/index.js] Inode:: 158 +//// [/home/src/projects/a/1/a-impl/a/lib/index.js] Inode:: 159 "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; @@ -801,15 +801,15 @@ __exportStar(require("./a"), exports); __exportStar(require("c"), exports); -//// [/home/src/projects/a/1/a-impl/a/lib/index.d.ts] Inode:: 159 +//// [/home/src/projects/a/1/a-impl/a/lib/index.d.ts] Inode:: 160 export * from './a'; export * from 'c'; -//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo] Inode:: 160 +//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo] Inode:: 161 {"root":["../src/a.ts","../src/index.ts"],"version":"FakeTSVersion"} -//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 161 +//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 162 { "root": [ "../src/a.ts", @@ -952,9 +952,9 @@ FsWatches:: /home/src/projects: {"inode":3} /home/src/projects/a/1/a-impl/a/lib/a.d.ts: *new* - {"inode":157} + {"inode":158} /home/src/projects/a/1/a-impl/a/lib/index.d.ts: *new* - {"inode":159} + {"inode":160} /home/src/projects/a/1/a-impl/a/package.json: {"inode":24} /home/src/projects/b: @@ -968,9 +968,9 @@ FsWatches:: /home/src/projects/b/2/b-impl/b/tsconfig.json: {"inode":36} /home/src/projects/c/3/c-impl/c/lib/c.d.ts: *new* - {"inode":150} + {"inode":151} /home/src/projects/c/3/c-impl/c/lib/index.d.ts: *new* - {"inode":152} + {"inode":153} /home/src/projects/c/3/c-impl/c/package.json: *new* {"inode":12} /home/src/tslibs/TS/Lib/lib.d.ts: @@ -1139,7 +1139,7 @@ Info seq [hh:mm:ss:mss] Scheduled: /home/src/projects/b/2/b-impl/b/tsconfig.jso Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Triggered with /home/src/projects/a/2/unrelated/anotherFile.ts :: WatchInfo: /home/src/projects/a 1 undefined Project: /home/src/projects/b/2/b-impl/b/tsconfig.json WatchType: Failed Lookup Locations Before running Timeout callback:: count: 1 14: /home/src/projects/b/2/b-impl/b/tsconfig.jsonFailedLookupInvalidation -//// [/home/src/projects/a/2/unrelated/anotherFile.ts] Inode:: 162 +//// [/home/src/projects/a/2/unrelated/anotherFile.ts] Inode:: 163 export const a = 10; @@ -1263,7 +1263,7 @@ Info seq [hh:mm:ss:mss] Scheduled: /home/src/projects/b/2/b-impl/b/tsconfig.jso Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Triggered with /home/src/projects/c/4/unrelated/anotherFile.ts :: WatchInfo: /home/src/projects/c 1 undefined Project: /home/src/projects/b/2/b-impl/b/tsconfig.json WatchType: Failed Lookup Locations Before running Timeout callback:: count: 1 16: /home/src/projects/b/2/b-impl/b/tsconfig.jsonFailedLookupInvalidation -//// [/home/src/projects/c/4/unrelated/anotherFile.ts] Inode:: 163 +//// [/home/src/projects/c/4/unrelated/anotherFile.ts] Inode:: 164 export const a = 10; @@ -1501,13 +1501,13 @@ FsWatches:: FsWatches *deleted*:: /home/src/projects/a/1/a-impl/a/lib/a.d.ts: - {"inode":157} + {"inode":158} /home/src/projects/a/1/a-impl/a/lib/index.d.ts: - {"inode":159} + {"inode":160} /home/src/projects/c/3/c-impl/c/lib/c.d.ts: - {"inode":150} + {"inode":151} /home/src/projects/c/3/c-impl/c/lib/index.d.ts: - {"inode":152} + {"inode":153} FsWatchesRecursive:: /home/src/projects/a: @@ -1876,18 +1876,18 @@ Info seq [hh:mm:ss:mss] Scheduled: /home/src/projects/b/2/b-impl/b/tsconfig.jso Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Triggered with /home/src/projects/b/2/b-impl/b/node_modules/a/lib/tsconfig.tsbuildinfo.readable.baseline.txt :: WatchInfo: /home/src/projects/b/2/b-impl/b/node_modules/a 1 undefined Project: /home/src/projects/b/2/b-impl/b/tsconfig.json WatchType: Failed Lookup Locations Before running Timeout callback:: count: 1 47: /home/src/projects/b/2/b-impl/b/tsconfig.jsonFailedLookupInvalidation -//// [/home/src/projects/c/3/c-impl/c/lib/c.js] Inode:: 165 +//// [/home/src/projects/c/3/c-impl/c/lib/c.js] Inode:: 166 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.c = void 0; exports.c = 'test'; -//// [/home/src/projects/c/3/c-impl/c/lib/c.d.ts] Inode:: 166 +//// [/home/src/projects/c/3/c-impl/c/lib/c.d.ts] Inode:: 167 export declare const c: string; -//// [/home/src/projects/c/3/c-impl/c/lib/index.js] Inode:: 167 +//// [/home/src/projects/c/3/c-impl/c/lib/index.js] Inode:: 168 "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; @@ -1907,14 +1907,14 @@ Object.defineProperty(exports, "__esModule", { value: true }); __exportStar(require("./c"), exports); -//// [/home/src/projects/c/3/c-impl/c/lib/index.d.ts] Inode:: 168 +//// [/home/src/projects/c/3/c-impl/c/lib/index.d.ts] Inode:: 169 export * from './c'; -//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo] Inode:: 169 +//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo] Inode:: 170 {"root":["../src/c.ts","../src/index.ts"],"version":"FakeTSVersion"} -//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 170 +//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 171 { "root": [ "../src/c.ts", @@ -1924,18 +1924,18 @@ export * from './c'; "size": 68 } -//// [/home/src/projects/a/1/a-impl/a/lib/a.js] Inode:: 172 +//// [/home/src/projects/a/1/a-impl/a/lib/a.js] Inode:: 173 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.a = void 0; exports.a = 'test'; -//// [/home/src/projects/a/1/a-impl/a/lib/a.d.ts] Inode:: 173 +//// [/home/src/projects/a/1/a-impl/a/lib/a.d.ts] Inode:: 174 export declare const a: string; -//// [/home/src/projects/a/1/a-impl/a/lib/index.js] Inode:: 174 +//// [/home/src/projects/a/1/a-impl/a/lib/index.js] Inode:: 175 "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; @@ -1956,15 +1956,15 @@ __exportStar(require("./a"), exports); __exportStar(require("c"), exports); -//// [/home/src/projects/a/1/a-impl/a/lib/index.d.ts] Inode:: 175 +//// [/home/src/projects/a/1/a-impl/a/lib/index.d.ts] Inode:: 176 export * from './a'; export * from 'c'; -//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo] Inode:: 176 +//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo] Inode:: 177 {"root":["../src/a.ts","../src/index.ts"],"version":"FakeTSVersion"} -//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 177 +//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 178 { "root": [ "../src/a.ts", @@ -2009,9 +2009,9 @@ FsWatches:: /home/src/projects: {"inode":3} /home/src/projects/a/1/a-impl/a/lib/a.d.ts: *new* - {"inode":173} + {"inode":174} /home/src/projects/a/1/a-impl/a/lib/index.d.ts: *new* - {"inode":175} + {"inode":176} /home/src/projects/a/1/a-impl/a/package.json: {"inode":24} /home/src/projects/b: @@ -2025,9 +2025,9 @@ FsWatches:: /home/src/projects/b/2/b-impl/b/tsconfig.json: {"inode":36} /home/src/projects/c/3/c-impl/c/lib/c.d.ts: *new* - {"inode":166} + {"inode":167} /home/src/projects/c/3/c-impl/c/lib/index.d.ts: *new* - {"inode":168} + {"inode":169} /home/src/tslibs/TS/Lib/lib.d.ts: {"inode":45} @@ -2196,9 +2196,9 @@ FsWatches:: /home/src/projects: {"inode":3} /home/src/projects/a/1/a-impl/a/lib/a.d.ts: - {"inode":173} + {"inode":174} /home/src/projects/a/1/a-impl/a/lib/index.d.ts: - {"inode":175} + {"inode":176} /home/src/projects/a/1/a-impl/a/package.json: {"inode":24} /home/src/projects/b: @@ -2212,9 +2212,9 @@ FsWatches:: /home/src/projects/b/2/b-impl/b/tsconfig.json: {"inode":36} /home/src/projects/c/3/c-impl/c/lib/c.d.ts: - {"inode":166} + {"inode":167} /home/src/projects/c/3/c-impl/c/lib/index.d.ts: - {"inode":168} + {"inode":169} /home/src/projects/c/3/c-impl/c/package.json: *new* {"inode":12} /home/src/tslibs/TS/Lib/lib.d.ts: diff --git a/tests/baselines/reference/tsserver/symLinks/packages-outside-project-folder-built-Linux-canUseWatchEvents.js b/tests/baselines/reference/tsserver/symLinks/packages-outside-project-folder-built-Linux-canUseWatchEvents.js index 7c86d75d0a3ea..78de0838b7d59 100644 --- a/tests/baselines/reference/tsserver/symLinks/packages-outside-project-folder-built-Linux-canUseWatchEvents.js +++ b/tests/baselines/reference/tsserver/symLinks/packages-outside-project-folder-built-Linux-canUseWatchEvents.js @@ -90,18 +90,18 @@ interface Array { length: number; [n: number]: T; } interface ReadonlyArray {} declare const console: { log(msg: any): void; }; -//// [/home/src/projects/c/3/c-impl/c/lib/c.js] Inode:: 147 +//// [/home/src/projects/c/3/c-impl/c/lib/c.js] Inode:: 148 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.c = void 0; exports.c = 'test'; -//// [/home/src/projects/c/3/c-impl/c/lib/c.d.ts] Inode:: 148 +//// [/home/src/projects/c/3/c-impl/c/lib/c.d.ts] Inode:: 149 export declare const c: string; -//// [/home/src/projects/c/3/c-impl/c/lib/index.js] Inode:: 149 +//// [/home/src/projects/c/3/c-impl/c/lib/index.js] Inode:: 150 "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; @@ -121,14 +121,14 @@ Object.defineProperty(exports, "__esModule", { value: true }); __exportStar(require("./c"), exports); -//// [/home/src/projects/c/3/c-impl/c/lib/index.d.ts] Inode:: 150 +//// [/home/src/projects/c/3/c-impl/c/lib/index.d.ts] Inode:: 151 export * from './c'; -//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo] Inode:: 151 +//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo] Inode:: 152 {"root":["../src/c.ts","../src/index.ts"],"version":"FakeTSVersion"} -//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 152 +//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 153 { "root": [ "../src/c.ts", @@ -138,18 +138,18 @@ export * from './c'; "size": 68 } -//// [/home/src/projects/a/1/a-impl/a/lib/a.js] Inode:: 154 +//// [/home/src/projects/a/1/a-impl/a/lib/a.js] Inode:: 155 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.a = void 0; exports.a = 'test'; -//// [/home/src/projects/a/1/a-impl/a/lib/a.d.ts] Inode:: 155 +//// [/home/src/projects/a/1/a-impl/a/lib/a.d.ts] Inode:: 156 export declare const a: string; -//// [/home/src/projects/a/1/a-impl/a/lib/index.js] Inode:: 156 +//// [/home/src/projects/a/1/a-impl/a/lib/index.js] Inode:: 157 "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; @@ -170,15 +170,15 @@ __exportStar(require("./a"), exports); __exportStar(require("c"), exports); -//// [/home/src/projects/a/1/a-impl/a/lib/index.d.ts] Inode:: 157 +//// [/home/src/projects/a/1/a-impl/a/lib/index.d.ts] Inode:: 158 export * from './a'; export * from 'c'; -//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo] Inode:: 158 +//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo] Inode:: 159 {"root":["../src/a.ts","../src/index.ts"],"version":"FakeTSVersion"} -//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 159 +//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 160 { "root": [ "../src/a.ts", @@ -855,7 +855,7 @@ After running Immedidate callback:: count: 0 change in unrelated folder in a Before running Timeout callback:: count: 0 -//// [/home/src/projects/a/2/unrelated/somethingUnrelated.ts] Inode:: 160 +//// [/home/src/projects/a/2/unrelated/somethingUnrelated.ts] Inode:: 161 export const a = 10; @@ -971,7 +971,7 @@ After running Immedidate callback:: count: 0 change in unrelated folder in c Before running Timeout callback:: count: 0 -//// [/home/src/projects/c/4/unrelated/somethingUnrelated.ts] Inode:: 161 +//// [/home/src/projects/c/4/unrelated/somethingUnrelated.ts] Inode:: 162 export const a = 10; @@ -1087,7 +1087,7 @@ After running Immedidate callback:: count: 0 change in unrelated folder in a Before running Timeout callback:: count: 0 -//// [/home/src/projects/a/2/unrelated/anotherFile.ts] Inode:: 162 +//// [/home/src/projects/a/2/unrelated/anotherFile.ts] Inode:: 163 export const a = 10; @@ -1203,7 +1203,7 @@ After running Immedidate callback:: count: 0 change in unrelated folder in c Before running Timeout callback:: count: 0 -//// [/home/src/projects/c/4/unrelated/anotherFile.ts] Inode:: 163 +//// [/home/src/projects/c/4/unrelated/anotherFile.ts] Inode:: 164 export const a = 10; @@ -1913,18 +1913,18 @@ Custom watchDirectory:: Triggered Ignored:: {"id":25,"path":"/home/src/projects/ Custom watchDirectory:: Triggered Ignored:: {"id":25,"path":"/home/src/projects/b/2/b-impl/b/node_modules/a","recursive":true,"ignoreUpdate":true}:: /home/src/projects/b/2/b-impl/b/node_modules/a/lib/tsconfig.tsbuildinfo.readable.baseline.txt updated Custom watchDirectory:: Triggered Ignored:: {"id":25,"path":"/home/src/projects/b/2/b-impl/b/node_modules/a","recursive":true,"ignoreUpdate":true}:: /home/src/projects/b/2/b-impl/b/node_modules/a/lib updated Before request -//// [/home/src/projects/c/3/c-impl/c/lib/c.js] Inode:: 165 +//// [/home/src/projects/c/3/c-impl/c/lib/c.js] Inode:: 166 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.c = void 0; exports.c = 'test'; -//// [/home/src/projects/c/3/c-impl/c/lib/c.d.ts] Inode:: 166 +//// [/home/src/projects/c/3/c-impl/c/lib/c.d.ts] Inode:: 167 export declare const c: string; -//// [/home/src/projects/c/3/c-impl/c/lib/index.js] Inode:: 167 +//// [/home/src/projects/c/3/c-impl/c/lib/index.js] Inode:: 168 "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; @@ -1944,14 +1944,14 @@ Object.defineProperty(exports, "__esModule", { value: true }); __exportStar(require("./c"), exports); -//// [/home/src/projects/c/3/c-impl/c/lib/index.d.ts] Inode:: 168 +//// [/home/src/projects/c/3/c-impl/c/lib/index.d.ts] Inode:: 169 export * from './c'; -//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo] Inode:: 169 +//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo] Inode:: 170 {"root":["../src/c.ts","../src/index.ts"],"version":"FakeTSVersion"} -//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 170 +//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 171 { "root": [ "../src/c.ts", @@ -1961,18 +1961,18 @@ export * from './c'; "size": 68 } -//// [/home/src/projects/a/1/a-impl/a/lib/a.js] Inode:: 172 +//// [/home/src/projects/a/1/a-impl/a/lib/a.js] Inode:: 173 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.a = void 0; exports.a = 'test'; -//// [/home/src/projects/a/1/a-impl/a/lib/a.d.ts] Inode:: 173 +//// [/home/src/projects/a/1/a-impl/a/lib/a.d.ts] Inode:: 174 export declare const a: string; -//// [/home/src/projects/a/1/a-impl/a/lib/index.js] Inode:: 174 +//// [/home/src/projects/a/1/a-impl/a/lib/index.js] Inode:: 175 "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; @@ -1993,15 +1993,15 @@ __exportStar(require("./a"), exports); __exportStar(require("c"), exports); -//// [/home/src/projects/a/1/a-impl/a/lib/index.d.ts] Inode:: 175 +//// [/home/src/projects/a/1/a-impl/a/lib/index.d.ts] Inode:: 176 export * from './a'; export * from 'c'; -//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo] Inode:: 176 +//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo] Inode:: 177 {"root":["../src/a.ts","../src/index.ts"],"version":"FakeTSVersion"} -//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 177 +//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 178 { "root": [ "../src/a.ts", diff --git a/tests/baselines/reference/tsserver/symLinks/packages-outside-project-folder-built-Linux.js b/tests/baselines/reference/tsserver/symLinks/packages-outside-project-folder-built-Linux.js index 83abd941c89bf..aa325373f99b2 100644 --- a/tests/baselines/reference/tsserver/symLinks/packages-outside-project-folder-built-Linux.js +++ b/tests/baselines/reference/tsserver/symLinks/packages-outside-project-folder-built-Linux.js @@ -90,18 +90,18 @@ interface Array { length: number; [n: number]: T; } interface ReadonlyArray {} declare const console: { log(msg: any): void; }; -//// [/home/src/projects/c/3/c-impl/c/lib/c.js] Inode:: 147 +//// [/home/src/projects/c/3/c-impl/c/lib/c.js] Inode:: 148 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.c = void 0; exports.c = 'test'; -//// [/home/src/projects/c/3/c-impl/c/lib/c.d.ts] Inode:: 148 +//// [/home/src/projects/c/3/c-impl/c/lib/c.d.ts] Inode:: 149 export declare const c: string; -//// [/home/src/projects/c/3/c-impl/c/lib/index.js] Inode:: 149 +//// [/home/src/projects/c/3/c-impl/c/lib/index.js] Inode:: 150 "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; @@ -121,14 +121,14 @@ Object.defineProperty(exports, "__esModule", { value: true }); __exportStar(require("./c"), exports); -//// [/home/src/projects/c/3/c-impl/c/lib/index.d.ts] Inode:: 150 +//// [/home/src/projects/c/3/c-impl/c/lib/index.d.ts] Inode:: 151 export * from './c'; -//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo] Inode:: 151 +//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo] Inode:: 152 {"root":["../src/c.ts","../src/index.ts"],"version":"FakeTSVersion"} -//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 152 +//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 153 { "root": [ "../src/c.ts", @@ -138,18 +138,18 @@ export * from './c'; "size": 68 } -//// [/home/src/projects/a/1/a-impl/a/lib/a.js] Inode:: 154 +//// [/home/src/projects/a/1/a-impl/a/lib/a.js] Inode:: 155 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.a = void 0; exports.a = 'test'; -//// [/home/src/projects/a/1/a-impl/a/lib/a.d.ts] Inode:: 155 +//// [/home/src/projects/a/1/a-impl/a/lib/a.d.ts] Inode:: 156 export declare const a: string; -//// [/home/src/projects/a/1/a-impl/a/lib/index.js] Inode:: 156 +//// [/home/src/projects/a/1/a-impl/a/lib/index.js] Inode:: 157 "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; @@ -170,15 +170,15 @@ __exportStar(require("./a"), exports); __exportStar(require("c"), exports); -//// [/home/src/projects/a/1/a-impl/a/lib/index.d.ts] Inode:: 157 +//// [/home/src/projects/a/1/a-impl/a/lib/index.d.ts] Inode:: 158 export * from './a'; export * from 'c'; -//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo] Inode:: 158 +//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo] Inode:: 159 {"root":["../src/a.ts","../src/index.ts"],"version":"FakeTSVersion"} -//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 159 +//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 160 { "root": [ "../src/a.ts", @@ -388,11 +388,11 @@ FsWatches:: /home/src/projects: *new* {"inode":3} /home/src/projects/a/1/a-impl/a/lib: *new* - {"inode":153} + {"inode":154} /home/src/projects/a/1/a-impl/a/lib/a.d.ts: *new* - {"inode":155} + {"inode":156} /home/src/projects/a/1/a-impl/a/lib/index.d.ts: *new* - {"inode":157} + {"inode":158} /home/src/projects/a/1/a-impl/a/node_modules: *new* {"inode":25} /home/src/projects/a/1/a-impl/a/package.json: *new* @@ -412,11 +412,11 @@ FsWatches:: /home/src/projects/b/2/b-impl/b/tsconfig.json: *new* {"inode":36} /home/src/projects/c/3/c-impl/c/lib: *new* - {"inode":146} + {"inode":147} /home/src/projects/c/3/c-impl/c/lib/c.d.ts: *new* - {"inode":148} + {"inode":149} /home/src/projects/c/3/c-impl/c/lib/index.d.ts: *new* - {"inode":150} + {"inode":151} /home/src/projects/c/3/c-impl/c/package.json: *new* {"inode":12} /home/src/tslibs/TS/Lib/lib.d.ts: *new* @@ -560,7 +560,7 @@ After running Immedidate callback:: count: 0 change in unrelated folder in a Before running Timeout callback:: count: 0 -//// [/home/src/projects/a/2/unrelated/somethingUnrelated.ts] Inode:: 160 +//// [/home/src/projects/a/2/unrelated/somethingUnrelated.ts] Inode:: 161 export const a = 10; @@ -676,7 +676,7 @@ After running Immedidate callback:: count: 0 change in unrelated folder in c Before running Timeout callback:: count: 0 -//// [/home/src/projects/c/4/unrelated/somethingUnrelated.ts] Inode:: 161 +//// [/home/src/projects/c/4/unrelated/somethingUnrelated.ts] Inode:: 162 export const a = 10; @@ -792,7 +792,7 @@ After running Immedidate callback:: count: 0 change in unrelated folder in a Before running Timeout callback:: count: 0 -//// [/home/src/projects/a/2/unrelated/anotherFile.ts] Inode:: 162 +//// [/home/src/projects/a/2/unrelated/anotherFile.ts] Inode:: 163 export const a = 10; @@ -908,7 +908,7 @@ After running Immedidate callback:: count: 0 change in unrelated folder in c Before running Timeout callback:: count: 0 -//// [/home/src/projects/c/4/unrelated/anotherFile.ts] Inode:: 163 +//// [/home/src/projects/c/4/unrelated/anotherFile.ts] Inode:: 164 export const a = 10; @@ -1152,17 +1152,17 @@ FsWatches:: FsWatches *deleted*:: /home/src/projects/a/1/a-impl/a/lib: - {"inode":153} + {"inode":154} /home/src/projects/a/1/a-impl/a/lib/a.d.ts: - {"inode":155} + {"inode":156} /home/src/projects/a/1/a-impl/a/lib/index.d.ts: - {"inode":157} + {"inode":158} /home/src/projects/c/3/c-impl/c/lib: - {"inode":146} + {"inode":147} /home/src/projects/c/3/c-impl/c/lib/c.d.ts: - {"inode":148} + {"inode":149} /home/src/projects/c/3/c-impl/c/lib/index.d.ts: - {"inode":150} + {"inode":151} Timeout callback:: count: 3 21: /home/src/projects/b/2/b-impl/b/tsconfig.json *new* @@ -1500,18 +1500,18 @@ Info seq [hh:mm:ss:mss] FileWatcher:: Triggered with /home/src/projects/a/1/a-i Info seq [hh:mm:ss:mss] Elapsed:: *ms FileWatcher:: Triggered with /home/src/projects/a/1/a-impl/a/lib/index.d.ts 0:: WatchInfo: /home/src/projects/a/1/a-impl/a/lib/index.d.ts 500 undefined WatchType: Closed Script info Before running Timeout callback:: count: 1 30: timerToUpdateChildWatches -//// [/home/src/projects/c/3/c-impl/c/lib/c.js] Inode:: 165 +//// [/home/src/projects/c/3/c-impl/c/lib/c.js] Inode:: 166 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.c = void 0; exports.c = 'test'; -//// [/home/src/projects/c/3/c-impl/c/lib/c.d.ts] Inode:: 166 +//// [/home/src/projects/c/3/c-impl/c/lib/c.d.ts] Inode:: 167 export declare const c: string; -//// [/home/src/projects/c/3/c-impl/c/lib/index.js] Inode:: 167 +//// [/home/src/projects/c/3/c-impl/c/lib/index.js] Inode:: 168 "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; @@ -1531,14 +1531,14 @@ Object.defineProperty(exports, "__esModule", { value: true }); __exportStar(require("./c"), exports); -//// [/home/src/projects/c/3/c-impl/c/lib/index.d.ts] Inode:: 168 +//// [/home/src/projects/c/3/c-impl/c/lib/index.d.ts] Inode:: 169 export * from './c'; -//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo] Inode:: 169 +//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo] Inode:: 170 {"root":["../src/c.ts","../src/index.ts"],"version":"FakeTSVersion"} -//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 170 +//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 171 { "root": [ "../src/c.ts", @@ -1548,18 +1548,18 @@ export * from './c'; "size": 68 } -//// [/home/src/projects/a/1/a-impl/a/lib/a.js] Inode:: 172 +//// [/home/src/projects/a/1/a-impl/a/lib/a.js] Inode:: 173 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.a = void 0; exports.a = 'test'; -//// [/home/src/projects/a/1/a-impl/a/lib/a.d.ts] Inode:: 173 +//// [/home/src/projects/a/1/a-impl/a/lib/a.d.ts] Inode:: 174 export declare const a: string; -//// [/home/src/projects/a/1/a-impl/a/lib/index.js] Inode:: 174 +//// [/home/src/projects/a/1/a-impl/a/lib/index.js] Inode:: 175 "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; @@ -1580,15 +1580,15 @@ __exportStar(require("./a"), exports); __exportStar(require("c"), exports); -//// [/home/src/projects/a/1/a-impl/a/lib/index.d.ts] Inode:: 175 +//// [/home/src/projects/a/1/a-impl/a/lib/index.d.ts] Inode:: 176 export * from './a'; export * from 'c'; -//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo] Inode:: 176 +//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo] Inode:: 177 {"root":["../src/a.ts","../src/index.ts"],"version":"FakeTSVersion"} -//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 177 +//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 178 { "root": [ "../src/a.ts", @@ -1635,9 +1635,9 @@ FsWatches:: /home/src/projects/a/1/a-impl/a: {"inode":19} /home/src/projects/a/1/a-impl/a/lib/a.d.ts: *new* - {"inode":173} + {"inode":174} /home/src/projects/a/1/a-impl/a/lib/index.d.ts: *new* - {"inode":175} + {"inode":176} /home/src/projects/a/1/a-impl/a/node_modules: {"inode":25} /home/src/projects/a/1/a-impl/a/package.json: @@ -1661,9 +1661,9 @@ FsWatches:: /home/src/projects/b/2/b-impl/b/tsconfig.json: {"inode":36} /home/src/projects/c/3/c-impl/c/lib/c.d.ts: *new* - {"inode":166} + {"inode":167} /home/src/projects/c/3/c-impl/c/lib/index.d.ts: *new* - {"inode":168} + {"inode":169} /home/src/tslibs/TS/Lib/lib.d.ts: {"inode":45} @@ -1734,11 +1734,11 @@ FsWatches:: /home/src/projects/a/1/a-impl/a: {"inode":19} /home/src/projects/a/1/a-impl/a/lib: *new* - {"inode":171} + {"inode":172} /home/src/projects/a/1/a-impl/a/lib/a.d.ts: - {"inode":173} + {"inode":174} /home/src/projects/a/1/a-impl/a/lib/index.d.ts: - {"inode":175} + {"inode":176} /home/src/projects/a/1/a-impl/a/node_modules: {"inode":25} /home/src/projects/a/1/a-impl/a/package.json: @@ -1762,9 +1762,9 @@ FsWatches:: /home/src/projects/b/2/b-impl/b/tsconfig.json: {"inode":36} /home/src/projects/c/3/c-impl/c/lib/c.d.ts: - {"inode":166} + {"inode":167} /home/src/projects/c/3/c-impl/c/lib/index.d.ts: - {"inode":168} + {"inode":169} /home/src/tslibs/TS/Lib/lib.d.ts: {"inode":45} @@ -1898,11 +1898,11 @@ FsWatches:: /home/src/projects: {"inode":3} /home/src/projects/a/1/a-impl/a/lib: - {"inode":171} + {"inode":172} /home/src/projects/a/1/a-impl/a/lib/a.d.ts: - {"inode":173} + {"inode":174} /home/src/projects/a/1/a-impl/a/lib/index.d.ts: - {"inode":175} + {"inode":176} /home/src/projects/a/1/a-impl/a/node_modules: {"inode":25} /home/src/projects/a/1/a-impl/a/package.json: @@ -1922,11 +1922,11 @@ FsWatches:: /home/src/projects/b/2/b-impl/b/tsconfig.json: {"inode":36} /home/src/projects/c/3/c-impl/c/lib: *new* - {"inode":164} + {"inode":165} /home/src/projects/c/3/c-impl/c/lib/c.d.ts: - {"inode":166} + {"inode":167} /home/src/projects/c/3/c-impl/c/lib/index.d.ts: - {"inode":168} + {"inode":169} /home/src/projects/c/3/c-impl/c/package.json: *new* {"inode":12} /home/src/tslibs/TS/Lib/lib.d.ts: diff --git a/tests/baselines/reference/tsserver/symLinks/packages-outside-project-folder-built-MacOs-canUseWatchEvents.js b/tests/baselines/reference/tsserver/symLinks/packages-outside-project-folder-built-MacOs-canUseWatchEvents.js index d5a3611394b71..0d9fc84516a5e 100644 --- a/tests/baselines/reference/tsserver/symLinks/packages-outside-project-folder-built-MacOs-canUseWatchEvents.js +++ b/tests/baselines/reference/tsserver/symLinks/packages-outside-project-folder-built-MacOs-canUseWatchEvents.js @@ -90,18 +90,18 @@ interface Array { length: number; [n: number]: T; } interface ReadonlyArray {} declare const console: { log(msg: any): void; }; -//// [/home/src/projects/c/3/c-impl/c/lib/c.js] Inode:: 147 +//// [/home/src/projects/c/3/c-impl/c/lib/c.js] Inode:: 148 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.c = void 0; exports.c = 'test'; -//// [/home/src/projects/c/3/c-impl/c/lib/c.d.ts] Inode:: 148 +//// [/home/src/projects/c/3/c-impl/c/lib/c.d.ts] Inode:: 149 export declare const c: string; -//// [/home/src/projects/c/3/c-impl/c/lib/index.js] Inode:: 149 +//// [/home/src/projects/c/3/c-impl/c/lib/index.js] Inode:: 150 "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; @@ -121,14 +121,14 @@ Object.defineProperty(exports, "__esModule", { value: true }); __exportStar(require("./c"), exports); -//// [/home/src/projects/c/3/c-impl/c/lib/index.d.ts] Inode:: 150 +//// [/home/src/projects/c/3/c-impl/c/lib/index.d.ts] Inode:: 151 export * from './c'; -//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo] Inode:: 151 +//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo] Inode:: 152 {"root":["../src/c.ts","../src/index.ts"],"version":"FakeTSVersion"} -//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 152 +//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 153 { "root": [ "../src/c.ts", @@ -138,18 +138,18 @@ export * from './c'; "size": 68 } -//// [/home/src/projects/a/1/a-impl/a/lib/a.js] Inode:: 154 +//// [/home/src/projects/a/1/a-impl/a/lib/a.js] Inode:: 155 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.a = void 0; exports.a = 'test'; -//// [/home/src/projects/a/1/a-impl/a/lib/a.d.ts] Inode:: 155 +//// [/home/src/projects/a/1/a-impl/a/lib/a.d.ts] Inode:: 156 export declare const a: string; -//// [/home/src/projects/a/1/a-impl/a/lib/index.js] Inode:: 156 +//// [/home/src/projects/a/1/a-impl/a/lib/index.js] Inode:: 157 "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; @@ -170,15 +170,15 @@ __exportStar(require("./a"), exports); __exportStar(require("c"), exports); -//// [/home/src/projects/a/1/a-impl/a/lib/index.d.ts] Inode:: 157 +//// [/home/src/projects/a/1/a-impl/a/lib/index.d.ts] Inode:: 158 export * from './a'; export * from 'c'; -//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo] Inode:: 158 +//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo] Inode:: 159 {"root":["../src/a.ts","../src/index.ts"],"version":"FakeTSVersion"} -//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 159 +//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 160 { "root": [ "../src/a.ts", @@ -855,7 +855,7 @@ After running Immedidate callback:: count: 0 change in unrelated folder in a Before running Timeout callback:: count: 0 -//// [/home/src/projects/a/2/unrelated/somethingUnrelated.ts] Inode:: 160 +//// [/home/src/projects/a/2/unrelated/somethingUnrelated.ts] Inode:: 161 export const a = 10; @@ -971,7 +971,7 @@ After running Immedidate callback:: count: 0 change in unrelated folder in c Before running Timeout callback:: count: 0 -//// [/home/src/projects/c/4/unrelated/somethingUnrelated.ts] Inode:: 161 +//// [/home/src/projects/c/4/unrelated/somethingUnrelated.ts] Inode:: 162 export const a = 10; @@ -1087,7 +1087,7 @@ After running Immedidate callback:: count: 0 change in unrelated folder in a Before running Timeout callback:: count: 0 -//// [/home/src/projects/a/2/unrelated/anotherFile.ts] Inode:: 162 +//// [/home/src/projects/a/2/unrelated/anotherFile.ts] Inode:: 163 export const a = 10; @@ -1203,7 +1203,7 @@ After running Immedidate callback:: count: 0 change in unrelated folder in c Before running Timeout callback:: count: 0 -//// [/home/src/projects/c/4/unrelated/anotherFile.ts] Inode:: 163 +//// [/home/src/projects/c/4/unrelated/anotherFile.ts] Inode:: 164 export const a = 10; @@ -1900,18 +1900,18 @@ Custom watchDirectory:: Triggered Ignored:: {"id":25,"path":"/home/src/projects/ Custom watchDirectory:: Triggered Ignored:: {"id":25,"path":"/home/src/projects/b/2/b-impl/b/node_modules/a","recursive":true,"ignoreUpdate":true}:: /home/src/projects/b/2/b-impl/b/node_modules/a/lib/tsconfig.tsbuildinfo created Custom watchDirectory:: Triggered Ignored:: {"id":25,"path":"/home/src/projects/b/2/b-impl/b/node_modules/a","recursive":true,"ignoreUpdate":true}:: /home/src/projects/b/2/b-impl/b/node_modules/a/lib/tsconfig.tsbuildinfo.readable.baseline.txt created Before request -//// [/home/src/projects/c/3/c-impl/c/lib/c.js] Inode:: 165 +//// [/home/src/projects/c/3/c-impl/c/lib/c.js] Inode:: 166 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.c = void 0; exports.c = 'test'; -//// [/home/src/projects/c/3/c-impl/c/lib/c.d.ts] Inode:: 166 +//// [/home/src/projects/c/3/c-impl/c/lib/c.d.ts] Inode:: 167 export declare const c: string; -//// [/home/src/projects/c/3/c-impl/c/lib/index.js] Inode:: 167 +//// [/home/src/projects/c/3/c-impl/c/lib/index.js] Inode:: 168 "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; @@ -1931,14 +1931,14 @@ Object.defineProperty(exports, "__esModule", { value: true }); __exportStar(require("./c"), exports); -//// [/home/src/projects/c/3/c-impl/c/lib/index.d.ts] Inode:: 168 +//// [/home/src/projects/c/3/c-impl/c/lib/index.d.ts] Inode:: 169 export * from './c'; -//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo] Inode:: 169 +//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo] Inode:: 170 {"root":["../src/c.ts","../src/index.ts"],"version":"FakeTSVersion"} -//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 170 +//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 171 { "root": [ "../src/c.ts", @@ -1948,18 +1948,18 @@ export * from './c'; "size": 68 } -//// [/home/src/projects/a/1/a-impl/a/lib/a.js] Inode:: 172 +//// [/home/src/projects/a/1/a-impl/a/lib/a.js] Inode:: 173 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.a = void 0; exports.a = 'test'; -//// [/home/src/projects/a/1/a-impl/a/lib/a.d.ts] Inode:: 173 +//// [/home/src/projects/a/1/a-impl/a/lib/a.d.ts] Inode:: 174 export declare const a: string; -//// [/home/src/projects/a/1/a-impl/a/lib/index.js] Inode:: 174 +//// [/home/src/projects/a/1/a-impl/a/lib/index.js] Inode:: 175 "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; @@ -1980,15 +1980,15 @@ __exportStar(require("./a"), exports); __exportStar(require("c"), exports); -//// [/home/src/projects/a/1/a-impl/a/lib/index.d.ts] Inode:: 175 +//// [/home/src/projects/a/1/a-impl/a/lib/index.d.ts] Inode:: 176 export * from './a'; export * from 'c'; -//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo] Inode:: 176 +//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo] Inode:: 177 {"root":["../src/a.ts","../src/index.ts"],"version":"FakeTSVersion"} -//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 177 +//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 178 { "root": [ "../src/a.ts", diff --git a/tests/baselines/reference/tsserver/symLinks/packages-outside-project-folder-built-MacOs.js b/tests/baselines/reference/tsserver/symLinks/packages-outside-project-folder-built-MacOs.js index c6303534c07eb..86dc5db3cdacc 100644 --- a/tests/baselines/reference/tsserver/symLinks/packages-outside-project-folder-built-MacOs.js +++ b/tests/baselines/reference/tsserver/symLinks/packages-outside-project-folder-built-MacOs.js @@ -90,18 +90,18 @@ interface Array { length: number; [n: number]: T; } interface ReadonlyArray {} declare const console: { log(msg: any): void; }; -//// [/home/src/projects/c/3/c-impl/c/lib/c.js] Inode:: 147 +//// [/home/src/projects/c/3/c-impl/c/lib/c.js] Inode:: 148 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.c = void 0; exports.c = 'test'; -//// [/home/src/projects/c/3/c-impl/c/lib/c.d.ts] Inode:: 148 +//// [/home/src/projects/c/3/c-impl/c/lib/c.d.ts] Inode:: 149 export declare const c: string; -//// [/home/src/projects/c/3/c-impl/c/lib/index.js] Inode:: 149 +//// [/home/src/projects/c/3/c-impl/c/lib/index.js] Inode:: 150 "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; @@ -121,14 +121,14 @@ Object.defineProperty(exports, "__esModule", { value: true }); __exportStar(require("./c"), exports); -//// [/home/src/projects/c/3/c-impl/c/lib/index.d.ts] Inode:: 150 +//// [/home/src/projects/c/3/c-impl/c/lib/index.d.ts] Inode:: 151 export * from './c'; -//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo] Inode:: 151 +//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo] Inode:: 152 {"root":["../src/c.ts","../src/index.ts"],"version":"FakeTSVersion"} -//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 152 +//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 153 { "root": [ "../src/c.ts", @@ -138,18 +138,18 @@ export * from './c'; "size": 68 } -//// [/home/src/projects/a/1/a-impl/a/lib/a.js] Inode:: 154 +//// [/home/src/projects/a/1/a-impl/a/lib/a.js] Inode:: 155 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.a = void 0; exports.a = 'test'; -//// [/home/src/projects/a/1/a-impl/a/lib/a.d.ts] Inode:: 155 +//// [/home/src/projects/a/1/a-impl/a/lib/a.d.ts] Inode:: 156 export declare const a: string; -//// [/home/src/projects/a/1/a-impl/a/lib/index.js] Inode:: 156 +//// [/home/src/projects/a/1/a-impl/a/lib/index.js] Inode:: 157 "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; @@ -170,15 +170,15 @@ __exportStar(require("./a"), exports); __exportStar(require("c"), exports); -//// [/home/src/projects/a/1/a-impl/a/lib/index.d.ts] Inode:: 157 +//// [/home/src/projects/a/1/a-impl/a/lib/index.d.ts] Inode:: 158 export * from './a'; export * from 'c'; -//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo] Inode:: 158 +//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo] Inode:: 159 {"root":["../src/a.ts","../src/index.ts"],"version":"FakeTSVersion"} -//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 159 +//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 160 { "root": [ "../src/a.ts", @@ -388,9 +388,9 @@ FsWatches:: /home/src/projects: *new* {"inode":3} /home/src/projects/a/1/a-impl/a/lib/a.d.ts: *new* - {"inode":155} + {"inode":156} /home/src/projects/a/1/a-impl/a/lib/index.d.ts: *new* - {"inode":157} + {"inode":158} /home/src/projects/a/1/a-impl/a/package.json: *new* {"inode":24} /home/src/projects/b: *new* @@ -404,9 +404,9 @@ FsWatches:: /home/src/projects/b/2/b-impl/b/tsconfig.json: *new* {"inode":36} /home/src/projects/c/3/c-impl/c/lib/c.d.ts: *new* - {"inode":148} + {"inode":149} /home/src/projects/c/3/c-impl/c/lib/index.d.ts: *new* - {"inode":150} + {"inode":151} /home/src/projects/c/3/c-impl/c/package.json: *new* {"inode":12} /home/src/tslibs/TS/Lib/lib.d.ts: *new* @@ -566,7 +566,7 @@ Info seq [hh:mm:ss:mss] Scheduled: /home/src/projects/b/2/b-impl/b/tsconfig.jso Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Triggered with /home/src/projects/a/2/unrelated/somethingUnrelated.ts :: WatchInfo: /home/src/projects/a 1 undefined Project: /home/src/projects/b/2/b-impl/b/tsconfig.json WatchType: Failed Lookup Locations Before running Timeout callback:: count: 1 2: /home/src/projects/b/2/b-impl/b/tsconfig.jsonFailedLookupInvalidation -//// [/home/src/projects/a/2/unrelated/somethingUnrelated.ts] Inode:: 160 +//// [/home/src/projects/a/2/unrelated/somethingUnrelated.ts] Inode:: 161 export const a = 10; @@ -690,7 +690,7 @@ Info seq [hh:mm:ss:mss] Scheduled: /home/src/projects/b/2/b-impl/b/tsconfig.jso Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Triggered with /home/src/projects/c/4/unrelated/somethingUnrelated.ts :: WatchInfo: /home/src/projects/c 1 undefined Project: /home/src/projects/b/2/b-impl/b/tsconfig.json WatchType: Failed Lookup Locations Before running Timeout callback:: count: 1 4: /home/src/projects/b/2/b-impl/b/tsconfig.jsonFailedLookupInvalidation -//// [/home/src/projects/c/4/unrelated/somethingUnrelated.ts] Inode:: 161 +//// [/home/src/projects/c/4/unrelated/somethingUnrelated.ts] Inode:: 162 export const a = 10; @@ -814,7 +814,7 @@ Info seq [hh:mm:ss:mss] Scheduled: /home/src/projects/b/2/b-impl/b/tsconfig.jso Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Triggered with /home/src/projects/a/2/unrelated/anotherFile.ts :: WatchInfo: /home/src/projects/a 1 undefined Project: /home/src/projects/b/2/b-impl/b/tsconfig.json WatchType: Failed Lookup Locations Before running Timeout callback:: count: 1 6: /home/src/projects/b/2/b-impl/b/tsconfig.jsonFailedLookupInvalidation -//// [/home/src/projects/a/2/unrelated/anotherFile.ts] Inode:: 162 +//// [/home/src/projects/a/2/unrelated/anotherFile.ts] Inode:: 163 export const a = 10; @@ -938,7 +938,7 @@ Info seq [hh:mm:ss:mss] Scheduled: /home/src/projects/b/2/b-impl/b/tsconfig.jso Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Triggered with /home/src/projects/c/4/unrelated/anotherFile.ts :: WatchInfo: /home/src/projects/c 1 undefined Project: /home/src/projects/b/2/b-impl/b/tsconfig.json WatchType: Failed Lookup Locations Before running Timeout callback:: count: 1 8: /home/src/projects/b/2/b-impl/b/tsconfig.jsonFailedLookupInvalidation -//// [/home/src/projects/c/4/unrelated/anotherFile.ts] Inode:: 163 +//// [/home/src/projects/c/4/unrelated/anotherFile.ts] Inode:: 164 export const a = 10; @@ -1176,13 +1176,13 @@ FsWatches:: FsWatches *deleted*:: /home/src/projects/a/1/a-impl/a/lib/a.d.ts: - {"inode":155} + {"inode":156} /home/src/projects/a/1/a-impl/a/lib/index.d.ts: - {"inode":157} + {"inode":158} /home/src/projects/c/3/c-impl/c/lib/c.d.ts: - {"inode":148} + {"inode":149} /home/src/projects/c/3/c-impl/c/lib/index.d.ts: - {"inode":150} + {"inode":151} FsWatchesRecursive:: /home/src/projects/a: @@ -1553,18 +1553,18 @@ Info seq [hh:mm:ss:mss] Scheduled: /home/src/projects/b/2/b-impl/b/tsconfig.jso Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Triggered with /home/src/projects/b/2/b-impl/b/node_modules/a/lib/tsconfig.tsbuildinfo.readable.baseline.txt :: WatchInfo: /home/src/projects/b/2/b-impl/b/node_modules/a 1 undefined Project: /home/src/projects/b/2/b-impl/b/tsconfig.json WatchType: Failed Lookup Locations Before running Timeout callback:: count: 1 39: /home/src/projects/b/2/b-impl/b/tsconfig.jsonFailedLookupInvalidation -//// [/home/src/projects/c/3/c-impl/c/lib/c.js] Inode:: 165 +//// [/home/src/projects/c/3/c-impl/c/lib/c.js] Inode:: 166 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.c = void 0; exports.c = 'test'; -//// [/home/src/projects/c/3/c-impl/c/lib/c.d.ts] Inode:: 166 +//// [/home/src/projects/c/3/c-impl/c/lib/c.d.ts] Inode:: 167 export declare const c: string; -//// [/home/src/projects/c/3/c-impl/c/lib/index.js] Inode:: 167 +//// [/home/src/projects/c/3/c-impl/c/lib/index.js] Inode:: 168 "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; @@ -1584,14 +1584,14 @@ Object.defineProperty(exports, "__esModule", { value: true }); __exportStar(require("./c"), exports); -//// [/home/src/projects/c/3/c-impl/c/lib/index.d.ts] Inode:: 168 +//// [/home/src/projects/c/3/c-impl/c/lib/index.d.ts] Inode:: 169 export * from './c'; -//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo] Inode:: 169 +//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo] Inode:: 170 {"root":["../src/c.ts","../src/index.ts"],"version":"FakeTSVersion"} -//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 170 +//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 171 { "root": [ "../src/c.ts", @@ -1601,18 +1601,18 @@ export * from './c'; "size": 68 } -//// [/home/src/projects/a/1/a-impl/a/lib/a.js] Inode:: 172 +//// [/home/src/projects/a/1/a-impl/a/lib/a.js] Inode:: 173 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.a = void 0; exports.a = 'test'; -//// [/home/src/projects/a/1/a-impl/a/lib/a.d.ts] Inode:: 173 +//// [/home/src/projects/a/1/a-impl/a/lib/a.d.ts] Inode:: 174 export declare const a: string; -//// [/home/src/projects/a/1/a-impl/a/lib/index.js] Inode:: 174 +//// [/home/src/projects/a/1/a-impl/a/lib/index.js] Inode:: 175 "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; @@ -1633,15 +1633,15 @@ __exportStar(require("./a"), exports); __exportStar(require("c"), exports); -//// [/home/src/projects/a/1/a-impl/a/lib/index.d.ts] Inode:: 175 +//// [/home/src/projects/a/1/a-impl/a/lib/index.d.ts] Inode:: 176 export * from './a'; export * from 'c'; -//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo] Inode:: 176 +//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo] Inode:: 177 {"root":["../src/a.ts","../src/index.ts"],"version":"FakeTSVersion"} -//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 177 +//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 178 { "root": [ "../src/a.ts", @@ -1686,9 +1686,9 @@ FsWatches:: /home/src/projects: {"inode":3} /home/src/projects/a/1/a-impl/a/lib/a.d.ts: *new* - {"inode":173} + {"inode":174} /home/src/projects/a/1/a-impl/a/lib/index.d.ts: *new* - {"inode":175} + {"inode":176} /home/src/projects/a/1/a-impl/a/package.json: {"inode":24} /home/src/projects/b: @@ -1702,9 +1702,9 @@ FsWatches:: /home/src/projects/b/2/b-impl/b/tsconfig.json: {"inode":36} /home/src/projects/c/3/c-impl/c/lib/c.d.ts: *new* - {"inode":166} + {"inode":167} /home/src/projects/c/3/c-impl/c/lib/index.d.ts: *new* - {"inode":168} + {"inode":169} /home/src/tslibs/TS/Lib/lib.d.ts: {"inode":45} @@ -1873,9 +1873,9 @@ FsWatches:: /home/src/projects: {"inode":3} /home/src/projects/a/1/a-impl/a/lib/a.d.ts: - {"inode":173} + {"inode":174} /home/src/projects/a/1/a-impl/a/lib/index.d.ts: - {"inode":175} + {"inode":176} /home/src/projects/a/1/a-impl/a/package.json: {"inode":24} /home/src/projects/b: @@ -1889,9 +1889,9 @@ FsWatches:: /home/src/projects/b/2/b-impl/b/tsconfig.json: {"inode":36} /home/src/projects/c/3/c-impl/c/lib/c.d.ts: - {"inode":166} + {"inode":167} /home/src/projects/c/3/c-impl/c/lib/index.d.ts: - {"inode":168} + {"inode":169} /home/src/projects/c/3/c-impl/c/package.json: *new* {"inode":12} /home/src/tslibs/TS/Lib/lib.d.ts: diff --git a/tests/baselines/reference/tsserver/telemetry/does-not-expose-paths.js b/tests/baselines/reference/tsserver/telemetry/does-not-expose-paths.js index b367c28fdafb8..6f10156e785b6 100644 --- a/tests/baselines/reference/tsserver/telemetry/does-not-expose-paths.js +++ b/tests/baselines/reference/tsserver/telemetry/does-not-expose-paths.js @@ -430,7 +430,7 @@ Info seq [hh:mm:ss:mss] event: "line": 34, "offset": 16 }, - "text": "Argument for '--lib' option must be: 'es5', 'es6', 'es2015', 'es7', 'es2016', 'es2017', 'es2018', 'es2019', 'es2020', 'es2021', 'es2022', 'es2023', 'es2024', 'esnext', 'dom', 'dom.iterable', 'dom.asynciterable', 'webworker', 'webworker.importscripts', 'webworker.iterable', 'webworker.asynciterable', 'scripthost', 'es2015.core', 'es2015.collection', 'es2015.generator', 'es2015.iterable', 'es2015.promise', 'es2015.proxy', 'es2015.reflect', 'es2015.symbol', 'es2015.symbol.wellknown', 'es2016.array.include', 'es2016.intl', 'es2017.arraybuffer', 'es2017.date', 'es2017.object', 'es2017.sharedmemory', 'es2017.string', 'es2017.intl', 'es2017.typedarrays', 'es2018.asyncgenerator', 'es2018.asynciterable', 'es2018.intl', 'es2018.promise', 'es2018.regexp', 'es2019.array', 'es2019.object', 'es2019.string', 'es2019.symbol', 'es2019.intl', 'es2020.bigint', 'es2020.date', 'es2020.promise', 'es2020.sharedmemory', 'es2020.string', 'es2020.symbol.wellknown', 'es2020.intl', 'es2020.number', 'es2021.promise', 'es2021.string', 'es2021.weakref', 'es2021.intl', 'es2022.array', 'es2022.error', 'es2022.intl', 'es2022.object', 'es2022.string', 'es2022.regexp', 'es2023.array', 'es2023.collection', 'es2023.intl', 'es2024.arraybuffer', 'es2024.collection', 'es2024.object', 'es2024.promise', 'es2024.regexp', 'es2024.sharedmemory', 'es2024.string', 'esnext.array', 'esnext.collection', 'esnext.symbol', 'esnext.asynciterable', 'esnext.intl', 'esnext.disposable', 'esnext.bigint', 'esnext.string', 'esnext.promise', 'esnext.weakref', 'esnext.decorators', 'esnext.object', 'esnext.regexp', 'esnext.iterator', 'esnext.float16', 'esnext.typedarrays', 'esnext.error', 'esnext.sharedmemory', 'decorators', 'decorators.legacy'.", + "text": "Argument for '--lib' option must be: 'es5', 'es6', 'es2015', 'es7', 'es2016', 'es2017', 'es2018', 'es2019', 'es2020', 'es2021', 'es2022', 'es2023', 'es2024', 'esnext', 'dom', 'dom.iterable', 'dom.asynciterable', 'webworker', 'webworker.importscripts', 'webworker.iterable', 'webworker.asynciterable', 'scripthost', 'es2015.core', 'es2015.collection', 'es2015.generator', 'es2015.iterable', 'es2015.promise', 'es2015.proxy', 'es2015.reflect', 'es2015.symbol', 'es2015.symbol.wellknown', 'es2016.array.include', 'es2016.intl', 'es2017.arraybuffer', 'es2017.date', 'es2017.object', 'es2017.sharedmemory', 'es2017.string', 'es2017.intl', 'es2017.typedarrays', 'es2018.asyncgenerator', 'es2018.asynciterable', 'es2018.intl', 'es2018.promise', 'es2018.regexp', 'es2019.array', 'es2019.object', 'es2019.string', 'es2019.symbol', 'es2019.intl', 'es2020.bigint', 'es2020.date', 'es2020.promise', 'es2020.sharedmemory', 'es2020.string', 'es2020.symbol.wellknown', 'es2020.intl', 'es2020.number', 'es2021.promise', 'es2021.string', 'es2021.weakref', 'es2021.intl', 'es2022.array', 'es2022.error', 'es2022.intl', 'es2022.object', 'es2022.string', 'es2022.regexp', 'es2023.array', 'es2023.collection', 'es2023.intl', 'es2024.arraybuffer', 'es2024.collection', 'es2024.object', 'es2024.promise', 'es2024.regexp', 'es2024.sharedmemory', 'es2024.string', 'esnext.array', 'esnext.collection', 'esnext.symbol', 'esnext.asynciterable', 'esnext.intl', 'esnext.disposable', 'esnext.bigint', 'esnext.string', 'esnext.promise', 'esnext.weakref', 'esnext.decorators', 'esnext.object', 'esnext.regexp', 'esnext.iterator', 'esnext.float16', 'esnext.typedarrays', 'esnext.error', 'esnext.sharedmemory', 'esnext.temporal', 'decorators', 'decorators.legacy'.", "code": 6046, "category": "error", "fileName": "/home/src/projects/project/tsconfig.json" diff --git a/tests/baselines/reference/tsserver/watchEnvironment/recursive-directory-does-not-watch-files-starting-with-dot-in-node_modules.js b/tests/baselines/reference/tsserver/watchEnvironment/recursive-directory-does-not-watch-files-starting-with-dot-in-node_modules.js index f7c25578996ce..3b3bec8b111f9 100644 --- a/tests/baselines/reference/tsserver/watchEnvironment/recursive-directory-does-not-watch-files-starting-with-dot-in-node_modules.js +++ b/tests/baselines/reference/tsserver/watchEnvironment/recursive-directory-does-not-watch-files-starting-with-dot-in-node_modules.js @@ -222,30 +222,30 @@ ScriptInfos:: /a/username/workspace/project/tsconfig.json After writing ignored file or folder -//// [/a/username/workspace/project/node_modules/.cache/someFile.d.ts] Inode:: 121 +//// [/a/username/workspace/project/node_modules/.cache/someFile.d.ts] Inode:: 122 After writing ignored file or folder -//// [/a/username/workspace/project/node_modules/.cacheFile.ts] Inode:: 122 +//// [/a/username/workspace/project/node_modules/.cacheFile.ts] Inode:: 123 Info seq [hh:mm:ss:mss] DirectoryWatcher:: Triggered with /a/username/workspace/project/.git :: WatchInfo: /a/username/workspace/project 0 undefined Project: /a/username/workspace/project/tsconfig.json WatchType: Failed Lookup Locations Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/username/workspace/project/.git :: WatchInfo: /a/username/workspace/project 0 undefined Project: /a/username/workspace/project/tsconfig.json WatchType: Failed Lookup Locations After writing ignored file or folder -//// [/a/username/workspace/project/.git/someFile.d.ts] Inode:: 124 +//// [/a/username/workspace/project/.git/someFile.d.ts] Inode:: 125 Info seq [hh:mm:ss:mss] DirectoryWatcher:: Triggered with /a/username/workspace/project/.gitCache.d.ts :: WatchInfo: /a/username/workspace/project 0 undefined Project: /a/username/workspace/project/tsconfig.json WatchType: Failed Lookup Locations Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/username/workspace/project/.gitCache.d.ts :: WatchInfo: /a/username/workspace/project 0 undefined Project: /a/username/workspace/project/tsconfig.json WatchType: Failed Lookup Locations After writing ignored file or folder -//// [/a/username/workspace/project/.gitCache.d.ts] Inode:: 125 +//// [/a/username/workspace/project/.gitCache.d.ts] Inode:: 126 After writing ignored file or folder -//// [/a/username/workspace/project/src/.#field.ts] Inode:: 126 +//// [/a/username/workspace/project/src/.#field.ts] Inode:: 127 diff --git a/tests/baselines/reference/tsserver/watchEnvironment/uses-dynamic-polling-when-file-is-added-to-subfolder.js b/tests/baselines/reference/tsserver/watchEnvironment/uses-dynamic-polling-when-file-is-added-to-subfolder.js index c15ebd58c9397..c9c7b949e858e 100644 --- a/tests/baselines/reference/tsserver/watchEnvironment/uses-dynamic-polling-when-file-is-added-to-subfolder.js +++ b/tests/baselines/reference/tsserver/watchEnvironment/uses-dynamic-polling-when-file-is-added-to-subfolder.js @@ -242,7 +242,7 @@ After request Before running Timeout callback:: count: 1 1: pollPollingIntervalQueue -//// [/a/username/workspace/project/src/file2.ts] Inode:: 118 +//// [/a/username/workspace/project/src/file2.ts] Inode:: 119 @@ -356,7 +356,7 @@ FsWatches:: /a/username/workspace/project/src/file1.ts: {"inode":7} /a/username/workspace/project/src/file2.ts: *new* - {"inode":118} + {"inode":119} /a/username/workspace/project/tsconfig.json: {"inode":8} /home/src/tslibs/TS/Lib/lib.d.ts: diff --git a/tests/baselines/reference/tsserver/watchEnvironment/uses-non-recursive-watchDirectory-when-file-is-added-to-subfolder.js b/tests/baselines/reference/tsserver/watchEnvironment/uses-non-recursive-watchDirectory-when-file-is-added-to-subfolder.js index 40e9b32783243..5a3bfe31735bd 100644 --- a/tests/baselines/reference/tsserver/watchEnvironment/uses-non-recursive-watchDirectory-when-file-is-added-to-subfolder.js +++ b/tests/baselines/reference/tsserver/watchEnvironment/uses-non-recursive-watchDirectory-when-file-is-added-to-subfolder.js @@ -258,7 +258,7 @@ Before running Timeout callback:: count: 3 1: /a/username/workspace/project/tsconfig.json 2: *ensureProjectForOpenFiles* 3: /a/username/workspace/project/tsconfig.jsonFailedLookupInvalidation -//// [/a/username/workspace/project/src/file2.ts] Inode:: 118 +//// [/a/username/workspace/project/src/file2.ts] Inode:: 119 @@ -342,7 +342,7 @@ FsWatches:: /a/username/workspace/project/src/file1.ts: {"inode":7} /a/username/workspace/project/src/file2.ts: *new* - {"inode":118} + {"inode":119} /a/username/workspace/project/tsconfig.json: {"inode":8} /home/src/tslibs/TS/Lib/lib.d.ts: diff --git a/tests/baselines/reference/tsserver/watchEnvironment/uses-watchFile-when-file-is-added-to-subfolder.js b/tests/baselines/reference/tsserver/watchEnvironment/uses-watchFile-when-file-is-added-to-subfolder.js index 6c63e25acfd7f..8ac6c761da7e0 100644 --- a/tests/baselines/reference/tsserver/watchEnvironment/uses-watchFile-when-file-is-added-to-subfolder.js +++ b/tests/baselines/reference/tsserver/watchEnvironment/uses-watchFile-when-file-is-added-to-subfolder.js @@ -261,7 +261,7 @@ Before running Timeout callback:: count: 3 3: /a/username/workspace/project/tsconfig.json 4: *ensureProjectForOpenFiles* 5: /a/username/workspace/project/tsconfig.jsonFailedLookupInvalidation -//// [/a/username/workspace/project/src/file2.ts] Inode:: 118 +//// [/a/username/workspace/project/src/file2.ts] Inode:: 119 @@ -332,7 +332,7 @@ FsWatches:: /a/username/workspace/project/src/file1.ts: {"inode":7} /a/username/workspace/project/src/file2.ts: *new* - {"inode":118} + {"inode":119} /a/username/workspace/project/tsconfig.json: {"inode":8} /home/src/tslibs/TS/Lib/lib.d.ts: diff --git a/tests/baselines/reference/tsserver/watchEnvironment/watching-npm-install-in-codespaces-where-workspaces-folder-is-hosted-at-root.js b/tests/baselines/reference/tsserver/watchEnvironment/watching-npm-install-in-codespaces-where-workspaces-folder-is-hosted-at-root.js index 86e24b8137987..a9980b4935b07 100644 --- a/tests/baselines/reference/tsserver/watchEnvironment/watching-npm-install-in-codespaces-where-workspaces-folder-is-hosted-at-root.js +++ b/tests/baselines/reference/tsserver/watchEnvironment/watching-npm-install-in-codespaces-where-workspaces-folder-is-hosted-at-root.js @@ -669,7 +669,7 @@ Info seq [hh:mm:ss:mss] DirectoryWatcher:: Triggered with /workspaces/somerepo/ Info seq [hh:mm:ss:mss] Scheduled: /workspaces/somerepo/src/tsconfig.jsonFailedLookupInvalidation, Cancelled earlier one Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Triggered with /workspaces/somerepo/node_modules :: WatchInfo: /workspaces/somerepo 0 undefined Project: /workspaces/somerepo/src/tsconfig.json WatchType: Failed Lookup Locations Before request -//// [/workspaces/somerepo/node_modules/@types/random-seed/index.d.ts] Inode:: 122 +//// [/workspaces/somerepo/node_modules/@types/random-seed/index.d.ts] Inode:: 123 export function randomSeed(): string; @@ -691,9 +691,9 @@ FsWatches:: /workspaces/somerepo: {"inode":2} /workspaces/somerepo/node_modules: *new* - {"inode":119} -/workspaces/somerepo/node_modules/@types: *new* {"inode":120} +/workspaces/somerepo/node_modules/@types: *new* + {"inode":121} /workspaces/somerepo/src: {"inode":3} /workspaces/somerepo/src/tsconfig.json: @@ -790,9 +790,9 @@ FsWatches:: /workspaces/somerepo: {"inode":2} /workspaces/somerepo/node_modules: - {"inode":119} -/workspaces/somerepo/node_modules/@types: {"inode":120} +/workspaces/somerepo/node_modules/@types: + {"inode":121} /workspaces/somerepo/src: {"inode":3} /workspaces/somerepo/src/tsconfig.json: @@ -924,11 +924,11 @@ FsWatches:: /workspaces/somerepo: {"inode":2} /workspaces/somerepo/node_modules: - {"inode":119} -/workspaces/somerepo/node_modules/@types: {"inode":120} -/workspaces/somerepo/node_modules/@types/random-seed: *new* +/workspaces/somerepo/node_modules/@types: {"inode":121} +/workspaces/somerepo/node_modules/@types/random-seed: *new* + {"inode":122} /workspaces/somerepo/src: {"inode":3} /workspaces/somerepo/src/tsconfig.json: From bab5a4af32e918a9a6524e27616f799af843ee76 Mon Sep 17 00:00:00 2001 From: Renegade334 Date: Mon, 20 Oct 2025 03:51:50 +0100 Subject: [PATCH 2/8] add proposal-temporal ancillaries to lib.esnext.{date,intl} --- src/compiler/commandLineParser.ts | 1 + src/compiler/utilities.ts | 5 + src/lib/esnext.d.ts | 1 + src/lib/esnext.date.d.ts | 5 + src/lib/esnext.intl.d.ts | 11 +- src/lib/libs.json | 1 + ...next,moduleresolution=nodenext).trace.json | 2 + .../Parse --lib option with extra comma.js | 2 +- ... --lib option with trailing white-space.js | 2 +- .../Parse invalid option of library flags.js | 2 +- ...array to compiler-options with json api.js | 2 +- ...ompiler-options with jsonSourceFile api.js | 2 +- ... libs to compiler-options with json api.js | 2 +- ...ompiler-options with jsonSourceFile api.js | 2 +- ... libs to compiler-options with json api.js | 2 +- ...ompiler-options with jsonSourceFile api.js | 2 +- ... libs to compiler-options with json api.js | 2 +- ...ompiler-options with jsonSourceFile api.js | 2 +- ...angeYourTargetLibraryES2016Plus.errors.txt | 6 +- ...NeedToChangeYourTargetLibraryES2016Plus.js | 2 + ...oChangeYourTargetLibraryES2016Plus.symbols | 3 + ...dToChangeYourTargetLibraryES2016Plus.types | 13 ++ .../formatToPartsFractionalSecond.symbols | 8 +- .../formatToPartsFractionalSecond.types | 8 +- ...eplacement(libreplacement=true).trace.json | 25 +++- ...sTypesVersions(module=nodenext).trace.json | 2 + ...PackageImports(module=nodenext).trace.json | 2 + ...xportsTrailers(module=nodenext).trace.json | 2 + .../reactJsxReactResolvedNodeNext.trace.json | 2 + ...eactJsxReactResolvedNodeNextEsm.trace.json | 2 + ...does-not-add-color-when-NO_COLOR-is-set.js | 2 +- .../reference/tsc/commandLine/help-all.js | 2 +- .../reference/tsc/commandLine/help.js | 2 +- ...-when-host-can't-provide-terminal-width.js | 2 +- ...tatus.DiagnosticsPresent_OutputsSkipped.js | 2 +- ...-config-file-absent-with---ignoreConfig.js | 2 +- ...out-any-options-when-config-file-absent.js | 2 +- ...-style-sibling-packages-symlinked-Linux.js | 62 +++++----- ...packages-symlinked-package1-built-Linux.js | 52 ++++---- .../packages-outside-project-folder-Linux.js | 104 ++++++++-------- .../packages-outside-project-folder-MacOs.js | 88 +++++++------- ...ages-outside-project-folder-built-Linux.js | 100 ++++++++-------- ...ages-outside-project-folder-built-MacOs.js | 86 +++++++------- ...stamp-true-useFsEventsOnParentDirectory.js | 4 +- .../fsWatch/fsWatchWithTimestamp-true.js | 4 +- ...inode-when-rename-event-ends-with-tilde.js | 16 +-- ...e-occurs-when-file-is-still-on-the-disk.js | 18 +-- ...when-using-file-watching-thats-on-inode.js | 16 +-- ...polling-when-renaming-file-in-subfolder.js | 8 +- ...rectory-when-renaming-file-in-subfolder.js | 8 +- ...tchFile-when-renaming-file-in-subfolder.js | 8 +- ...-folders-with-synchronousWatchDirectory.js | 4 +- ...ymlinks-to-folders-in-recursive-folders.js | 4 +- ...hronous-watch-directory-renaming-a-file.js | 20 ++-- ...ory-with-outDir-and-declaration-enabled.js | 16 +-- .../with-non-synchronous-watch-directory.js | 20 ++-- ...-directory-watching-extendedDiagnostics.js | 4 +- ...ption-with-recursive-directory-watching.js | 4 +- .../with-fallbackPolling-option.js | 4 +- .../with-watchDirectory-option.js | 4 +- .../projectErrors/file-rename-on-wsl2.js | 4 +- ...-location-with-currentDirectory-at-root.js | 4 +- ...lution-fails-in-global-typings-location.js | 4 +- ...e-failing-with-currentDirectory-at-root.js | 6 +- ...with-import-from-the-cache-file-failing.js | 8 +- ...ache-file-with-currentDirectory-at-root.js | 6 +- ...ocation-with-import-from-the-cache-file.js | 8 +- ...ache-file-with-currentDirectory-at-root.js | 6 +- ...ith-relative-import-from-the-cache-file.js | 8 +- ...kages-symlinked-Linux-canUseWatchEvents.js | 16 +-- ...-style-sibling-packages-symlinked-Linux.js | 36 +++--- ...-package1-built-Linux-canUseWatchEvents.js | 16 +-- ...packages-symlinked-package1-built-Linux.js | 34 +++--- ...-project-folder-Linux-canUseWatchEvents.js | 56 ++++----- .../packages-outside-project-folder-Linux.js | 112 +++++++++--------- ...-project-folder-MacOs-canUseWatchEvents.js | 56 ++++----- .../packages-outside-project-folder-MacOs.js | 88 +++++++------- ...ct-folder-built-Linux-canUseWatchEvents.js | 56 ++++----- ...ages-outside-project-folder-built-Linux.js | 110 ++++++++--------- ...ct-folder-built-MacOs-canUseWatchEvents.js | 56 ++++----- ...ages-outside-project-folder-built-MacOs.js | 88 +++++++------- .../telemetry/does-not-expose-paths.js | 2 +- ...files-starting-with-dot-in-node_modules.js | 10 +- ...polling-when-file-is-added-to-subfolder.js | 4 +- ...rectory-when-file-is-added-to-subfolder.js | 4 +- ...tchFile-when-file-is-added-to-subfolder.js | 4 +- ...ere-workspaces-folder-is-hosted-at-root.js | 16 +-- ...NeedToChangeYourTargetLibraryES2016Plus.ts | 1 + 88 files changed, 840 insertions(+), 770 deletions(-) create mode 100644 src/lib/esnext.date.d.ts diff --git a/src/compiler/commandLineParser.ts b/src/compiler/commandLineParser.ts index 98bf0558e710b..93b1b2f53c251 100644 --- a/src/compiler/commandLineParser.ts +++ b/src/compiler/commandLineParser.ts @@ -252,6 +252,7 @@ const libEntries: [string, string][] = [ ["esnext.error", "lib.esnext.error.d.ts"], ["esnext.sharedmemory", "lib.esnext.sharedmemory.d.ts"], ["esnext.temporal", "lib.esnext.temporal.d.ts"], + ["esnext.date", "lib.esnext.date.d.ts"], ["decorators", "lib.decorators.d.ts"], ["decorators.legacy", "lib.decorators.legacy.d.ts"], ]; diff --git a/src/compiler/utilities.ts b/src/compiler/utilities.ts index cdf898ca8c3fc..69f09d45c7457 100644 --- a/src/compiler/utilities.ts +++ b/src/compiler/utilities.ts @@ -1927,6 +1927,11 @@ export const getScriptTargetFeatures: () => ScriptTargetFeatures = /* @__PURE__ "fromHex", ], })), + Date: new Map(Object.entries({ + esnext: [ + "toTemporalInstant", + ], + })), })) ); diff --git a/src/lib/esnext.d.ts b/src/lib/esnext.d.ts index 76ce09eab1d84..40f8275333571 100644 --- a/src/lib/esnext.d.ts +++ b/src/lib/esnext.d.ts @@ -11,3 +11,4 @@ /// /// /// +/// diff --git a/src/lib/esnext.date.d.ts b/src/lib/esnext.date.d.ts new file mode 100644 index 0000000000000..1e5e90421c5a0 --- /dev/null +++ b/src/lib/esnext.date.d.ts @@ -0,0 +1,5 @@ +/// + +interface Date { + toTemporalInstant(): Temporal.Instant; +} diff --git a/src/lib/esnext.intl.d.ts b/src/lib/esnext.intl.d.ts index 9aacedd724469..e1d148b5d862e 100644 --- a/src/lib/esnext.intl.d.ts +++ b/src/lib/esnext.intl.d.ts @@ -1,3 +1,12 @@ +/// + declare namespace Intl { - // Empty + type FormattableTemporalObject = Temporal.PlainDate | Temporal.PlainYearMonth | Temporal.PlainMonthDay | Temporal.PlainTime | Temporal.PlainDateTime | Temporal.Instant; + + interface DateTimeFormat { + format(date?: FormattableTemporalObject | Date | number): string; + formatToParts(date?: FormattableTemporalObject | Date | number): DateTimeFormatPart[]; + formatRange(startDate: FormattableTemporalObject | Date | number, endDate: FormattableTemporalObject | Date | number): string; + formatRangeToParts(startDate: FormattableTemporalObject | Date | number, endDate: FormattableTemporalObject | Date | number): DateTimeRangeFormatPart[]; + } } diff --git a/src/lib/libs.json b/src/lib/libs.json index 8b205659700fe..a7799ea95ae9d 100644 --- a/src/lib/libs.json +++ b/src/lib/libs.json @@ -91,6 +91,7 @@ "esnext.error", "esnext.sharedmemory", "esnext.temporal", + "esnext.date", "decorators", "decorators.legacy", // Default libraries diff --git a/tests/baselines/reference/bundlerDirectoryModule(module=nodenext,moduleresolution=nodenext).trace.json b/tests/baselines/reference/bundlerDirectoryModule(module=nodenext,moduleresolution=nodenext).trace.json index 5a159946d324d..deb119f3e44f9 100644 --- a/tests/baselines/reference/bundlerDirectoryModule(module=nodenext,moduleresolution=nodenext).trace.json +++ b/tests/baselines/reference/bundlerDirectoryModule(module=nodenext,moduleresolution=nodenext).trace.json @@ -197,5 +197,7 @@ "File '/.ts/package.json' does not exist according to earlier cached lookups.", "File '/package.json' does not exist according to earlier cached lookups.", "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", "File '/package.json' does not exist according to earlier cached lookups." ] \ No newline at end of file diff --git a/tests/baselines/reference/config/commandLineParsing/parseCommandLine/Parse --lib option with extra comma.js b/tests/baselines/reference/config/commandLineParsing/parseCommandLine/Parse --lib option with extra comma.js index 7a621f1fa7d2b..28078f4009854 100644 --- a/tests/baselines/reference/config/commandLineParsing/parseCommandLine/Parse --lib option with extra comma.js +++ b/tests/baselines/reference/config/commandLineParsing/parseCommandLine/Parse --lib option with extra comma.js @@ -10,4 +10,4 @@ WatchOptions:: FileNames:: es7,0.ts Errors:: -error TS6046: Argument for '--lib' option must be: 'es5', 'es6', 'es2015', 'es7', 'es2016', 'es2017', 'es2018', 'es2019', 'es2020', 'es2021', 'es2022', 'es2023', 'es2024', 'esnext', 'dom', 'dom.iterable', 'dom.asynciterable', 'webworker', 'webworker.importscripts', 'webworker.iterable', 'webworker.asynciterable', 'scripthost', 'es2015.core', 'es2015.collection', 'es2015.generator', 'es2015.iterable', 'es2015.promise', 'es2015.proxy', 'es2015.reflect', 'es2015.symbol', 'es2015.symbol.wellknown', 'es2016.array.include', 'es2016.intl', 'es2017.arraybuffer', 'es2017.date', 'es2017.object', 'es2017.sharedmemory', 'es2017.string', 'es2017.intl', 'es2017.typedarrays', 'es2018.asyncgenerator', 'es2018.asynciterable', 'es2018.intl', 'es2018.promise', 'es2018.regexp', 'es2019.array', 'es2019.object', 'es2019.string', 'es2019.symbol', 'es2019.intl', 'es2020.bigint', 'es2020.date', 'es2020.promise', 'es2020.sharedmemory', 'es2020.string', 'es2020.symbol.wellknown', 'es2020.intl', 'es2020.number', 'es2021.promise', 'es2021.string', 'es2021.weakref', 'es2021.intl', 'es2022.array', 'es2022.error', 'es2022.intl', 'es2022.object', 'es2022.string', 'es2022.regexp', 'es2023.array', 'es2023.collection', 'es2023.intl', 'es2024.arraybuffer', 'es2024.collection', 'es2024.object', 'es2024.promise', 'es2024.regexp', 'es2024.sharedmemory', 'es2024.string', 'esnext.array', 'esnext.collection', 'esnext.symbol', 'esnext.asynciterable', 'esnext.intl', 'esnext.disposable', 'esnext.bigint', 'esnext.string', 'esnext.promise', 'esnext.weakref', 'esnext.decorators', 'esnext.object', 'esnext.regexp', 'esnext.iterator', 'esnext.float16', 'esnext.typedarrays', 'esnext.error', 'esnext.sharedmemory', 'esnext.temporal', 'decorators', 'decorators.legacy'. +error TS6046: Argument for '--lib' option must be: 'es5', 'es6', 'es2015', 'es7', 'es2016', 'es2017', 'es2018', 'es2019', 'es2020', 'es2021', 'es2022', 'es2023', 'es2024', 'esnext', 'dom', 'dom.iterable', 'dom.asynciterable', 'webworker', 'webworker.importscripts', 'webworker.iterable', 'webworker.asynciterable', 'scripthost', 'es2015.core', 'es2015.collection', 'es2015.generator', 'es2015.iterable', 'es2015.promise', 'es2015.proxy', 'es2015.reflect', 'es2015.symbol', 'es2015.symbol.wellknown', 'es2016.array.include', 'es2016.intl', 'es2017.arraybuffer', 'es2017.date', 'es2017.object', 'es2017.sharedmemory', 'es2017.string', 'es2017.intl', 'es2017.typedarrays', 'es2018.asyncgenerator', 'es2018.asynciterable', 'es2018.intl', 'es2018.promise', 'es2018.regexp', 'es2019.array', 'es2019.object', 'es2019.string', 'es2019.symbol', 'es2019.intl', 'es2020.bigint', 'es2020.date', 'es2020.promise', 'es2020.sharedmemory', 'es2020.string', 'es2020.symbol.wellknown', 'es2020.intl', 'es2020.number', 'es2021.promise', 'es2021.string', 'es2021.weakref', 'es2021.intl', 'es2022.array', 'es2022.error', 'es2022.intl', 'es2022.object', 'es2022.string', 'es2022.regexp', 'es2023.array', 'es2023.collection', 'es2023.intl', 'es2024.arraybuffer', 'es2024.collection', 'es2024.object', 'es2024.promise', 'es2024.regexp', 'es2024.sharedmemory', 'es2024.string', 'esnext.array', 'esnext.collection', 'esnext.symbol', 'esnext.asynciterable', 'esnext.intl', 'esnext.disposable', 'esnext.bigint', 'esnext.string', 'esnext.promise', 'esnext.weakref', 'esnext.decorators', 'esnext.object', 'esnext.regexp', 'esnext.iterator', 'esnext.float16', 'esnext.typedarrays', 'esnext.error', 'esnext.sharedmemory', 'esnext.temporal', 'esnext.date', 'decorators', 'decorators.legacy'. diff --git a/tests/baselines/reference/config/commandLineParsing/parseCommandLine/Parse --lib option with trailing white-space.js b/tests/baselines/reference/config/commandLineParsing/parseCommandLine/Parse --lib option with trailing white-space.js index 001b66a01e12e..dc90c6b06768a 100644 --- a/tests/baselines/reference/config/commandLineParsing/parseCommandLine/Parse --lib option with trailing white-space.js +++ b/tests/baselines/reference/config/commandLineParsing/parseCommandLine/Parse --lib option with trailing white-space.js @@ -10,4 +10,4 @@ WatchOptions:: FileNames:: es7,0.ts Errors:: -error TS6046: Argument for '--lib' option must be: 'es5', 'es6', 'es2015', 'es7', 'es2016', 'es2017', 'es2018', 'es2019', 'es2020', 'es2021', 'es2022', 'es2023', 'es2024', 'esnext', 'dom', 'dom.iterable', 'dom.asynciterable', 'webworker', 'webworker.importscripts', 'webworker.iterable', 'webworker.asynciterable', 'scripthost', 'es2015.core', 'es2015.collection', 'es2015.generator', 'es2015.iterable', 'es2015.promise', 'es2015.proxy', 'es2015.reflect', 'es2015.symbol', 'es2015.symbol.wellknown', 'es2016.array.include', 'es2016.intl', 'es2017.arraybuffer', 'es2017.date', 'es2017.object', 'es2017.sharedmemory', 'es2017.string', 'es2017.intl', 'es2017.typedarrays', 'es2018.asyncgenerator', 'es2018.asynciterable', 'es2018.intl', 'es2018.promise', 'es2018.regexp', 'es2019.array', 'es2019.object', 'es2019.string', 'es2019.symbol', 'es2019.intl', 'es2020.bigint', 'es2020.date', 'es2020.promise', 'es2020.sharedmemory', 'es2020.string', 'es2020.symbol.wellknown', 'es2020.intl', 'es2020.number', 'es2021.promise', 'es2021.string', 'es2021.weakref', 'es2021.intl', 'es2022.array', 'es2022.error', 'es2022.intl', 'es2022.object', 'es2022.string', 'es2022.regexp', 'es2023.array', 'es2023.collection', 'es2023.intl', 'es2024.arraybuffer', 'es2024.collection', 'es2024.object', 'es2024.promise', 'es2024.regexp', 'es2024.sharedmemory', 'es2024.string', 'esnext.array', 'esnext.collection', 'esnext.symbol', 'esnext.asynciterable', 'esnext.intl', 'esnext.disposable', 'esnext.bigint', 'esnext.string', 'esnext.promise', 'esnext.weakref', 'esnext.decorators', 'esnext.object', 'esnext.regexp', 'esnext.iterator', 'esnext.float16', 'esnext.typedarrays', 'esnext.error', 'esnext.sharedmemory', 'esnext.temporal', 'decorators', 'decorators.legacy'. +error TS6046: Argument for '--lib' option must be: 'es5', 'es6', 'es2015', 'es7', 'es2016', 'es2017', 'es2018', 'es2019', 'es2020', 'es2021', 'es2022', 'es2023', 'es2024', 'esnext', 'dom', 'dom.iterable', 'dom.asynciterable', 'webworker', 'webworker.importscripts', 'webworker.iterable', 'webworker.asynciterable', 'scripthost', 'es2015.core', 'es2015.collection', 'es2015.generator', 'es2015.iterable', 'es2015.promise', 'es2015.proxy', 'es2015.reflect', 'es2015.symbol', 'es2015.symbol.wellknown', 'es2016.array.include', 'es2016.intl', 'es2017.arraybuffer', 'es2017.date', 'es2017.object', 'es2017.sharedmemory', 'es2017.string', 'es2017.intl', 'es2017.typedarrays', 'es2018.asyncgenerator', 'es2018.asynciterable', 'es2018.intl', 'es2018.promise', 'es2018.regexp', 'es2019.array', 'es2019.object', 'es2019.string', 'es2019.symbol', 'es2019.intl', 'es2020.bigint', 'es2020.date', 'es2020.promise', 'es2020.sharedmemory', 'es2020.string', 'es2020.symbol.wellknown', 'es2020.intl', 'es2020.number', 'es2021.promise', 'es2021.string', 'es2021.weakref', 'es2021.intl', 'es2022.array', 'es2022.error', 'es2022.intl', 'es2022.object', 'es2022.string', 'es2022.regexp', 'es2023.array', 'es2023.collection', 'es2023.intl', 'es2024.arraybuffer', 'es2024.collection', 'es2024.object', 'es2024.promise', 'es2024.regexp', 'es2024.sharedmemory', 'es2024.string', 'esnext.array', 'esnext.collection', 'esnext.symbol', 'esnext.asynciterable', 'esnext.intl', 'esnext.disposable', 'esnext.bigint', 'esnext.string', 'esnext.promise', 'esnext.weakref', 'esnext.decorators', 'esnext.object', 'esnext.regexp', 'esnext.iterator', 'esnext.float16', 'esnext.typedarrays', 'esnext.error', 'esnext.sharedmemory', 'esnext.temporal', 'esnext.date', 'decorators', 'decorators.legacy'. diff --git a/tests/baselines/reference/config/commandLineParsing/parseCommandLine/Parse invalid option of library flags.js b/tests/baselines/reference/config/commandLineParsing/parseCommandLine/Parse invalid option of library flags.js index 01267eb10ac3c..4dfe25309339f 100644 --- a/tests/baselines/reference/config/commandLineParsing/parseCommandLine/Parse invalid option of library flags.js +++ b/tests/baselines/reference/config/commandLineParsing/parseCommandLine/Parse invalid option of library flags.js @@ -10,4 +10,4 @@ WatchOptions:: FileNames:: 0.ts Errors:: -error TS6046: Argument for '--lib' option must be: 'es5', 'es6', 'es2015', 'es7', 'es2016', 'es2017', 'es2018', 'es2019', 'es2020', 'es2021', 'es2022', 'es2023', 'es2024', 'esnext', 'dom', 'dom.iterable', 'dom.asynciterable', 'webworker', 'webworker.importscripts', 'webworker.iterable', 'webworker.asynciterable', 'scripthost', 'es2015.core', 'es2015.collection', 'es2015.generator', 'es2015.iterable', 'es2015.promise', 'es2015.proxy', 'es2015.reflect', 'es2015.symbol', 'es2015.symbol.wellknown', 'es2016.array.include', 'es2016.intl', 'es2017.arraybuffer', 'es2017.date', 'es2017.object', 'es2017.sharedmemory', 'es2017.string', 'es2017.intl', 'es2017.typedarrays', 'es2018.asyncgenerator', 'es2018.asynciterable', 'es2018.intl', 'es2018.promise', 'es2018.regexp', 'es2019.array', 'es2019.object', 'es2019.string', 'es2019.symbol', 'es2019.intl', 'es2020.bigint', 'es2020.date', 'es2020.promise', 'es2020.sharedmemory', 'es2020.string', 'es2020.symbol.wellknown', 'es2020.intl', 'es2020.number', 'es2021.promise', 'es2021.string', 'es2021.weakref', 'es2021.intl', 'es2022.array', 'es2022.error', 'es2022.intl', 'es2022.object', 'es2022.string', 'es2022.regexp', 'es2023.array', 'es2023.collection', 'es2023.intl', 'es2024.arraybuffer', 'es2024.collection', 'es2024.object', 'es2024.promise', 'es2024.regexp', 'es2024.sharedmemory', 'es2024.string', 'esnext.array', 'esnext.collection', 'esnext.symbol', 'esnext.asynciterable', 'esnext.intl', 'esnext.disposable', 'esnext.bigint', 'esnext.string', 'esnext.promise', 'esnext.weakref', 'esnext.decorators', 'esnext.object', 'esnext.regexp', 'esnext.iterator', 'esnext.float16', 'esnext.typedarrays', 'esnext.error', 'esnext.sharedmemory', 'esnext.temporal', 'decorators', 'decorators.legacy'. +error TS6046: Argument for '--lib' option must be: 'es5', 'es6', 'es2015', 'es7', 'es2016', 'es2017', 'es2018', 'es2019', 'es2020', 'es2021', 'es2022', 'es2023', 'es2024', 'esnext', 'dom', 'dom.iterable', 'dom.asynciterable', 'webworker', 'webworker.importscripts', 'webworker.iterable', 'webworker.asynciterable', 'scripthost', 'es2015.core', 'es2015.collection', 'es2015.generator', 'es2015.iterable', 'es2015.promise', 'es2015.proxy', 'es2015.reflect', 'es2015.symbol', 'es2015.symbol.wellknown', 'es2016.array.include', 'es2016.intl', 'es2017.arraybuffer', 'es2017.date', 'es2017.object', 'es2017.sharedmemory', 'es2017.string', 'es2017.intl', 'es2017.typedarrays', 'es2018.asyncgenerator', 'es2018.asynciterable', 'es2018.intl', 'es2018.promise', 'es2018.regexp', 'es2019.array', 'es2019.object', 'es2019.string', 'es2019.symbol', 'es2019.intl', 'es2020.bigint', 'es2020.date', 'es2020.promise', 'es2020.sharedmemory', 'es2020.string', 'es2020.symbol.wellknown', 'es2020.intl', 'es2020.number', 'es2021.promise', 'es2021.string', 'es2021.weakref', 'es2021.intl', 'es2022.array', 'es2022.error', 'es2022.intl', 'es2022.object', 'es2022.string', 'es2022.regexp', 'es2023.array', 'es2023.collection', 'es2023.intl', 'es2024.arraybuffer', 'es2024.collection', 'es2024.object', 'es2024.promise', 'es2024.regexp', 'es2024.sharedmemory', 'es2024.string', 'esnext.array', 'esnext.collection', 'esnext.symbol', 'esnext.asynciterable', 'esnext.intl', 'esnext.disposable', 'esnext.bigint', 'esnext.string', 'esnext.promise', 'esnext.weakref', 'esnext.decorators', 'esnext.object', 'esnext.regexp', 'esnext.iterator', 'esnext.float16', 'esnext.typedarrays', 'esnext.error', 'esnext.sharedmemory', 'esnext.temporal', 'esnext.date', 'decorators', 'decorators.legacy'. diff --git a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert empty string option of libs array to compiler-options with json api.js b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert empty string option of libs array to compiler-options with json api.js index caf29f2f8c3be..bea44d823e123 100644 --- a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert empty string option of libs array to compiler-options with json api.js +++ b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert empty string option of libs array to compiler-options with json api.js @@ -30,5 +30,5 @@ CompilerOptions:: "configFilePath": "/apath/tsconfig.json" } Errors:: -error TS6046: Argument for '--lib' option must be: 'es5', 'es6', 'es2015', 'es7', 'es2016', 'es2017', 'es2018', 'es2019', 'es2020', 'es2021', 'es2022', 'es2023', 'es2024', 'esnext', 'dom', 'dom.iterable', 'dom.asynciterable', 'webworker', 'webworker.importscripts', 'webworker.iterable', 'webworker.asynciterable', 'scripthost', 'es2015.core', 'es2015.collection', 'es2015.generator', 'es2015.iterable', 'es2015.promise', 'es2015.proxy', 'es2015.reflect', 'es2015.symbol', 'es2015.symbol.wellknown', 'es2016.array.include', 'es2016.intl', 'es2017.arraybuffer', 'es2017.date', 'es2017.object', 'es2017.sharedmemory', 'es2017.string', 'es2017.intl', 'es2017.typedarrays', 'es2018.asyncgenerator', 'es2018.asynciterable', 'es2018.intl', 'es2018.promise', 'es2018.regexp', 'es2019.array', 'es2019.object', 'es2019.string', 'es2019.symbol', 'es2019.intl', 'es2020.bigint', 'es2020.date', 'es2020.promise', 'es2020.sharedmemory', 'es2020.string', 'es2020.symbol.wellknown', 'es2020.intl', 'es2020.number', 'es2021.promise', 'es2021.string', 'es2021.weakref', 'es2021.intl', 'es2022.array', 'es2022.error', 'es2022.intl', 'es2022.object', 'es2022.string', 'es2022.regexp', 'es2023.array', 'es2023.collection', 'es2023.intl', 'es2024.arraybuffer', 'es2024.collection', 'es2024.object', 'es2024.promise', 'es2024.regexp', 'es2024.sharedmemory', 'es2024.string', 'esnext.array', 'esnext.collection', 'esnext.symbol', 'esnext.asynciterable', 'esnext.intl', 'esnext.disposable', 'esnext.bigint', 'esnext.string', 'esnext.promise', 'esnext.weakref', 'esnext.decorators', 'esnext.object', 'esnext.regexp', 'esnext.iterator', 'esnext.float16', 'esnext.typedarrays', 'esnext.error', 'esnext.sharedmemory', 'esnext.temporal', 'decorators', 'decorators.legacy'. +error TS6046: Argument for '--lib' option must be: 'es5', 'es6', 'es2015', 'es7', 'es2016', 'es2017', 'es2018', 'es2019', 'es2020', 'es2021', 'es2022', 'es2023', 'es2024', 'esnext', 'dom', 'dom.iterable', 'dom.asynciterable', 'webworker', 'webworker.importscripts', 'webworker.iterable', 'webworker.asynciterable', 'scripthost', 'es2015.core', 'es2015.collection', 'es2015.generator', 'es2015.iterable', 'es2015.promise', 'es2015.proxy', 'es2015.reflect', 'es2015.symbol', 'es2015.symbol.wellknown', 'es2016.array.include', 'es2016.intl', 'es2017.arraybuffer', 'es2017.date', 'es2017.object', 'es2017.sharedmemory', 'es2017.string', 'es2017.intl', 'es2017.typedarrays', 'es2018.asyncgenerator', 'es2018.asynciterable', 'es2018.intl', 'es2018.promise', 'es2018.regexp', 'es2019.array', 'es2019.object', 'es2019.string', 'es2019.symbol', 'es2019.intl', 'es2020.bigint', 'es2020.date', 'es2020.promise', 'es2020.sharedmemory', 'es2020.string', 'es2020.symbol.wellknown', 'es2020.intl', 'es2020.number', 'es2021.promise', 'es2021.string', 'es2021.weakref', 'es2021.intl', 'es2022.array', 'es2022.error', 'es2022.intl', 'es2022.object', 'es2022.string', 'es2022.regexp', 'es2023.array', 'es2023.collection', 'es2023.intl', 'es2024.arraybuffer', 'es2024.collection', 'es2024.object', 'es2024.promise', 'es2024.regexp', 'es2024.sharedmemory', 'es2024.string', 'esnext.array', 'esnext.collection', 'esnext.symbol', 'esnext.asynciterable', 'esnext.intl', 'esnext.disposable', 'esnext.bigint', 'esnext.string', 'esnext.promise', 'esnext.weakref', 'esnext.decorators', 'esnext.object', 'esnext.regexp', 'esnext.iterator', 'esnext.float16', 'esnext.typedarrays', 'esnext.error', 'esnext.sharedmemory', 'esnext.temporal', 'esnext.date', 'decorators', 'decorators.legacy'. diff --git a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert empty string option of libs array to compiler-options with jsonSourceFile api.js b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert empty string option of libs array to compiler-options with jsonSourceFile api.js index 6b8bf7028329f..c140b656eca84 100644 --- a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert empty string option of libs array to compiler-options with jsonSourceFile api.js +++ b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert empty string option of libs array to compiler-options with jsonSourceFile api.js @@ -30,7 +30,7 @@ CompilerOptions:: "configFilePath": "/apath/tsconfig.json" } Errors:: -tsconfig.json:8:7 - error TS6046: Argument for '--lib' option must be: 'es5', 'es6', 'es2015', 'es7', 'es2016', 'es2017', 'es2018', 'es2019', 'es2020', 'es2021', 'es2022', 'es2023', 'es2024', 'esnext', 'dom', 'dom.iterable', 'dom.asynciterable', 'webworker', 'webworker.importscripts', 'webworker.iterable', 'webworker.asynciterable', 'scripthost', 'es2015.core', 'es2015.collection', 'es2015.generator', 'es2015.iterable', 'es2015.promise', 'es2015.proxy', 'es2015.reflect', 'es2015.symbol', 'es2015.symbol.wellknown', 'es2016.array.include', 'es2016.intl', 'es2017.arraybuffer', 'es2017.date', 'es2017.object', 'es2017.sharedmemory', 'es2017.string', 'es2017.intl', 'es2017.typedarrays', 'es2018.asyncgenerator', 'es2018.asynciterable', 'es2018.intl', 'es2018.promise', 'es2018.regexp', 'es2019.array', 'es2019.object', 'es2019.string', 'es2019.symbol', 'es2019.intl', 'es2020.bigint', 'es2020.date', 'es2020.promise', 'es2020.sharedmemory', 'es2020.string', 'es2020.symbol.wellknown', 'es2020.intl', 'es2020.number', 'es2021.promise', 'es2021.string', 'es2021.weakref', 'es2021.intl', 'es2022.array', 'es2022.error', 'es2022.intl', 'es2022.object', 'es2022.string', 'es2022.regexp', 'es2023.array', 'es2023.collection', 'es2023.intl', 'es2024.arraybuffer', 'es2024.collection', 'es2024.object', 'es2024.promise', 'es2024.regexp', 'es2024.sharedmemory', 'es2024.string', 'esnext.array', 'esnext.collection', 'esnext.symbol', 'esnext.asynciterable', 'esnext.intl', 'esnext.disposable', 'esnext.bigint', 'esnext.string', 'esnext.promise', 'esnext.weakref', 'esnext.decorators', 'esnext.object', 'esnext.regexp', 'esnext.iterator', 'esnext.float16', 'esnext.typedarrays', 'esnext.error', 'esnext.sharedmemory', 'esnext.temporal', 'decorators', 'decorators.legacy'. +tsconfig.json:8:7 - error TS6046: Argument for '--lib' option must be: 'es5', 'es6', 'es2015', 'es7', 'es2016', 'es2017', 'es2018', 'es2019', 'es2020', 'es2021', 'es2022', 'es2023', 'es2024', 'esnext', 'dom', 'dom.iterable', 'dom.asynciterable', 'webworker', 'webworker.importscripts', 'webworker.iterable', 'webworker.asynciterable', 'scripthost', 'es2015.core', 'es2015.collection', 'es2015.generator', 'es2015.iterable', 'es2015.promise', 'es2015.proxy', 'es2015.reflect', 'es2015.symbol', 'es2015.symbol.wellknown', 'es2016.array.include', 'es2016.intl', 'es2017.arraybuffer', 'es2017.date', 'es2017.object', 'es2017.sharedmemory', 'es2017.string', 'es2017.intl', 'es2017.typedarrays', 'es2018.asyncgenerator', 'es2018.asynciterable', 'es2018.intl', 'es2018.promise', 'es2018.regexp', 'es2019.array', 'es2019.object', 'es2019.string', 'es2019.symbol', 'es2019.intl', 'es2020.bigint', 'es2020.date', 'es2020.promise', 'es2020.sharedmemory', 'es2020.string', 'es2020.symbol.wellknown', 'es2020.intl', 'es2020.number', 'es2021.promise', 'es2021.string', 'es2021.weakref', 'es2021.intl', 'es2022.array', 'es2022.error', 'es2022.intl', 'es2022.object', 'es2022.string', 'es2022.regexp', 'es2023.array', 'es2023.collection', 'es2023.intl', 'es2024.arraybuffer', 'es2024.collection', 'es2024.object', 'es2024.promise', 'es2024.regexp', 'es2024.sharedmemory', 'es2024.string', 'esnext.array', 'esnext.collection', 'esnext.symbol', 'esnext.asynciterable', 'esnext.intl', 'esnext.disposable', 'esnext.bigint', 'esnext.string', 'esnext.promise', 'esnext.weakref', 'esnext.decorators', 'esnext.object', 'esnext.regexp', 'esnext.iterator', 'esnext.float16', 'esnext.typedarrays', 'esnext.error', 'esnext.sharedmemory', 'esnext.temporal', 'esnext.date', 'decorators', 'decorators.legacy'. 8 ""    ~~ diff --git a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert empty string option of libs to compiler-options with json api.js b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert empty string option of libs to compiler-options with json api.js index dec1bab9806ca..e394baf77c030 100644 --- a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert empty string option of libs to compiler-options with json api.js +++ b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert empty string option of libs to compiler-options with json api.js @@ -33,5 +33,5 @@ CompilerOptions:: "configFilePath": "/apath/tsconfig.json" } Errors:: -error TS6046: Argument for '--lib' option must be: 'es5', 'es6', 'es2015', 'es7', 'es2016', 'es2017', 'es2018', 'es2019', 'es2020', 'es2021', 'es2022', 'es2023', 'es2024', 'esnext', 'dom', 'dom.iterable', 'dom.asynciterable', 'webworker', 'webworker.importscripts', 'webworker.iterable', 'webworker.asynciterable', 'scripthost', 'es2015.core', 'es2015.collection', 'es2015.generator', 'es2015.iterable', 'es2015.promise', 'es2015.proxy', 'es2015.reflect', 'es2015.symbol', 'es2015.symbol.wellknown', 'es2016.array.include', 'es2016.intl', 'es2017.arraybuffer', 'es2017.date', 'es2017.object', 'es2017.sharedmemory', 'es2017.string', 'es2017.intl', 'es2017.typedarrays', 'es2018.asyncgenerator', 'es2018.asynciterable', 'es2018.intl', 'es2018.promise', 'es2018.regexp', 'es2019.array', 'es2019.object', 'es2019.string', 'es2019.symbol', 'es2019.intl', 'es2020.bigint', 'es2020.date', 'es2020.promise', 'es2020.sharedmemory', 'es2020.string', 'es2020.symbol.wellknown', 'es2020.intl', 'es2020.number', 'es2021.promise', 'es2021.string', 'es2021.weakref', 'es2021.intl', 'es2022.array', 'es2022.error', 'es2022.intl', 'es2022.object', 'es2022.string', 'es2022.regexp', 'es2023.array', 'es2023.collection', 'es2023.intl', 'es2024.arraybuffer', 'es2024.collection', 'es2024.object', 'es2024.promise', 'es2024.regexp', 'es2024.sharedmemory', 'es2024.string', 'esnext.array', 'esnext.collection', 'esnext.symbol', 'esnext.asynciterable', 'esnext.intl', 'esnext.disposable', 'esnext.bigint', 'esnext.string', 'esnext.promise', 'esnext.weakref', 'esnext.decorators', 'esnext.object', 'esnext.regexp', 'esnext.iterator', 'esnext.float16', 'esnext.typedarrays', 'esnext.error', 'esnext.sharedmemory', 'esnext.temporal', 'decorators', 'decorators.legacy'. +error TS6046: Argument for '--lib' option must be: 'es5', 'es6', 'es2015', 'es7', 'es2016', 'es2017', 'es2018', 'es2019', 'es2020', 'es2021', 'es2022', 'es2023', 'es2024', 'esnext', 'dom', 'dom.iterable', 'dom.asynciterable', 'webworker', 'webworker.importscripts', 'webworker.iterable', 'webworker.asynciterable', 'scripthost', 'es2015.core', 'es2015.collection', 'es2015.generator', 'es2015.iterable', 'es2015.promise', 'es2015.proxy', 'es2015.reflect', 'es2015.symbol', 'es2015.symbol.wellknown', 'es2016.array.include', 'es2016.intl', 'es2017.arraybuffer', 'es2017.date', 'es2017.object', 'es2017.sharedmemory', 'es2017.string', 'es2017.intl', 'es2017.typedarrays', 'es2018.asyncgenerator', 'es2018.asynciterable', 'es2018.intl', 'es2018.promise', 'es2018.regexp', 'es2019.array', 'es2019.object', 'es2019.string', 'es2019.symbol', 'es2019.intl', 'es2020.bigint', 'es2020.date', 'es2020.promise', 'es2020.sharedmemory', 'es2020.string', 'es2020.symbol.wellknown', 'es2020.intl', 'es2020.number', 'es2021.promise', 'es2021.string', 'es2021.weakref', 'es2021.intl', 'es2022.array', 'es2022.error', 'es2022.intl', 'es2022.object', 'es2022.string', 'es2022.regexp', 'es2023.array', 'es2023.collection', 'es2023.intl', 'es2024.arraybuffer', 'es2024.collection', 'es2024.object', 'es2024.promise', 'es2024.regexp', 'es2024.sharedmemory', 'es2024.string', 'esnext.array', 'esnext.collection', 'esnext.symbol', 'esnext.asynciterable', 'esnext.intl', 'esnext.disposable', 'esnext.bigint', 'esnext.string', 'esnext.promise', 'esnext.weakref', 'esnext.decorators', 'esnext.object', 'esnext.regexp', 'esnext.iterator', 'esnext.float16', 'esnext.typedarrays', 'esnext.error', 'esnext.sharedmemory', 'esnext.temporal', 'esnext.date', 'decorators', 'decorators.legacy'. diff --git a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert empty string option of libs to compiler-options with jsonSourceFile api.js b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert empty string option of libs to compiler-options with jsonSourceFile api.js index 5c672139ca785..e183033478458 100644 --- a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert empty string option of libs to compiler-options with jsonSourceFile api.js +++ b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert empty string option of libs to compiler-options with jsonSourceFile api.js @@ -33,7 +33,7 @@ CompilerOptions:: "configFilePath": "/apath/tsconfig.json" } Errors:: -tsconfig.json:9:7 - error TS6046: Argument for '--lib' option must be: 'es5', 'es6', 'es2015', 'es7', 'es2016', 'es2017', 'es2018', 'es2019', 'es2020', 'es2021', 'es2022', 'es2023', 'es2024', 'esnext', 'dom', 'dom.iterable', 'dom.asynciterable', 'webworker', 'webworker.importscripts', 'webworker.iterable', 'webworker.asynciterable', 'scripthost', 'es2015.core', 'es2015.collection', 'es2015.generator', 'es2015.iterable', 'es2015.promise', 'es2015.proxy', 'es2015.reflect', 'es2015.symbol', 'es2015.symbol.wellknown', 'es2016.array.include', 'es2016.intl', 'es2017.arraybuffer', 'es2017.date', 'es2017.object', 'es2017.sharedmemory', 'es2017.string', 'es2017.intl', 'es2017.typedarrays', 'es2018.asyncgenerator', 'es2018.asynciterable', 'es2018.intl', 'es2018.promise', 'es2018.regexp', 'es2019.array', 'es2019.object', 'es2019.string', 'es2019.symbol', 'es2019.intl', 'es2020.bigint', 'es2020.date', 'es2020.promise', 'es2020.sharedmemory', 'es2020.string', 'es2020.symbol.wellknown', 'es2020.intl', 'es2020.number', 'es2021.promise', 'es2021.string', 'es2021.weakref', 'es2021.intl', 'es2022.array', 'es2022.error', 'es2022.intl', 'es2022.object', 'es2022.string', 'es2022.regexp', 'es2023.array', 'es2023.collection', 'es2023.intl', 'es2024.arraybuffer', 'es2024.collection', 'es2024.object', 'es2024.promise', 'es2024.regexp', 'es2024.sharedmemory', 'es2024.string', 'esnext.array', 'esnext.collection', 'esnext.symbol', 'esnext.asynciterable', 'esnext.intl', 'esnext.disposable', 'esnext.bigint', 'esnext.string', 'esnext.promise', 'esnext.weakref', 'esnext.decorators', 'esnext.object', 'esnext.regexp', 'esnext.iterator', 'esnext.float16', 'esnext.typedarrays', 'esnext.error', 'esnext.sharedmemory', 'esnext.temporal', 'decorators', 'decorators.legacy'. +tsconfig.json:9:7 - error TS6046: Argument for '--lib' option must be: 'es5', 'es6', 'es2015', 'es7', 'es2016', 'es2017', 'es2018', 'es2019', 'es2020', 'es2021', 'es2022', 'es2023', 'es2024', 'esnext', 'dom', 'dom.iterable', 'dom.asynciterable', 'webworker', 'webworker.importscripts', 'webworker.iterable', 'webworker.asynciterable', 'scripthost', 'es2015.core', 'es2015.collection', 'es2015.generator', 'es2015.iterable', 'es2015.promise', 'es2015.proxy', 'es2015.reflect', 'es2015.symbol', 'es2015.symbol.wellknown', 'es2016.array.include', 'es2016.intl', 'es2017.arraybuffer', 'es2017.date', 'es2017.object', 'es2017.sharedmemory', 'es2017.string', 'es2017.intl', 'es2017.typedarrays', 'es2018.asyncgenerator', 'es2018.asynciterable', 'es2018.intl', 'es2018.promise', 'es2018.regexp', 'es2019.array', 'es2019.object', 'es2019.string', 'es2019.symbol', 'es2019.intl', 'es2020.bigint', 'es2020.date', 'es2020.promise', 'es2020.sharedmemory', 'es2020.string', 'es2020.symbol.wellknown', 'es2020.intl', 'es2020.number', 'es2021.promise', 'es2021.string', 'es2021.weakref', 'es2021.intl', 'es2022.array', 'es2022.error', 'es2022.intl', 'es2022.object', 'es2022.string', 'es2022.regexp', 'es2023.array', 'es2023.collection', 'es2023.intl', 'es2024.arraybuffer', 'es2024.collection', 'es2024.object', 'es2024.promise', 'es2024.regexp', 'es2024.sharedmemory', 'es2024.string', 'esnext.array', 'esnext.collection', 'esnext.symbol', 'esnext.asynciterable', 'esnext.intl', 'esnext.disposable', 'esnext.bigint', 'esnext.string', 'esnext.promise', 'esnext.weakref', 'esnext.decorators', 'esnext.object', 'esnext.regexp', 'esnext.iterator', 'esnext.float16', 'esnext.typedarrays', 'esnext.error', 'esnext.sharedmemory', 'esnext.temporal', 'esnext.date', 'decorators', 'decorators.legacy'. 9 ""    ~~ diff --git a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert incorrect option of libs to compiler-options with json api.js b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert incorrect option of libs to compiler-options with json api.js index 193526d720770..9bb8ba5f3faba 100644 --- a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert incorrect option of libs to compiler-options with json api.js +++ b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert incorrect option of libs to compiler-options with json api.js @@ -35,5 +35,5 @@ CompilerOptions:: "configFilePath": "/apath/tsconfig.json" } Errors:: -error TS6046: Argument for '--lib' option must be: 'es5', 'es6', 'es2015', 'es7', 'es2016', 'es2017', 'es2018', 'es2019', 'es2020', 'es2021', 'es2022', 'es2023', 'es2024', 'esnext', 'dom', 'dom.iterable', 'dom.asynciterable', 'webworker', 'webworker.importscripts', 'webworker.iterable', 'webworker.asynciterable', 'scripthost', 'es2015.core', 'es2015.collection', 'es2015.generator', 'es2015.iterable', 'es2015.promise', 'es2015.proxy', 'es2015.reflect', 'es2015.symbol', 'es2015.symbol.wellknown', 'es2016.array.include', 'es2016.intl', 'es2017.arraybuffer', 'es2017.date', 'es2017.object', 'es2017.sharedmemory', 'es2017.string', 'es2017.intl', 'es2017.typedarrays', 'es2018.asyncgenerator', 'es2018.asynciterable', 'es2018.intl', 'es2018.promise', 'es2018.regexp', 'es2019.array', 'es2019.object', 'es2019.string', 'es2019.symbol', 'es2019.intl', 'es2020.bigint', 'es2020.date', 'es2020.promise', 'es2020.sharedmemory', 'es2020.string', 'es2020.symbol.wellknown', 'es2020.intl', 'es2020.number', 'es2021.promise', 'es2021.string', 'es2021.weakref', 'es2021.intl', 'es2022.array', 'es2022.error', 'es2022.intl', 'es2022.object', 'es2022.string', 'es2022.regexp', 'es2023.array', 'es2023.collection', 'es2023.intl', 'es2024.arraybuffer', 'es2024.collection', 'es2024.object', 'es2024.promise', 'es2024.regexp', 'es2024.sharedmemory', 'es2024.string', 'esnext.array', 'esnext.collection', 'esnext.symbol', 'esnext.asynciterable', 'esnext.intl', 'esnext.disposable', 'esnext.bigint', 'esnext.string', 'esnext.promise', 'esnext.weakref', 'esnext.decorators', 'esnext.object', 'esnext.regexp', 'esnext.iterator', 'esnext.float16', 'esnext.typedarrays', 'esnext.error', 'esnext.sharedmemory', 'esnext.temporal', 'decorators', 'decorators.legacy'. +error TS6046: Argument for '--lib' option must be: 'es5', 'es6', 'es2015', 'es7', 'es2016', 'es2017', 'es2018', 'es2019', 'es2020', 'es2021', 'es2022', 'es2023', 'es2024', 'esnext', 'dom', 'dom.iterable', 'dom.asynciterable', 'webworker', 'webworker.importscripts', 'webworker.iterable', 'webworker.asynciterable', 'scripthost', 'es2015.core', 'es2015.collection', 'es2015.generator', 'es2015.iterable', 'es2015.promise', 'es2015.proxy', 'es2015.reflect', 'es2015.symbol', 'es2015.symbol.wellknown', 'es2016.array.include', 'es2016.intl', 'es2017.arraybuffer', 'es2017.date', 'es2017.object', 'es2017.sharedmemory', 'es2017.string', 'es2017.intl', 'es2017.typedarrays', 'es2018.asyncgenerator', 'es2018.asynciterable', 'es2018.intl', 'es2018.promise', 'es2018.regexp', 'es2019.array', 'es2019.object', 'es2019.string', 'es2019.symbol', 'es2019.intl', 'es2020.bigint', 'es2020.date', 'es2020.promise', 'es2020.sharedmemory', 'es2020.string', 'es2020.symbol.wellknown', 'es2020.intl', 'es2020.number', 'es2021.promise', 'es2021.string', 'es2021.weakref', 'es2021.intl', 'es2022.array', 'es2022.error', 'es2022.intl', 'es2022.object', 'es2022.string', 'es2022.regexp', 'es2023.array', 'es2023.collection', 'es2023.intl', 'es2024.arraybuffer', 'es2024.collection', 'es2024.object', 'es2024.promise', 'es2024.regexp', 'es2024.sharedmemory', 'es2024.string', 'esnext.array', 'esnext.collection', 'esnext.symbol', 'esnext.asynciterable', 'esnext.intl', 'esnext.disposable', 'esnext.bigint', 'esnext.string', 'esnext.promise', 'esnext.weakref', 'esnext.decorators', 'esnext.object', 'esnext.regexp', 'esnext.iterator', 'esnext.float16', 'esnext.typedarrays', 'esnext.error', 'esnext.sharedmemory', 'esnext.temporal', 'esnext.date', 'decorators', 'decorators.legacy'. diff --git a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert incorrect option of libs to compiler-options with jsonSourceFile api.js b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert incorrect option of libs to compiler-options with jsonSourceFile api.js index 931924261d154..bc38e5ffbf852 100644 --- a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert incorrect option of libs to compiler-options with jsonSourceFile api.js +++ b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert incorrect option of libs to compiler-options with jsonSourceFile api.js @@ -35,7 +35,7 @@ CompilerOptions:: "configFilePath": "/apath/tsconfig.json" } Errors:: -tsconfig.json:10:7 - error TS6046: Argument for '--lib' option must be: 'es5', 'es6', 'es2015', 'es7', 'es2016', 'es2017', 'es2018', 'es2019', 'es2020', 'es2021', 'es2022', 'es2023', 'es2024', 'esnext', 'dom', 'dom.iterable', 'dom.asynciterable', 'webworker', 'webworker.importscripts', 'webworker.iterable', 'webworker.asynciterable', 'scripthost', 'es2015.core', 'es2015.collection', 'es2015.generator', 'es2015.iterable', 'es2015.promise', 'es2015.proxy', 'es2015.reflect', 'es2015.symbol', 'es2015.symbol.wellknown', 'es2016.array.include', 'es2016.intl', 'es2017.arraybuffer', 'es2017.date', 'es2017.object', 'es2017.sharedmemory', 'es2017.string', 'es2017.intl', 'es2017.typedarrays', 'es2018.asyncgenerator', 'es2018.asynciterable', 'es2018.intl', 'es2018.promise', 'es2018.regexp', 'es2019.array', 'es2019.object', 'es2019.string', 'es2019.symbol', 'es2019.intl', 'es2020.bigint', 'es2020.date', 'es2020.promise', 'es2020.sharedmemory', 'es2020.string', 'es2020.symbol.wellknown', 'es2020.intl', 'es2020.number', 'es2021.promise', 'es2021.string', 'es2021.weakref', 'es2021.intl', 'es2022.array', 'es2022.error', 'es2022.intl', 'es2022.object', 'es2022.string', 'es2022.regexp', 'es2023.array', 'es2023.collection', 'es2023.intl', 'es2024.arraybuffer', 'es2024.collection', 'es2024.object', 'es2024.promise', 'es2024.regexp', 'es2024.sharedmemory', 'es2024.string', 'esnext.array', 'esnext.collection', 'esnext.symbol', 'esnext.asynciterable', 'esnext.intl', 'esnext.disposable', 'esnext.bigint', 'esnext.string', 'esnext.promise', 'esnext.weakref', 'esnext.decorators', 'esnext.object', 'esnext.regexp', 'esnext.iterator', 'esnext.float16', 'esnext.typedarrays', 'esnext.error', 'esnext.sharedmemory', 'esnext.temporal', 'decorators', 'decorators.legacy'. +tsconfig.json:10:7 - error TS6046: Argument for '--lib' option must be: 'es5', 'es6', 'es2015', 'es7', 'es2016', 'es2017', 'es2018', 'es2019', 'es2020', 'es2021', 'es2022', 'es2023', 'es2024', 'esnext', 'dom', 'dom.iterable', 'dom.asynciterable', 'webworker', 'webworker.importscripts', 'webworker.iterable', 'webworker.asynciterable', 'scripthost', 'es2015.core', 'es2015.collection', 'es2015.generator', 'es2015.iterable', 'es2015.promise', 'es2015.proxy', 'es2015.reflect', 'es2015.symbol', 'es2015.symbol.wellknown', 'es2016.array.include', 'es2016.intl', 'es2017.arraybuffer', 'es2017.date', 'es2017.object', 'es2017.sharedmemory', 'es2017.string', 'es2017.intl', 'es2017.typedarrays', 'es2018.asyncgenerator', 'es2018.asynciterable', 'es2018.intl', 'es2018.promise', 'es2018.regexp', 'es2019.array', 'es2019.object', 'es2019.string', 'es2019.symbol', 'es2019.intl', 'es2020.bigint', 'es2020.date', 'es2020.promise', 'es2020.sharedmemory', 'es2020.string', 'es2020.symbol.wellknown', 'es2020.intl', 'es2020.number', 'es2021.promise', 'es2021.string', 'es2021.weakref', 'es2021.intl', 'es2022.array', 'es2022.error', 'es2022.intl', 'es2022.object', 'es2022.string', 'es2022.regexp', 'es2023.array', 'es2023.collection', 'es2023.intl', 'es2024.arraybuffer', 'es2024.collection', 'es2024.object', 'es2024.promise', 'es2024.regexp', 'es2024.sharedmemory', 'es2024.string', 'esnext.array', 'esnext.collection', 'esnext.symbol', 'esnext.asynciterable', 'esnext.intl', 'esnext.disposable', 'esnext.bigint', 'esnext.string', 'esnext.promise', 'esnext.weakref', 'esnext.decorators', 'esnext.object', 'esnext.regexp', 'esnext.iterator', 'esnext.float16', 'esnext.typedarrays', 'esnext.error', 'esnext.sharedmemory', 'esnext.temporal', 'esnext.date', 'decorators', 'decorators.legacy'. 10 "incorrectLib"    ~~~~~~~~~~~~~~ diff --git a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert trailing-whitespace string option of libs to compiler-options with json api.js b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert trailing-whitespace string option of libs to compiler-options with json api.js index 0e805dfa3c58e..2a87c257a7a12 100644 --- a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert trailing-whitespace string option of libs to compiler-options with json api.js +++ b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert trailing-whitespace string option of libs to compiler-options with json api.js @@ -30,5 +30,5 @@ CompilerOptions:: "configFilePath": "/apath/tsconfig.json" } Errors:: -error TS6046: Argument for '--lib' option must be: 'es5', 'es6', 'es2015', 'es7', 'es2016', 'es2017', 'es2018', 'es2019', 'es2020', 'es2021', 'es2022', 'es2023', 'es2024', 'esnext', 'dom', 'dom.iterable', 'dom.asynciterable', 'webworker', 'webworker.importscripts', 'webworker.iterable', 'webworker.asynciterable', 'scripthost', 'es2015.core', 'es2015.collection', 'es2015.generator', 'es2015.iterable', 'es2015.promise', 'es2015.proxy', 'es2015.reflect', 'es2015.symbol', 'es2015.symbol.wellknown', 'es2016.array.include', 'es2016.intl', 'es2017.arraybuffer', 'es2017.date', 'es2017.object', 'es2017.sharedmemory', 'es2017.string', 'es2017.intl', 'es2017.typedarrays', 'es2018.asyncgenerator', 'es2018.asynciterable', 'es2018.intl', 'es2018.promise', 'es2018.regexp', 'es2019.array', 'es2019.object', 'es2019.string', 'es2019.symbol', 'es2019.intl', 'es2020.bigint', 'es2020.date', 'es2020.promise', 'es2020.sharedmemory', 'es2020.string', 'es2020.symbol.wellknown', 'es2020.intl', 'es2020.number', 'es2021.promise', 'es2021.string', 'es2021.weakref', 'es2021.intl', 'es2022.array', 'es2022.error', 'es2022.intl', 'es2022.object', 'es2022.string', 'es2022.regexp', 'es2023.array', 'es2023.collection', 'es2023.intl', 'es2024.arraybuffer', 'es2024.collection', 'es2024.object', 'es2024.promise', 'es2024.regexp', 'es2024.sharedmemory', 'es2024.string', 'esnext.array', 'esnext.collection', 'esnext.symbol', 'esnext.asynciterable', 'esnext.intl', 'esnext.disposable', 'esnext.bigint', 'esnext.string', 'esnext.promise', 'esnext.weakref', 'esnext.decorators', 'esnext.object', 'esnext.regexp', 'esnext.iterator', 'esnext.float16', 'esnext.typedarrays', 'esnext.error', 'esnext.sharedmemory', 'esnext.temporal', 'decorators', 'decorators.legacy'. +error TS6046: Argument for '--lib' option must be: 'es5', 'es6', 'es2015', 'es7', 'es2016', 'es2017', 'es2018', 'es2019', 'es2020', 'es2021', 'es2022', 'es2023', 'es2024', 'esnext', 'dom', 'dom.iterable', 'dom.asynciterable', 'webworker', 'webworker.importscripts', 'webworker.iterable', 'webworker.asynciterable', 'scripthost', 'es2015.core', 'es2015.collection', 'es2015.generator', 'es2015.iterable', 'es2015.promise', 'es2015.proxy', 'es2015.reflect', 'es2015.symbol', 'es2015.symbol.wellknown', 'es2016.array.include', 'es2016.intl', 'es2017.arraybuffer', 'es2017.date', 'es2017.object', 'es2017.sharedmemory', 'es2017.string', 'es2017.intl', 'es2017.typedarrays', 'es2018.asyncgenerator', 'es2018.asynciterable', 'es2018.intl', 'es2018.promise', 'es2018.regexp', 'es2019.array', 'es2019.object', 'es2019.string', 'es2019.symbol', 'es2019.intl', 'es2020.bigint', 'es2020.date', 'es2020.promise', 'es2020.sharedmemory', 'es2020.string', 'es2020.symbol.wellknown', 'es2020.intl', 'es2020.number', 'es2021.promise', 'es2021.string', 'es2021.weakref', 'es2021.intl', 'es2022.array', 'es2022.error', 'es2022.intl', 'es2022.object', 'es2022.string', 'es2022.regexp', 'es2023.array', 'es2023.collection', 'es2023.intl', 'es2024.arraybuffer', 'es2024.collection', 'es2024.object', 'es2024.promise', 'es2024.regexp', 'es2024.sharedmemory', 'es2024.string', 'esnext.array', 'esnext.collection', 'esnext.symbol', 'esnext.asynciterable', 'esnext.intl', 'esnext.disposable', 'esnext.bigint', 'esnext.string', 'esnext.promise', 'esnext.weakref', 'esnext.decorators', 'esnext.object', 'esnext.regexp', 'esnext.iterator', 'esnext.float16', 'esnext.typedarrays', 'esnext.error', 'esnext.sharedmemory', 'esnext.temporal', 'esnext.date', 'decorators', 'decorators.legacy'. diff --git a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert trailing-whitespace string option of libs to compiler-options with jsonSourceFile api.js b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert trailing-whitespace string option of libs to compiler-options with jsonSourceFile api.js index 3192804b7a2da..5e8bc37f5c2db 100644 --- a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert trailing-whitespace string option of libs to compiler-options with jsonSourceFile api.js +++ b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert trailing-whitespace string option of libs to compiler-options with jsonSourceFile api.js @@ -30,7 +30,7 @@ CompilerOptions:: "configFilePath": "/apath/tsconfig.json" } Errors:: -tsconfig.json:8:7 - error TS6046: Argument for '--lib' option must be: 'es5', 'es6', 'es2015', 'es7', 'es2016', 'es2017', 'es2018', 'es2019', 'es2020', 'es2021', 'es2022', 'es2023', 'es2024', 'esnext', 'dom', 'dom.iterable', 'dom.asynciterable', 'webworker', 'webworker.importscripts', 'webworker.iterable', 'webworker.asynciterable', 'scripthost', 'es2015.core', 'es2015.collection', 'es2015.generator', 'es2015.iterable', 'es2015.promise', 'es2015.proxy', 'es2015.reflect', 'es2015.symbol', 'es2015.symbol.wellknown', 'es2016.array.include', 'es2016.intl', 'es2017.arraybuffer', 'es2017.date', 'es2017.object', 'es2017.sharedmemory', 'es2017.string', 'es2017.intl', 'es2017.typedarrays', 'es2018.asyncgenerator', 'es2018.asynciterable', 'es2018.intl', 'es2018.promise', 'es2018.regexp', 'es2019.array', 'es2019.object', 'es2019.string', 'es2019.symbol', 'es2019.intl', 'es2020.bigint', 'es2020.date', 'es2020.promise', 'es2020.sharedmemory', 'es2020.string', 'es2020.symbol.wellknown', 'es2020.intl', 'es2020.number', 'es2021.promise', 'es2021.string', 'es2021.weakref', 'es2021.intl', 'es2022.array', 'es2022.error', 'es2022.intl', 'es2022.object', 'es2022.string', 'es2022.regexp', 'es2023.array', 'es2023.collection', 'es2023.intl', 'es2024.arraybuffer', 'es2024.collection', 'es2024.object', 'es2024.promise', 'es2024.regexp', 'es2024.sharedmemory', 'es2024.string', 'esnext.array', 'esnext.collection', 'esnext.symbol', 'esnext.asynciterable', 'esnext.intl', 'esnext.disposable', 'esnext.bigint', 'esnext.string', 'esnext.promise', 'esnext.weakref', 'esnext.decorators', 'esnext.object', 'esnext.regexp', 'esnext.iterator', 'esnext.float16', 'esnext.typedarrays', 'esnext.error', 'esnext.sharedmemory', 'esnext.temporal', 'decorators', 'decorators.legacy'. +tsconfig.json:8:7 - error TS6046: Argument for '--lib' option must be: 'es5', 'es6', 'es2015', 'es7', 'es2016', 'es2017', 'es2018', 'es2019', 'es2020', 'es2021', 'es2022', 'es2023', 'es2024', 'esnext', 'dom', 'dom.iterable', 'dom.asynciterable', 'webworker', 'webworker.importscripts', 'webworker.iterable', 'webworker.asynciterable', 'scripthost', 'es2015.core', 'es2015.collection', 'es2015.generator', 'es2015.iterable', 'es2015.promise', 'es2015.proxy', 'es2015.reflect', 'es2015.symbol', 'es2015.symbol.wellknown', 'es2016.array.include', 'es2016.intl', 'es2017.arraybuffer', 'es2017.date', 'es2017.object', 'es2017.sharedmemory', 'es2017.string', 'es2017.intl', 'es2017.typedarrays', 'es2018.asyncgenerator', 'es2018.asynciterable', 'es2018.intl', 'es2018.promise', 'es2018.regexp', 'es2019.array', 'es2019.object', 'es2019.string', 'es2019.symbol', 'es2019.intl', 'es2020.bigint', 'es2020.date', 'es2020.promise', 'es2020.sharedmemory', 'es2020.string', 'es2020.symbol.wellknown', 'es2020.intl', 'es2020.number', 'es2021.promise', 'es2021.string', 'es2021.weakref', 'es2021.intl', 'es2022.array', 'es2022.error', 'es2022.intl', 'es2022.object', 'es2022.string', 'es2022.regexp', 'es2023.array', 'es2023.collection', 'es2023.intl', 'es2024.arraybuffer', 'es2024.collection', 'es2024.object', 'es2024.promise', 'es2024.regexp', 'es2024.sharedmemory', 'es2024.string', 'esnext.array', 'esnext.collection', 'esnext.symbol', 'esnext.asynciterable', 'esnext.intl', 'esnext.disposable', 'esnext.bigint', 'esnext.string', 'esnext.promise', 'esnext.weakref', 'esnext.decorators', 'esnext.object', 'esnext.regexp', 'esnext.iterator', 'esnext.float16', 'esnext.typedarrays', 'esnext.error', 'esnext.sharedmemory', 'esnext.temporal', 'esnext.date', 'decorators', 'decorators.legacy'. 8 " "    ~~~~~ diff --git a/tests/baselines/reference/doYouNeedToChangeYourTargetLibraryES2016Plus.errors.txt b/tests/baselines/reference/doYouNeedToChangeYourTargetLibraryES2016Plus.errors.txt index 0bc0cc1bc35d3..15df2d938b1bc 100644 --- a/tests/baselines/reference/doYouNeedToChangeYourTargetLibraryES2016Plus.errors.txt +++ b/tests/baselines/reference/doYouNeedToChangeYourTargetLibraryES2016Plus.errors.txt @@ -37,9 +37,10 @@ doYouNeedToChangeYourTargetLibraryES2016Plus.ts(39,47): error TS2550: Property ' doYouNeedToChangeYourTargetLibraryES2016Plus.ts(40,20): error TS2583: Cannot find name 'BigInt'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2020' or later. doYouNeedToChangeYourTargetLibraryES2016Plus.ts(43,32): error TS2550: Property 'any' does not exist on type 'PromiseConstructor'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2021' or later. doYouNeedToChangeYourTargetLibraryES2016Plus.ts(44,33): error TS2550: Property 'replaceAll' does not exist on type '""'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2021' or later. +doYouNeedToChangeYourTargetLibraryES2016Plus.ts(47,46): error TS2550: Property 'toTemporalInstant' does not exist on type 'Date'. Do you need to change your target library? Try changing the 'lib' compiler option to 'esnext' or later. -==== doYouNeedToChangeYourTargetLibraryES2016Plus.ts (39 errors) ==== +==== doYouNeedToChangeYourTargetLibraryES2016Plus.ts (40 errors) ==== // es2016 const testIncludes = ["hello"].includes("world"); ~~~~~~~~ @@ -164,4 +165,7 @@ doYouNeedToChangeYourTargetLibraryES2016Plus.ts(44,33): error TS2550: Property ' !!! error TS2550: Property 'replaceAll' does not exist on type '""'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2021' or later. // esnext + const testDateToTemporalInstant = new Date().toTemporalInstant(); + ~~~~~~~~~~~~~~~~~ +!!! error TS2550: Property 'toTemporalInstant' does not exist on type 'Date'. Do you need to change your target library? Try changing the 'lib' compiler option to 'esnext' or later. \ No newline at end of file diff --git a/tests/baselines/reference/doYouNeedToChangeYourTargetLibraryES2016Plus.js b/tests/baselines/reference/doYouNeedToChangeYourTargetLibraryES2016Plus.js index 15953908374a0..b0ffffb6d6fe0 100644 --- a/tests/baselines/reference/doYouNeedToChangeYourTargetLibraryES2016Plus.js +++ b/tests/baselines/reference/doYouNeedToChangeYourTargetLibraryES2016Plus.js @@ -47,6 +47,7 @@ const testPromiseAny = Promise.any([]); const testStringReplaceAll = "".replaceAll(); // esnext +const testDateToTemporalInstant = new Date().toTemporalInstant(); //// [doYouNeedToChangeYourTargetLibraryES2016Plus.js] @@ -90,3 +91,4 @@ var testBigInt = BigInt(123); var testPromiseAny = Promise.any([]); var testStringReplaceAll = "".replaceAll(); // esnext +var testDateToTemporalInstant = new Date().toTemporalInstant(); diff --git a/tests/baselines/reference/doYouNeedToChangeYourTargetLibraryES2016Plus.symbols b/tests/baselines/reference/doYouNeedToChangeYourTargetLibraryES2016Plus.symbols index 562c539287906..373692987b76c 100644 --- a/tests/baselines/reference/doYouNeedToChangeYourTargetLibraryES2016Plus.symbols +++ b/tests/baselines/reference/doYouNeedToChangeYourTargetLibraryES2016Plus.symbols @@ -132,4 +132,7 @@ const testStringReplaceAll = "".replaceAll(); >testStringReplaceAll : Symbol(testStringReplaceAll, Decl(doYouNeedToChangeYourTargetLibraryES2016Plus.ts, 43, 5)) // esnext +const testDateToTemporalInstant = new Date().toTemporalInstant(); +>testDateToTemporalInstant : Symbol(testDateToTemporalInstant, Decl(doYouNeedToChangeYourTargetLibraryES2016Plus.ts, 46, 5)) +>Date : Symbol(Date, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) diff --git a/tests/baselines/reference/doYouNeedToChangeYourTargetLibraryES2016Plus.types b/tests/baselines/reference/doYouNeedToChangeYourTargetLibraryES2016Plus.types index ff708c5879b54..c568b6bdcf57f 100644 --- a/tests/baselines/reference/doYouNeedToChangeYourTargetLibraryES2016Plus.types +++ b/tests/baselines/reference/doYouNeedToChangeYourTargetLibraryES2016Plus.types @@ -454,4 +454,17 @@ const testStringReplaceAll = "".replaceAll(); > : ^^^ // esnext +const testDateToTemporalInstant = new Date().toTemporalInstant(); +>testDateToTemporalInstant : any +> : ^^^ +>new Date().toTemporalInstant() : any +> : ^^^ +>new Date().toTemporalInstant : any +> : ^^^ +>new Date() : Date +> : ^^^^ +>Date : DateConstructor +> : ^^^^^^^^^^^^^^^ +>toTemporalInstant : any +> : ^^^ diff --git a/tests/baselines/reference/formatToPartsFractionalSecond.symbols b/tests/baselines/reference/formatToPartsFractionalSecond.symbols index 8f11bdbf67856..c54c33aafd8e1 100644 --- a/tests/baselines/reference/formatToPartsFractionalSecond.symbols +++ b/tests/baselines/reference/formatToPartsFractionalSecond.symbols @@ -3,11 +3,11 @@ === formatToPartsFractionalSecond.ts === new Intl.DateTimeFormat().formatToParts().find((val) => val.type === 'fractionalSecond') >new Intl.DateTimeFormat().formatToParts().find : Symbol(Array.find, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) ->new Intl.DateTimeFormat().formatToParts : Symbol(Intl.DateTimeFormat.formatToParts, Decl(lib.es2017.intl.d.ts, --, --)) ->Intl.DateTimeFormat : Symbol(Intl.DateTimeFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2017.intl.d.ts, --, --), Decl(lib.es2021.intl.d.ts, --, --)) +>new Intl.DateTimeFormat().formatToParts : Symbol(Intl.DateTimeFormat.formatToParts, Decl(lib.es2017.intl.d.ts, --, --), Decl(lib.esnext.intl.d.ts, --, --)) +>Intl.DateTimeFormat : Symbol(Intl.DateTimeFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2017.intl.d.ts, --, --), Decl(lib.es2021.intl.d.ts, --, --), Decl(lib.esnext.intl.d.ts, --, --)) >Intl : Symbol(Intl, Decl(lib.es5.d.ts, --, --), Decl(lib.es2016.intl.d.ts, --, --), Decl(lib.es2017.intl.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2019.intl.d.ts, --, --) ... and 6 more) ->DateTimeFormat : Symbol(Intl.DateTimeFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2017.intl.d.ts, --, --), Decl(lib.es2021.intl.d.ts, --, --)) ->formatToParts : Symbol(Intl.DateTimeFormat.formatToParts, Decl(lib.es2017.intl.d.ts, --, --)) +>DateTimeFormat : Symbol(Intl.DateTimeFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2017.intl.d.ts, --, --), Decl(lib.es2021.intl.d.ts, --, --), Decl(lib.esnext.intl.d.ts, --, --)) +>formatToParts : Symbol(Intl.DateTimeFormat.formatToParts, Decl(lib.es2017.intl.d.ts, --, --), Decl(lib.esnext.intl.d.ts, --, --)) >find : Symbol(Array.find, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) >val : Symbol(val, Decl(formatToPartsFractionalSecond.ts, 0, 48)) >val.type : Symbol(Intl.DateTimeFormatPart.type, Decl(lib.es2017.intl.d.ts, --, --)) diff --git a/tests/baselines/reference/formatToPartsFractionalSecond.types b/tests/baselines/reference/formatToPartsFractionalSecond.types index 9880e49cca2df..7a1126e3a3b6a 100644 --- a/tests/baselines/reference/formatToPartsFractionalSecond.types +++ b/tests/baselines/reference/formatToPartsFractionalSecond.types @@ -8,8 +8,8 @@ new Intl.DateTimeFormat().formatToParts().find((val) => val.type === 'fractional > : ^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^ ^^^^^^^ ^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >new Intl.DateTimeFormat().formatToParts() : Intl.DateTimeFormatPart[] > : ^^^^^^^^^^^^^^^^^^^^^^^^^ ->new Intl.DateTimeFormat().formatToParts : (date?: Date | number) => Intl.DateTimeFormatPart[] -> : ^ ^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>new Intl.DateTimeFormat().formatToParts : { (date?: Date | number): Intl.DateTimeFormatPart[]; (date?: Intl.FormattableTemporalObject | Date | number): Intl.DateTimeFormatPart[]; } +> : ^^^ ^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^ >new Intl.DateTimeFormat() : Intl.DateTimeFormat > : ^^^^^^^^^^^^^^^^^^^ >Intl.DateTimeFormat : Intl.DateTimeFormatConstructor @@ -18,8 +18,8 @@ new Intl.DateTimeFormat().formatToParts().find((val) => val.type === 'fractional > : ^^^^^^^^^^^ >DateTimeFormat : Intl.DateTimeFormatConstructor > : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ->formatToParts : (date?: Date | number) => Intl.DateTimeFormatPart[] -> : ^ ^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>formatToParts : { (date?: Date | number): Intl.DateTimeFormatPart[]; (date?: Intl.FormattableTemporalObject | Date | number): Intl.DateTimeFormatPart[]; } +> : ^^^ ^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^ >find : { (predicate: (value: Intl.DateTimeFormatPart, index: number, obj: Intl.DateTimeFormatPart[]) => value is S, thisArg?: any): S; (predicate: (value: Intl.DateTimeFormatPart, index: number, obj: Intl.DateTimeFormatPart[]) => unknown, thisArg?: any): Intl.DateTimeFormatPart; } > : ^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^ ^^^^^^^ ^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >(val) => val.type === 'fractionalSecond' : (val: Intl.DateTimeFormatPart) => boolean diff --git a/tests/baselines/reference/libReplacement(libreplacement=true).trace.json b/tests/baselines/reference/libReplacement(libreplacement=true).trace.json index 28bf420163aa7..5d1325e26de73 100644 --- a/tests/baselines/reference/libReplacement(libreplacement=true).trace.json +++ b/tests/baselines/reference/libReplacement(libreplacement=true).trace.json @@ -922,6 +922,19 @@ "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", "Directory '/node_modules' does not exist, skipping all lookups in it.", "======== Module name '@typescript/lib-esnext/intl' was not resolved. ========", + "======== Resolving module '@typescript/lib-esnext/temporal' from '/.src/__lib_node_modules_lookup_lib.esnext.temporal.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-esnext/temporal' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-esnext/temporal'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-esnext/temporal'", + "Loading module '@typescript/lib-esnext/temporal' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-esnext/temporal' was not resolved. ========", "======== Resolving module '@typescript/lib-esnext/decorators' from '/.src/__lib_node_modules_lookup_lib.esnext.decorators.d.ts__.ts'. ========", "Explicitly specified module resolution kind: 'Node10'.", "Loading module '@typescript/lib-esnext/decorators' from 'node_modules' folder, target file types: TypeScript, Declaration.", @@ -1052,17 +1065,17 @@ "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", "Directory '/node_modules' does not exist, skipping all lookups in it.", "======== Module name '@typescript/lib-esnext/typedarrays' was not resolved. ========", - "======== Resolving module '@typescript/lib-esnext/temporal' from '/.src/__lib_node_modules_lookup_lib.esnext.temporal.d.ts__.ts'. ========", + "======== Resolving module '@typescript/lib-esnext/date' from '/.src/__lib_node_modules_lookup_lib.esnext.date.d.ts__.ts'. ========", "Explicitly specified module resolution kind: 'Node10'.", - "Loading module '@typescript/lib-esnext/temporal' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Loading module '@typescript/lib-esnext/date' from 'node_modules' folder, target file types: TypeScript, Declaration.", "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", - "Scoped package detected, looking in 'typescript__lib-esnext/temporal'", + "Scoped package detected, looking in 'typescript__lib-esnext/date'", "Directory '/node_modules' does not exist, skipping all lookups in it.", - "Scoped package detected, looking in 'typescript__lib-esnext/temporal'", - "Loading module '@typescript/lib-esnext/temporal' from 'node_modules' folder, target file types: JavaScript.", + "Scoped package detected, looking in 'typescript__lib-esnext/date'", + "Loading module '@typescript/lib-esnext/date' from 'node_modules' folder, target file types: JavaScript.", "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", "Directory '/node_modules' does not exist, skipping all lookups in it.", - "======== Module name '@typescript/lib-esnext/temporal' was not resolved. ========" + "======== Module name '@typescript/lib-esnext/date' was not resolved. ========" ] \ No newline at end of file diff --git a/tests/baselines/reference/nodeModulesExportsBlocksTypesVersions(module=nodenext).trace.json b/tests/baselines/reference/nodeModulesExportsBlocksTypesVersions(module=nodenext).trace.json index a4fee39a9473c..53a1d4ac27c76 100644 --- a/tests/baselines/reference/nodeModulesExportsBlocksTypesVersions(module=nodenext).trace.json +++ b/tests/baselines/reference/nodeModulesExportsBlocksTypesVersions(module=nodenext).trace.json @@ -382,5 +382,7 @@ "File '/.ts/package.json' does not exist according to earlier cached lookups.", "File '/package.json' does not exist according to earlier cached lookups.", "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", "File '/package.json' does not exist according to earlier cached lookups." ] \ No newline at end of file diff --git a/tests/baselines/reference/nodeModulesPackageImports(module=nodenext).trace.json b/tests/baselines/reference/nodeModulesPackageImports(module=nodenext).trace.json index 2131b29ff83e2..89814fa4fdafe 100644 --- a/tests/baselines/reference/nodeModulesPackageImports(module=nodenext).trace.json +++ b/tests/baselines/reference/nodeModulesPackageImports(module=nodenext).trace.json @@ -232,5 +232,7 @@ "File '/.ts/package.json' does not exist according to earlier cached lookups.", "File '/package.json' does not exist according to earlier cached lookups.", "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", "File '/package.json' does not exist according to earlier cached lookups." ] \ No newline at end of file diff --git a/tests/baselines/reference/nodeModulesPackagePatternExportsTrailers(module=nodenext).trace.json b/tests/baselines/reference/nodeModulesPackagePatternExportsTrailers(module=nodenext).trace.json index 111fbbb5ae640..220d6060bcd98 100644 --- a/tests/baselines/reference/nodeModulesPackagePatternExportsTrailers(module=nodenext).trace.json +++ b/tests/baselines/reference/nodeModulesPackagePatternExportsTrailers(module=nodenext).trace.json @@ -331,5 +331,7 @@ "File '/.ts/package.json' does not exist according to earlier cached lookups.", "File '/package.json' does not exist according to earlier cached lookups.", "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", "File '/package.json' does not exist according to earlier cached lookups." ] \ No newline at end of file diff --git a/tests/baselines/reference/reactJsxReactResolvedNodeNext.trace.json b/tests/baselines/reference/reactJsxReactResolvedNodeNext.trace.json index 791ec1a3c1662..5841a26599d5c 100644 --- a/tests/baselines/reference/reactJsxReactResolvedNodeNext.trace.json +++ b/tests/baselines/reference/reactJsxReactResolvedNodeNext.trace.json @@ -215,5 +215,7 @@ "File '/.ts/package.json' does not exist according to earlier cached lookups.", "File '/package.json' does not exist according to earlier cached lookups.", "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", "File '/package.json' does not exist according to earlier cached lookups." ] \ No newline at end of file diff --git a/tests/baselines/reference/reactJsxReactResolvedNodeNextEsm.trace.json b/tests/baselines/reference/reactJsxReactResolvedNodeNextEsm.trace.json index d74a63891d3b5..f27839563e9ab 100644 --- a/tests/baselines/reference/reactJsxReactResolvedNodeNextEsm.trace.json +++ b/tests/baselines/reference/reactJsxReactResolvedNodeNextEsm.trace.json @@ -215,5 +215,7 @@ "File '/.ts/package.json' does not exist according to earlier cached lookups.", "File '/package.json' does not exist according to earlier cached lookups.", "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", "File '/package.json' does not exist according to earlier cached lookups." ] \ No newline at end of file diff --git a/tests/baselines/reference/tsc/commandLine/does-not-add-color-when-NO_COLOR-is-set.js b/tests/baselines/reference/tsc/commandLine/does-not-add-color-when-NO_COLOR-is-set.js index 323f9d0ed1a42..1d41c4a4fcc1b 100644 --- a/tests/baselines/reference/tsc/commandLine/does-not-add-color-when-NO_COLOR-is-set.js +++ b/tests/baselines/reference/tsc/commandLine/does-not-add-color-when-NO_COLOR-is-set.js @@ -117,7 +117,7 @@ default: undefined --lib Specify a set of bundled library declaration files that describe the target runtime environment. -one or more: es5, es6/es2015, es7/es2016, es2017, es2018, es2019, es2020, es2021, es2022, es2023, es2024, esnext, dom, dom.iterable, dom.asynciterable, webworker, webworker.importscripts, webworker.iterable, webworker.asynciterable, scripthost, es2015.core, es2015.collection, es2015.generator, es2015.iterable, es2015.promise, es2015.proxy, es2015.reflect, es2015.symbol, es2015.symbol.wellknown, es2016.array.include, es2016.intl, es2017.arraybuffer, es2017.date, es2017.object, es2017.sharedmemory, es2017.string, es2017.intl, es2017.typedarrays, es2018.asyncgenerator, es2018.asynciterable/esnext.asynciterable, es2018.intl, es2018.promise, es2018.regexp, es2019.array, es2019.object, es2019.string, es2019.symbol/esnext.symbol, es2019.intl, es2020.bigint/esnext.bigint, es2020.date, es2020.promise, es2020.sharedmemory, es2020.string, es2020.symbol.wellknown, es2020.intl, es2020.number, es2021.promise, es2021.string, es2021.weakref/esnext.weakref, es2021.intl, es2022.array, es2022.error, es2022.intl, es2022.object, es2022.string, es2022.regexp, es2023.array, es2023.collection, es2023.intl, es2024.arraybuffer, es2024.collection, es2024.object/esnext.object, es2024.promise, es2024.regexp/esnext.regexp, es2024.sharedmemory, es2024.string/esnext.string, esnext.array, esnext.collection, esnext.intl, esnext.disposable, esnext.promise, esnext.decorators, esnext.iterator, esnext.float16, esnext.typedarrays, esnext.error, esnext.sharedmemory, esnext.temporal, decorators, decorators.legacy +one or more: es5, es6/es2015, es7/es2016, es2017, es2018, es2019, es2020, es2021, es2022, es2023, es2024, esnext, dom, dom.iterable, dom.asynciterable, webworker, webworker.importscripts, webworker.iterable, webworker.asynciterable, scripthost, es2015.core, es2015.collection, es2015.generator, es2015.iterable, es2015.promise, es2015.proxy, es2015.reflect, es2015.symbol, es2015.symbol.wellknown, es2016.array.include, es2016.intl, es2017.arraybuffer, es2017.date, es2017.object, es2017.sharedmemory, es2017.string, es2017.intl, es2017.typedarrays, es2018.asyncgenerator, es2018.asynciterable/esnext.asynciterable, es2018.intl, es2018.promise, es2018.regexp, es2019.array, es2019.object, es2019.string, es2019.symbol/esnext.symbol, es2019.intl, es2020.bigint/esnext.bigint, es2020.date, es2020.promise, es2020.sharedmemory, es2020.string, es2020.symbol.wellknown, es2020.intl, es2020.number, es2021.promise, es2021.string, es2021.weakref/esnext.weakref, es2021.intl, es2022.array, es2022.error, es2022.intl, es2022.object, es2022.string, es2022.regexp, es2023.array, es2023.collection, es2023.intl, es2024.arraybuffer, es2024.collection, es2024.object/esnext.object, es2024.promise, es2024.regexp/esnext.regexp, es2024.sharedmemory, es2024.string/esnext.string, esnext.array, esnext.collection, esnext.intl, esnext.disposable, esnext.promise, esnext.decorators, esnext.iterator, esnext.float16, esnext.typedarrays, esnext.error, esnext.sharedmemory, esnext.temporal, esnext.date, decorators, decorators.legacy default: undefined --allowJs diff --git a/tests/baselines/reference/tsc/commandLine/help-all.js b/tests/baselines/reference/tsc/commandLine/help-all.js index 02cc14b12c1ba..f40d635db62d9 100644 --- a/tests/baselines/reference/tsc/commandLine/help-all.js +++ b/tests/baselines/reference/tsc/commandLine/help-all.js @@ -577,7 +577,7 @@ default: react --lib Specify a set of bundled library declaration files that describe the target runtime environment. -one or more: es5, es6/es2015, es7/es2016, es2017, es2018, es2019, es2020, es2021, es2022, es2023, es2024, esnext, dom, dom.iterable, dom.asynciterable, webworker, webworker.importscripts, webworker.iterable, webworker.asynciterable, scripthost, es2015.core, es2015.collection, es2015.generator, es2015.iterable, es2015.promise, es2015.proxy, es2015.reflect, es2015.symbol, es2015.symbol.wellknown, es2016.array.include, es2016.intl, es2017.arraybuffer, es2017.date, es2017.object, es2017.sharedmemory, es2017.string, es2017.intl, es2017.typedarrays, es2018.asyncgenerator, es2018.asynciterable/esnext.asynciterable, es2018.intl, es2018.promise, es2018.regexp, es2019.array, es2019.object, es2019.string, es2019.symbol/esnext.symbol, es2019.intl, es2020.bigint/esnext.bigint, es2020.date, es2020.promise, es2020.sharedmemory, es2020.string, es2020.symbol.wellknown, es2020.intl, es2020.number, es2021.promise, es2021.string, es2021.weakref/esnext.weakref, es2021.intl, es2022.array, es2022.error, es2022.intl, es2022.object, es2022.string, es2022.regexp, es2023.array, es2023.collection, es2023.intl, es2024.arraybuffer, es2024.collection, es2024.object/esnext.object, es2024.promise, es2024.regexp/esnext.regexp, es2024.sharedmemory, es2024.string/esnext.string, esnext.array, esnext.collection, esnext.intl, esnext.disposable, esnext.promise, esnext.decorators, esnext.iterator, esnext.float16, esnext.typedarrays, esnext.error, esnext.sharedmemory, esnext.temporal, decorators, decorators.legacy +one or more: es5, es6/es2015, es7/es2016, es2017, es2018, es2019, es2020, es2021, es2022, es2023, es2024, esnext, dom, dom.iterable, dom.asynciterable, webworker, webworker.importscripts, webworker.iterable, webworker.asynciterable, scripthost, es2015.core, es2015.collection, es2015.generator, es2015.iterable, es2015.promise, es2015.proxy, es2015.reflect, es2015.symbol, es2015.symbol.wellknown, es2016.array.include, es2016.intl, es2017.arraybuffer, es2017.date, es2017.object, es2017.sharedmemory, es2017.string, es2017.intl, es2017.typedarrays, es2018.asyncgenerator, es2018.asynciterable/esnext.asynciterable, es2018.intl, es2018.promise, es2018.regexp, es2019.array, es2019.object, es2019.string, es2019.symbol/esnext.symbol, es2019.intl, es2020.bigint/esnext.bigint, es2020.date, es2020.promise, es2020.sharedmemory, es2020.string, es2020.symbol.wellknown, es2020.intl, es2020.number, es2021.promise, es2021.string, es2021.weakref/esnext.weakref, es2021.intl, es2022.array, es2022.error, es2022.intl, es2022.object, es2022.string, es2022.regexp, es2023.array, es2023.collection, es2023.intl, es2024.arraybuffer, es2024.collection, es2024.object/esnext.object, es2024.promise, es2024.regexp/esnext.regexp, es2024.sharedmemory, es2024.string/esnext.string, esnext.array, esnext.collection, esnext.intl, esnext.disposable, esnext.promise, esnext.decorators, esnext.iterator, esnext.float16, esnext.typedarrays, esnext.error, esnext.sharedmemory, esnext.temporal, esnext.date, decorators, decorators.legacy default: undefined --libReplacement diff --git a/tests/baselines/reference/tsc/commandLine/help.js b/tests/baselines/reference/tsc/commandLine/help.js index 1edf731d90081..314f0dc035f35 100644 --- a/tests/baselines/reference/tsc/commandLine/help.js +++ b/tests/baselines/reference/tsc/commandLine/help.js @@ -116,7 +116,7 @@ default: undefined --lib Specify a set of bundled library declaration files that describe the target runtime environment. -one or more: es5, es6/es2015, es7/es2016, es2017, es2018, es2019, es2020, es2021, es2022, es2023, es2024, esnext, dom, dom.iterable, dom.asynciterable, webworker, webworker.importscripts, webworker.iterable, webworker.asynciterable, scripthost, es2015.core, es2015.collection, es2015.generator, es2015.iterable, es2015.promise, es2015.proxy, es2015.reflect, es2015.symbol, es2015.symbol.wellknown, es2016.array.include, es2016.intl, es2017.arraybuffer, es2017.date, es2017.object, es2017.sharedmemory, es2017.string, es2017.intl, es2017.typedarrays, es2018.asyncgenerator, es2018.asynciterable/esnext.asynciterable, es2018.intl, es2018.promise, es2018.regexp, es2019.array, es2019.object, es2019.string, es2019.symbol/esnext.symbol, es2019.intl, es2020.bigint/esnext.bigint, es2020.date, es2020.promise, es2020.sharedmemory, es2020.string, es2020.symbol.wellknown, es2020.intl, es2020.number, es2021.promise, es2021.string, es2021.weakref/esnext.weakref, es2021.intl, es2022.array, es2022.error, es2022.intl, es2022.object, es2022.string, es2022.regexp, es2023.array, es2023.collection, es2023.intl, es2024.arraybuffer, es2024.collection, es2024.object/esnext.object, es2024.promise, es2024.regexp/esnext.regexp, es2024.sharedmemory, es2024.string/esnext.string, esnext.array, esnext.collection, esnext.intl, esnext.disposable, esnext.promise, esnext.decorators, esnext.iterator, esnext.float16, esnext.typedarrays, esnext.error, esnext.sharedmemory, esnext.temporal, decorators, decorators.legacy +one or more: es5, es6/es2015, es7/es2016, es2017, es2018, es2019, es2020, es2021, es2022, es2023, es2024, esnext, dom, dom.iterable, dom.asynciterable, webworker, webworker.importscripts, webworker.iterable, webworker.asynciterable, scripthost, es2015.core, es2015.collection, es2015.generator, es2015.iterable, es2015.promise, es2015.proxy, es2015.reflect, es2015.symbol, es2015.symbol.wellknown, es2016.array.include, es2016.intl, es2017.arraybuffer, es2017.date, es2017.object, es2017.sharedmemory, es2017.string, es2017.intl, es2017.typedarrays, es2018.asyncgenerator, es2018.asynciterable/esnext.asynciterable, es2018.intl, es2018.promise, es2018.regexp, es2019.array, es2019.object, es2019.string, es2019.symbol/esnext.symbol, es2019.intl, es2020.bigint/esnext.bigint, es2020.date, es2020.promise, es2020.sharedmemory, es2020.string, es2020.symbol.wellknown, es2020.intl, es2020.number, es2021.promise, es2021.string, es2021.weakref/esnext.weakref, es2021.intl, es2022.array, es2022.error, es2022.intl, es2022.object, es2022.string, es2022.regexp, es2023.array, es2023.collection, es2023.intl, es2024.arraybuffer, es2024.collection, es2024.object/esnext.object, es2024.promise, es2024.regexp/esnext.regexp, es2024.sharedmemory, es2024.string/esnext.string, esnext.array, esnext.collection, esnext.intl, esnext.disposable, esnext.promise, esnext.decorators, esnext.iterator, esnext.float16, esnext.typedarrays, esnext.error, esnext.sharedmemory, esnext.temporal, esnext.date, decorators, decorators.legacy default: undefined --allowJs diff --git a/tests/baselines/reference/tsc/commandLine/show-help-with-ExitStatus.DiagnosticsPresent_OutputsSkipped-when-host-can't-provide-terminal-width.js b/tests/baselines/reference/tsc/commandLine/show-help-with-ExitStatus.DiagnosticsPresent_OutputsSkipped-when-host-can't-provide-terminal-width.js index cca44a2a416c0..78689c9e0b2b5 100644 --- a/tests/baselines/reference/tsc/commandLine/show-help-with-ExitStatus.DiagnosticsPresent_OutputsSkipped-when-host-can't-provide-terminal-width.js +++ b/tests/baselines/reference/tsc/commandLine/show-help-with-ExitStatus.DiagnosticsPresent_OutputsSkipped-when-host-can't-provide-terminal-width.js @@ -117,7 +117,7 @@ default: undefined --lib Specify a set of bundled library declaration files that describe the target runtime environment. -one or more: es5, es6/es2015, es7/es2016, es2017, es2018, es2019, es2020, es2021, es2022, es2023, es2024, esnext, dom, dom.iterable, dom.asynciterable, webworker, webworker.importscripts, webworker.iterable, webworker.asynciterable, scripthost, es2015.core, es2015.collection, es2015.generator, es2015.iterable, es2015.promise, es2015.proxy, es2015.reflect, es2015.symbol, es2015.symbol.wellknown, es2016.array.include, es2016.intl, es2017.arraybuffer, es2017.date, es2017.object, es2017.sharedmemory, es2017.string, es2017.intl, es2017.typedarrays, es2018.asyncgenerator, es2018.asynciterable/esnext.asynciterable, es2018.intl, es2018.promise, es2018.regexp, es2019.array, es2019.object, es2019.string, es2019.symbol/esnext.symbol, es2019.intl, es2020.bigint/esnext.bigint, es2020.date, es2020.promise, es2020.sharedmemory, es2020.string, es2020.symbol.wellknown, es2020.intl, es2020.number, es2021.promise, es2021.string, es2021.weakref/esnext.weakref, es2021.intl, es2022.array, es2022.error, es2022.intl, es2022.object, es2022.string, es2022.regexp, es2023.array, es2023.collection, es2023.intl, es2024.arraybuffer, es2024.collection, es2024.object/esnext.object, es2024.promise, es2024.regexp/esnext.regexp, es2024.sharedmemory, es2024.string/esnext.string, esnext.array, esnext.collection, esnext.intl, esnext.disposable, esnext.promise, esnext.decorators, esnext.iterator, esnext.float16, esnext.typedarrays, esnext.error, esnext.sharedmemory, esnext.temporal, decorators, decorators.legacy +one or more: es5, es6/es2015, es7/es2016, es2017, es2018, es2019, es2020, es2021, es2022, es2023, es2024, esnext, dom, dom.iterable, dom.asynciterable, webworker, webworker.importscripts, webworker.iterable, webworker.asynciterable, scripthost, es2015.core, es2015.collection, es2015.generator, es2015.iterable, es2015.promise, es2015.proxy, es2015.reflect, es2015.symbol, es2015.symbol.wellknown, es2016.array.include, es2016.intl, es2017.arraybuffer, es2017.date, es2017.object, es2017.sharedmemory, es2017.string, es2017.intl, es2017.typedarrays, es2018.asyncgenerator, es2018.asynciterable/esnext.asynciterable, es2018.intl, es2018.promise, es2018.regexp, es2019.array, es2019.object, es2019.string, es2019.symbol/esnext.symbol, es2019.intl, es2020.bigint/esnext.bigint, es2020.date, es2020.promise, es2020.sharedmemory, es2020.string, es2020.symbol.wellknown, es2020.intl, es2020.number, es2021.promise, es2021.string, es2021.weakref/esnext.weakref, es2021.intl, es2022.array, es2022.error, es2022.intl, es2022.object, es2022.string, es2022.regexp, es2023.array, es2023.collection, es2023.intl, es2024.arraybuffer, es2024.collection, es2024.object/esnext.object, es2024.promise, es2024.regexp/esnext.regexp, es2024.sharedmemory, es2024.string/esnext.string, esnext.array, esnext.collection, esnext.intl, esnext.disposable, esnext.promise, esnext.decorators, esnext.iterator, esnext.float16, esnext.typedarrays, esnext.error, esnext.sharedmemory, esnext.temporal, esnext.date, decorators, decorators.legacy default: undefined --allowJs diff --git a/tests/baselines/reference/tsc/commandLine/show-help-with-ExitStatus.DiagnosticsPresent_OutputsSkipped.js b/tests/baselines/reference/tsc/commandLine/show-help-with-ExitStatus.DiagnosticsPresent_OutputsSkipped.js index cca44a2a416c0..78689c9e0b2b5 100644 --- a/tests/baselines/reference/tsc/commandLine/show-help-with-ExitStatus.DiagnosticsPresent_OutputsSkipped.js +++ b/tests/baselines/reference/tsc/commandLine/show-help-with-ExitStatus.DiagnosticsPresent_OutputsSkipped.js @@ -117,7 +117,7 @@ default: undefined --lib Specify a set of bundled library declaration files that describe the target runtime environment. -one or more: es5, es6/es2015, es7/es2016, es2017, es2018, es2019, es2020, es2021, es2022, es2023, es2024, esnext, dom, dom.iterable, dom.asynciterable, webworker, webworker.importscripts, webworker.iterable, webworker.asynciterable, scripthost, es2015.core, es2015.collection, es2015.generator, es2015.iterable, es2015.promise, es2015.proxy, es2015.reflect, es2015.symbol, es2015.symbol.wellknown, es2016.array.include, es2016.intl, es2017.arraybuffer, es2017.date, es2017.object, es2017.sharedmemory, es2017.string, es2017.intl, es2017.typedarrays, es2018.asyncgenerator, es2018.asynciterable/esnext.asynciterable, es2018.intl, es2018.promise, es2018.regexp, es2019.array, es2019.object, es2019.string, es2019.symbol/esnext.symbol, es2019.intl, es2020.bigint/esnext.bigint, es2020.date, es2020.promise, es2020.sharedmemory, es2020.string, es2020.symbol.wellknown, es2020.intl, es2020.number, es2021.promise, es2021.string, es2021.weakref/esnext.weakref, es2021.intl, es2022.array, es2022.error, es2022.intl, es2022.object, es2022.string, es2022.regexp, es2023.array, es2023.collection, es2023.intl, es2024.arraybuffer, es2024.collection, es2024.object/esnext.object, es2024.promise, es2024.regexp/esnext.regexp, es2024.sharedmemory, es2024.string/esnext.string, esnext.array, esnext.collection, esnext.intl, esnext.disposable, esnext.promise, esnext.decorators, esnext.iterator, esnext.float16, esnext.typedarrays, esnext.error, esnext.sharedmemory, esnext.temporal, decorators, decorators.legacy +one or more: es5, es6/es2015, es7/es2016, es2017, es2018, es2019, es2020, es2021, es2022, es2023, es2024, esnext, dom, dom.iterable, dom.asynciterable, webworker, webworker.importscripts, webworker.iterable, webworker.asynciterable, scripthost, es2015.core, es2015.collection, es2015.generator, es2015.iterable, es2015.promise, es2015.proxy, es2015.reflect, es2015.symbol, es2015.symbol.wellknown, es2016.array.include, es2016.intl, es2017.arraybuffer, es2017.date, es2017.object, es2017.sharedmemory, es2017.string, es2017.intl, es2017.typedarrays, es2018.asyncgenerator, es2018.asynciterable/esnext.asynciterable, es2018.intl, es2018.promise, es2018.regexp, es2019.array, es2019.object, es2019.string, es2019.symbol/esnext.symbol, es2019.intl, es2020.bigint/esnext.bigint, es2020.date, es2020.promise, es2020.sharedmemory, es2020.string, es2020.symbol.wellknown, es2020.intl, es2020.number, es2021.promise, es2021.string, es2021.weakref/esnext.weakref, es2021.intl, es2022.array, es2022.error, es2022.intl, es2022.object, es2022.string, es2022.regexp, es2023.array, es2023.collection, es2023.intl, es2024.arraybuffer, es2024.collection, es2024.object/esnext.object, es2024.promise, es2024.regexp/esnext.regexp, es2024.sharedmemory, es2024.string/esnext.string, esnext.array, esnext.collection, esnext.intl, esnext.disposable, esnext.promise, esnext.decorators, esnext.iterator, esnext.float16, esnext.typedarrays, esnext.error, esnext.sharedmemory, esnext.temporal, esnext.date, decorators, decorators.legacy default: undefined --allowJs diff --git a/tests/baselines/reference/tsc/ignoreConfig/without-any-options-when-config-file-absent-with---ignoreConfig.js b/tests/baselines/reference/tsc/ignoreConfig/without-any-options-when-config-file-absent-with---ignoreConfig.js index c2629a398ce95..d8e8839395070 100644 --- a/tests/baselines/reference/tsc/ignoreConfig/without-any-options-when-config-file-absent-with---ignoreConfig.js +++ b/tests/baselines/reference/tsc/ignoreConfig/without-any-options-when-config-file-absent-with---ignoreConfig.js @@ -126,7 +126,7 @@ default: undefined --lib Specify a set of bundled library declaration files that describe the target runtime environment. -one or more: es5, es6/es2015, es7/es2016, es2017, es2018, es2019, es2020, es2021, es2022, es2023, es2024, esnext, dom, dom.iterable, dom.asynciterable, webworker, webworker.importscripts, webworker.iterable, webworker.asynciterable, scripthost, es2015.core, es2015.collection, es2015.generator, es2015.iterable, es2015.promise, es2015.proxy, es2015.reflect, es2015.symbol, es2015.symbol.wellknown, es2016.array.include, es2016.intl, es2017.arraybuffer, es2017.date, es2017.object, es2017.sharedmemory, es2017.string, es2017.intl, es2017.typedarrays, es2018.asyncgenerator, es2018.asynciterable/esnext.asynciterable, es2018.intl, es2018.promise, es2018.regexp, es2019.array, es2019.object, es2019.string, es2019.symbol/esnext.symbol, es2019.intl, es2020.bigint/esnext.bigint, es2020.date, es2020.promise, es2020.sharedmemory, es2020.string, es2020.symbol.wellknown, es2020.intl, es2020.number, es2021.promise, es2021.string, es2021.weakref/esnext.weakref, es2021.intl, es2022.array, es2022.error, es2022.intl, es2022.object, es2022.string, es2022.regexp, es2023.array, es2023.collection, es2023.intl, es2024.arraybuffer, es2024.collection, es2024.object/esnext.object, es2024.promise, es2024.regexp/esnext.regexp, es2024.sharedmemory, es2024.string/esnext.string, esnext.array, esnext.collection, esnext.intl, esnext.disposable, esnext.promise, esnext.decorators, esnext.iterator, esnext.float16, esnext.typedarrays, esnext.error, esnext.sharedmemory, esnext.temporal, decorators, decorators.legacy +one or more: es5, es6/es2015, es7/es2016, es2017, es2018, es2019, es2020, es2021, es2022, es2023, es2024, esnext, dom, dom.iterable, dom.asynciterable, webworker, webworker.importscripts, webworker.iterable, webworker.asynciterable, scripthost, es2015.core, es2015.collection, es2015.generator, es2015.iterable, es2015.promise, es2015.proxy, es2015.reflect, es2015.symbol, es2015.symbol.wellknown, es2016.array.include, es2016.intl, es2017.arraybuffer, es2017.date, es2017.object, es2017.sharedmemory, es2017.string, es2017.intl, es2017.typedarrays, es2018.asyncgenerator, es2018.asynciterable/esnext.asynciterable, es2018.intl, es2018.promise, es2018.regexp, es2019.array, es2019.object, es2019.string, es2019.symbol/esnext.symbol, es2019.intl, es2020.bigint/esnext.bigint, es2020.date, es2020.promise, es2020.sharedmemory, es2020.string, es2020.symbol.wellknown, es2020.intl, es2020.number, es2021.promise, es2021.string, es2021.weakref/esnext.weakref, es2021.intl, es2022.array, es2022.error, es2022.intl, es2022.object, es2022.string, es2022.regexp, es2023.array, es2023.collection, es2023.intl, es2024.arraybuffer, es2024.collection, es2024.object/esnext.object, es2024.promise, es2024.regexp/esnext.regexp, es2024.sharedmemory, es2024.string/esnext.string, esnext.array, esnext.collection, esnext.intl, esnext.disposable, esnext.promise, esnext.decorators, esnext.iterator, esnext.float16, esnext.typedarrays, esnext.error, esnext.sharedmemory, esnext.temporal, esnext.date, decorators, decorators.legacy default: undefined --allowJs diff --git a/tests/baselines/reference/tsc/ignoreConfig/without-any-options-when-config-file-absent.js b/tests/baselines/reference/tsc/ignoreConfig/without-any-options-when-config-file-absent.js index bd81958091295..086c90e9c2903 100644 --- a/tests/baselines/reference/tsc/ignoreConfig/without-any-options-when-config-file-absent.js +++ b/tests/baselines/reference/tsc/ignoreConfig/without-any-options-when-config-file-absent.js @@ -126,7 +126,7 @@ default: undefined --lib Specify a set of bundled library declaration files that describe the target runtime environment. -one or more: es5, es6/es2015, es7/es2016, es2017, es2018, es2019, es2020, es2021, es2022, es2023, es2024, esnext, dom, dom.iterable, dom.asynciterable, webworker, webworker.importscripts, webworker.iterable, webworker.asynciterable, scripthost, es2015.core, es2015.collection, es2015.generator, es2015.iterable, es2015.promise, es2015.proxy, es2015.reflect, es2015.symbol, es2015.symbol.wellknown, es2016.array.include, es2016.intl, es2017.arraybuffer, es2017.date, es2017.object, es2017.sharedmemory, es2017.string, es2017.intl, es2017.typedarrays, es2018.asyncgenerator, es2018.asynciterable/esnext.asynciterable, es2018.intl, es2018.promise, es2018.regexp, es2019.array, es2019.object, es2019.string, es2019.symbol/esnext.symbol, es2019.intl, es2020.bigint/esnext.bigint, es2020.date, es2020.promise, es2020.sharedmemory, es2020.string, es2020.symbol.wellknown, es2020.intl, es2020.number, es2021.promise, es2021.string, es2021.weakref/esnext.weakref, es2021.intl, es2022.array, es2022.error, es2022.intl, es2022.object, es2022.string, es2022.regexp, es2023.array, es2023.collection, es2023.intl, es2024.arraybuffer, es2024.collection, es2024.object/esnext.object, es2024.promise, es2024.regexp/esnext.regexp, es2024.sharedmemory, es2024.string/esnext.string, esnext.array, esnext.collection, esnext.intl, esnext.disposable, esnext.promise, esnext.decorators, esnext.iterator, esnext.float16, esnext.typedarrays, esnext.error, esnext.sharedmemory, esnext.temporal, decorators, decorators.legacy +one or more: es5, es6/es2015, es7/es2016, es2017, es2018, es2019, es2020, es2021, es2022, es2023, es2024, esnext, dom, dom.iterable, dom.asynciterable, webworker, webworker.importscripts, webworker.iterable, webworker.asynciterable, scripthost, es2015.core, es2015.collection, es2015.generator, es2015.iterable, es2015.promise, es2015.proxy, es2015.reflect, es2015.symbol, es2015.symbol.wellknown, es2016.array.include, es2016.intl, es2017.arraybuffer, es2017.date, es2017.object, es2017.sharedmemory, es2017.string, es2017.intl, es2017.typedarrays, es2018.asyncgenerator, es2018.asynciterable/esnext.asynciterable, es2018.intl, es2018.promise, es2018.regexp, es2019.array, es2019.object, es2019.string, es2019.symbol/esnext.symbol, es2019.intl, es2020.bigint/esnext.bigint, es2020.date, es2020.promise, es2020.sharedmemory, es2020.string, es2020.symbol.wellknown, es2020.intl, es2020.number, es2021.promise, es2021.string, es2021.weakref/esnext.weakref, es2021.intl, es2022.array, es2022.error, es2022.intl, es2022.object, es2022.string, es2022.regexp, es2023.array, es2023.collection, es2023.intl, es2024.arraybuffer, es2024.collection, es2024.object/esnext.object, es2024.promise, es2024.regexp/esnext.regexp, es2024.sharedmemory, es2024.string/esnext.string, esnext.array, esnext.collection, esnext.intl, esnext.disposable, esnext.promise, esnext.decorators, esnext.iterator, esnext.float16, esnext.typedarrays, esnext.error, esnext.sharedmemory, esnext.temporal, esnext.date, decorators, decorators.legacy default: undefined --allowJs diff --git a/tests/baselines/reference/tscWatch/symlinks/monorepo-style-sibling-packages-symlinked-Linux.js b/tests/baselines/reference/tscWatch/symlinks/monorepo-style-sibling-packages-symlinked-Linux.js index a9d7584a57057..063eb2ec84087 100644 --- a/tests/baselines/reference/tscWatch/symlinks/monorepo-style-sibling-packages-symlinked-Linux.js +++ b/tests/baselines/reference/tscWatch/symlinks/monorepo-style-sibling-packages-symlinked-Linux.js @@ -180,12 +180,12 @@ Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/projects/project/p //// [/home/src/tslibs/TS/Lib/lib.es2016.full.d.ts] *Lib* Inode:: 31 -//// [/home/src/projects/project/packages/package2/dist/index.js] Inode:: 124 +//// [/home/src/projects/project/packages/package2/dist/index.js] Inode:: 125 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -//// [/home/src/projects/project/packages/package2/dist/index.d.ts] Inode:: 125 +//// [/home/src/projects/project/packages/package2/dist/index.d.ts] Inode:: 126 export {}; @@ -220,7 +220,7 @@ FsWatches:: /home/src/projects/project/packages/package2: *new* {"inode":11} /home/src/projects/project/packages/package2/dist: *new* - {"inode":123} + {"inode":124} /home/src/projects/project/packages/package2/package.json: *new* {"inode":12} /home/src/projects/project/packages/package2/src: *new* @@ -270,20 +270,20 @@ exitCode:: ExitStatus.undefined Change:: Build dependencies Input:: -//// [/home/src/projects/project/packages/package1/dist/index.js] Inode:: 127 +//// [/home/src/projects/project/packages/package1/dist/index.js] Inode:: 128 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -//// [/home/src/projects/project/packages/package1/dist/index.d.ts] Inode:: 128 +//// [/home/src/projects/project/packages/package1/dist/index.d.ts] Inode:: 129 export type FooType = "foo"; export type BarType = "bar"; -//// [/home/src/projects/project/packages/package1/tsconfig.tsbuildinfo] Inode:: 129 +//// [/home/src/projects/project/packages/package1/tsconfig.tsbuildinfo] Inode:: 130 {"root":["./src/index.ts"],"version":"FakeTSVersion"} -//// [/home/src/projects/project/packages/package1/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 130 +//// [/home/src/projects/project/packages/package1/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 131 { "root": [ "./src/index.ts" @@ -335,7 +335,7 @@ FsWatches:: /home/src/projects/project/packages/package1: {"inode":6} /home/src/projects/project/packages/package1/dist: *new* - {"inode":126} + {"inode":127} /home/src/projects/project/packages/package1/package.json: {"inode":7} /home/src/projects/project/packages/package1/src: @@ -343,7 +343,7 @@ FsWatches:: /home/src/projects/project/packages/package2: {"inode":11} /home/src/projects/project/packages/package2/dist: - {"inode":123} + {"inode":124} /home/src/projects/project/packages/package2/package.json: {"inode":12} /home/src/projects/project/packages/package2/src: @@ -421,8 +421,8 @@ packages/package2/src/index.ts -//// [/home/src/projects/project/packages/package2/dist/index.js] file written with same contents Inode:: 124 -//// [/home/src/projects/project/packages/package2/dist/index.d.ts] file written with same contents Inode:: 125 +//// [/home/src/projects/project/packages/package2/dist/index.js] file written with same contents Inode:: 125 +//// [/home/src/projects/project/packages/package2/dist/index.d.ts] file written with same contents Inode:: 126 PolledWatches:: /home/src/projects/node_modules/@types: @@ -450,9 +450,9 @@ FsWatches:: /home/src/projects/project/packages/package1: {"inode":6} /home/src/projects/project/packages/package1/dist: - {"inode":126} + {"inode":127} /home/src/projects/project/packages/package1/dist/index.d.ts: *new* - {"inode":128} + {"inode":129} /home/src/projects/project/packages/package1/package.json: {"inode":7} /home/src/projects/project/packages/package1/src: @@ -460,7 +460,7 @@ FsWatches:: /home/src/projects/project/packages/package2: {"inode":11} /home/src/projects/project/packages/package2/dist: - {"inode":123} + {"inode":124} /home/src/projects/project/packages/package2/package.json: {"inode":12} /home/src/projects/project/packages/package2/src: @@ -555,7 +555,7 @@ FsWatches:: /home/src/projects/project/packages/package2: {"inode":11} /home/src/projects/project/packages/package2/dist: - {"inode":123} + {"inode":124} /home/src/projects/project/packages/package2/package.json: {"inode":12} /home/src/projects/project/packages/package2/src: @@ -569,9 +569,9 @@ FsWatches:: FsWatches *deleted*:: /home/src/projects/project/packages/package1/dist: - {"inode":126} + {"inode":127} /home/src/projects/project/packages/package1/dist/index.d.ts: - {"inode":128} + {"inode":129} Timeout callback:: count: 2 10: timerToUpdateProgram *new* @@ -657,8 +657,8 @@ Scheduling invalidateFailedLookup, Cancelled earlier one Elapsed:: *ms DirectoryWatcher:: Triggered with /home/src/projects/project/node_modules/package1 :: WatchInfo: /home/src/projects/project/node_modules/package1 1 undefined Failed Lookup Locations -//// [/home/src/projects/project/packages/package2/dist/index.js] file written with same contents Inode:: 124 -//// [/home/src/projects/project/packages/package2/dist/index.d.ts] file written with same contents Inode:: 125 +//// [/home/src/projects/project/packages/package2/dist/index.js] file written with same contents Inode:: 125 +//// [/home/src/projects/project/packages/package2/dist/index.d.ts] file written with same contents Inode:: 126 PolledWatches:: /home/src/projects/node_modules: *new* @@ -696,7 +696,7 @@ FsWatches:: /home/src/projects/project/packages/package2: {"inode":11} /home/src/projects/project/packages/package2/dist: - {"inode":123} + {"inode":124} /home/src/projects/project/packages/package2/package.json: {"inode":12} /home/src/projects/project/packages/package2/src: @@ -874,14 +874,14 @@ exitCode:: ExitStatus.undefined Change:: Build dependencies Input:: -//// [/home/src/projects/project/packages/package1/tsconfig.tsbuildinfo] file written with same contents Inode:: 129 -//// [/home/src/projects/project/packages/package1/tsconfig.tsbuildinfo.readable.baseline.txt] file written with same contents Inode:: 130 -//// [/home/src/projects/project/packages/package1/dist/index.js] Inode:: 132 +//// [/home/src/projects/project/packages/package1/tsconfig.tsbuildinfo] file written with same contents Inode:: 130 +//// [/home/src/projects/project/packages/package1/tsconfig.tsbuildinfo.readable.baseline.txt] file written with same contents Inode:: 131 +//// [/home/src/projects/project/packages/package1/dist/index.js] Inode:: 133 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -//// [/home/src/projects/project/packages/package1/dist/index.d.ts] Inode:: 133 +//// [/home/src/projects/project/packages/package1/dist/index.d.ts] Inode:: 134 export type FooType = "foo"; export type BarType = "bar"; @@ -928,7 +928,7 @@ FsWatches:: /home/src/projects/project/packages/package1: {"inode":6} /home/src/projects/project/packages/package1/dist: *new* - {"inode":131} + {"inode":132} /home/src/projects/project/packages/package1/package.json: {"inode":7} /home/src/projects/project/packages/package1/src: @@ -936,7 +936,7 @@ FsWatches:: /home/src/projects/project/packages/package2: {"inode":11} /home/src/projects/project/packages/package2/dist: - {"inode":123} + {"inode":124} /home/src/projects/project/packages/package2/package.json: {"inode":12} /home/src/projects/project/packages/package2/src: @@ -1014,8 +1014,8 @@ packages/package2/src/index.ts -//// [/home/src/projects/project/packages/package2/dist/index.js] file written with same contents Inode:: 124 -//// [/home/src/projects/project/packages/package2/dist/index.d.ts] file written with same contents Inode:: 125 +//// [/home/src/projects/project/packages/package2/dist/index.js] file written with same contents Inode:: 125 +//// [/home/src/projects/project/packages/package2/dist/index.d.ts] file written with same contents Inode:: 126 PolledWatches:: /home/src/projects/node_modules/@types: @@ -1043,9 +1043,9 @@ FsWatches:: /home/src/projects/project/packages/package1: {"inode":6} /home/src/projects/project/packages/package1/dist: - {"inode":131} + {"inode":132} /home/src/projects/project/packages/package1/dist/index.d.ts: *new* - {"inode":133} + {"inode":134} /home/src/projects/project/packages/package1/package.json: {"inode":7} /home/src/projects/project/packages/package1/src: @@ -1053,7 +1053,7 @@ FsWatches:: /home/src/projects/project/packages/package2: {"inode":11} /home/src/projects/project/packages/package2/dist: - {"inode":123} + {"inode":124} /home/src/projects/project/packages/package2/package.json: {"inode":12} /home/src/projects/project/packages/package2/src: diff --git a/tests/baselines/reference/tscWatch/symlinks/monorepo-style-sibling-packages-symlinked-package1-built-Linux.js b/tests/baselines/reference/tscWatch/symlinks/monorepo-style-sibling-packages-symlinked-package1-built-Linux.js index 5de3ecc7aeb03..eee82fe8e69bc 100644 --- a/tests/baselines/reference/tscWatch/symlinks/monorepo-style-sibling-packages-symlinked-package1-built-Linux.js +++ b/tests/baselines/reference/tscWatch/symlinks/monorepo-style-sibling-packages-symlinked-package1-built-Linux.js @@ -83,20 +83,20 @@ declare const console: { log(msg: any): void; }; //// [/home/src/tslibs/TS/Lib/lib.es2016.full.d.ts] *Lib* Inode:: 31 -//// [/home/src/projects/project/packages/package1/dist/index.js] Inode:: 124 +//// [/home/src/projects/project/packages/package1/dist/index.js] Inode:: 125 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -//// [/home/src/projects/project/packages/package1/dist/index.d.ts] Inode:: 125 +//// [/home/src/projects/project/packages/package1/dist/index.d.ts] Inode:: 126 export type FooType = "foo"; export type BarType = "bar"; -//// [/home/src/projects/project/packages/package1/tsconfig.tsbuildinfo] Inode:: 126 +//// [/home/src/projects/project/packages/package1/tsconfig.tsbuildinfo] Inode:: 127 {"root":["./src/index.ts"],"version":"FakeTSVersion"} -//// [/home/src/projects/project/packages/package1/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 127 +//// [/home/src/projects/project/packages/package1/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 128 { "root": [ "./src/index.ts" @@ -176,12 +176,12 @@ DirectoryWatcher:: Added:: WatchInfo: /home/src/projects/project/packages/packag Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/projects/project/packages/package2 1 undefined Wild card directory -//// [/home/src/projects/project/packages/package2/dist/index.js] Inode:: 129 +//// [/home/src/projects/project/packages/package2/dist/index.js] Inode:: 130 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -//// [/home/src/projects/project/packages/package2/dist/index.d.ts] Inode:: 130 +//// [/home/src/projects/project/packages/package2/dist/index.d.ts] Inode:: 131 export {}; @@ -208,9 +208,9 @@ FsWatches:: /home/src/projects/project/packages/package1: *new* {"inode":6} /home/src/projects/project/packages/package1/dist: *new* - {"inode":123} + {"inode":124} /home/src/projects/project/packages/package1/dist/index.d.ts: *new* - {"inode":125} + {"inode":126} /home/src/projects/project/packages/package1/package.json: *new* {"inode":7} /home/src/projects/project/packages/package1/src: *new* @@ -218,7 +218,7 @@ FsWatches:: /home/src/projects/project/packages/package2: *new* {"inode":11} /home/src/projects/project/packages/package2/dist: *new* - {"inode":128} + {"inode":129} /home/src/projects/project/packages/package2/package.json: *new* {"inode":12} /home/src/projects/project/packages/package2/src: *new* @@ -314,7 +314,7 @@ FsWatches:: /home/src/projects/project/packages/package2: {"inode":11} /home/src/projects/project/packages/package2/dist: - {"inode":128} + {"inode":129} /home/src/projects/project/packages/package2/package.json: {"inode":12} /home/src/projects/project/packages/package2/src: @@ -328,9 +328,9 @@ FsWatches:: FsWatches *deleted*:: /home/src/projects/project/packages/package1/dist: - {"inode":123} + {"inode":124} /home/src/projects/project/packages/package1/dist/index.d.ts: - {"inode":125} + {"inode":126} Timeout callback:: count: 2 1: timerToUpdateProgram *new* @@ -419,8 +419,8 @@ Elapsed:: *ms DirectoryWatcher:: Triggered with /home/src/projects/project/node_ sysLog:: Elapsed:: *ms:: onTimerToUpdateChildWatches:: 0 undefined -//// [/home/src/projects/project/packages/package2/dist/index.js] file written with same contents Inode:: 129 -//// [/home/src/projects/project/packages/package2/dist/index.d.ts] file written with same contents Inode:: 130 +//// [/home/src/projects/project/packages/package2/dist/index.js] file written with same contents Inode:: 130 +//// [/home/src/projects/project/packages/package2/dist/index.d.ts] file written with same contents Inode:: 131 PolledWatches:: /home/src/projects/node_modules: *new* @@ -458,7 +458,7 @@ FsWatches:: /home/src/projects/project/packages/package2: {"inode":11} /home/src/projects/project/packages/package2/dist: - {"inode":128} + {"inode":129} /home/src/projects/project/packages/package2/package.json: {"inode":12} /home/src/projects/project/packages/package2/src: @@ -636,14 +636,14 @@ exitCode:: ExitStatus.undefined Change:: Build dependencies Input:: -//// [/home/src/projects/project/packages/package1/tsconfig.tsbuildinfo] file written with same contents Inode:: 126 -//// [/home/src/projects/project/packages/package1/tsconfig.tsbuildinfo.readable.baseline.txt] file written with same contents Inode:: 127 -//// [/home/src/projects/project/packages/package1/dist/index.js] Inode:: 132 +//// [/home/src/projects/project/packages/package1/tsconfig.tsbuildinfo] file written with same contents Inode:: 127 +//// [/home/src/projects/project/packages/package1/tsconfig.tsbuildinfo.readable.baseline.txt] file written with same contents Inode:: 128 +//// [/home/src/projects/project/packages/package1/dist/index.js] Inode:: 133 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -//// [/home/src/projects/project/packages/package1/dist/index.d.ts] Inode:: 133 +//// [/home/src/projects/project/packages/package1/dist/index.d.ts] Inode:: 134 export type FooType = "foo"; export type BarType = "bar"; @@ -690,7 +690,7 @@ FsWatches:: /home/src/projects/project/packages/package1: {"inode":6} /home/src/projects/project/packages/package1/dist: *new* - {"inode":131} + {"inode":132} /home/src/projects/project/packages/package1/package.json: {"inode":7} /home/src/projects/project/packages/package1/src: @@ -698,7 +698,7 @@ FsWatches:: /home/src/projects/project/packages/package2: {"inode":11} /home/src/projects/project/packages/package2/dist: - {"inode":128} + {"inode":129} /home/src/projects/project/packages/package2/package.json: {"inode":12} /home/src/projects/project/packages/package2/src: @@ -776,8 +776,8 @@ packages/package2/src/index.ts -//// [/home/src/projects/project/packages/package2/dist/index.js] file written with same contents Inode:: 129 -//// [/home/src/projects/project/packages/package2/dist/index.d.ts] file written with same contents Inode:: 130 +//// [/home/src/projects/project/packages/package2/dist/index.js] file written with same contents Inode:: 130 +//// [/home/src/projects/project/packages/package2/dist/index.d.ts] file written with same contents Inode:: 131 PolledWatches:: /home/src/projects/node_modules/@types: @@ -805,9 +805,9 @@ FsWatches:: /home/src/projects/project/packages/package1: {"inode":6} /home/src/projects/project/packages/package1/dist: - {"inode":131} + {"inode":132} /home/src/projects/project/packages/package1/dist/index.d.ts: *new* - {"inode":133} + {"inode":134} /home/src/projects/project/packages/package1/package.json: {"inode":7} /home/src/projects/project/packages/package1/src: @@ -815,7 +815,7 @@ FsWatches:: /home/src/projects/project/packages/package2: {"inode":11} /home/src/projects/project/packages/package2/dist: - {"inode":128} + {"inode":129} /home/src/projects/project/packages/package2/package.json: {"inode":12} /home/src/projects/project/packages/package2/src: diff --git a/tests/baselines/reference/tscWatch/symlinks/packages-outside-project-folder-Linux.js b/tests/baselines/reference/tscWatch/symlinks/packages-outside-project-folder-Linux.js index da4361f0c93af..3463339d436ff 100644 --- a/tests/baselines/reference/tscWatch/symlinks/packages-outside-project-folder-Linux.js +++ b/tests/baselines/reference/tscWatch/symlinks/packages-outside-project-folder-Linux.js @@ -203,7 +203,7 @@ DirectoryWatcher:: Added:: WatchInfo: /home/src/projects/b/2/b-impl/b/src 1 unde Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/projects/b/2/b-impl/b/src 1 undefined Wild card directory -//// [/home/src/projects/b/2/b-impl/b/lib/index.js] Inode:: 145 +//// [/home/src/projects/b/2/b-impl/b/lib/index.js] Inode:: 146 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); @@ -291,7 +291,7 @@ exitCode:: ExitStatus.undefined Change:: change in unrelated folder in a Input:: -//// [/home/src/projects/a/2/unrelated/somethingUnrelated.ts] Inode:: 146 +//// [/home/src/projects/a/2/unrelated/somethingUnrelated.ts] Inode:: 147 export const a = 10; @@ -309,7 +309,7 @@ exitCode:: ExitStatus.undefined Change:: change in unrelated folder in c Input:: -//// [/home/src/projects/c/4/unrelated/somethingUnrelated.ts] Inode:: 147 +//// [/home/src/projects/c/4/unrelated/somethingUnrelated.ts] Inode:: 148 export const a = 10; @@ -327,18 +327,18 @@ exitCode:: ExitStatus.undefined Change:: Build dependencies Input:: -//// [/home/src/projects/c/3/c-impl/c/lib/c.js] Inode:: 149 +//// [/home/src/projects/c/3/c-impl/c/lib/c.js] Inode:: 150 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.c = void 0; exports.c = 'test'; -//// [/home/src/projects/c/3/c-impl/c/lib/c.d.ts] Inode:: 150 +//// [/home/src/projects/c/3/c-impl/c/lib/c.d.ts] Inode:: 151 export declare const c: string; -//// [/home/src/projects/c/3/c-impl/c/lib/index.js] Inode:: 151 +//// [/home/src/projects/c/3/c-impl/c/lib/index.js] Inode:: 152 "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; @@ -358,14 +358,14 @@ Object.defineProperty(exports, "__esModule", { value: true }); __exportStar(require("./c"), exports); -//// [/home/src/projects/c/3/c-impl/c/lib/index.d.ts] Inode:: 152 +//// [/home/src/projects/c/3/c-impl/c/lib/index.d.ts] Inode:: 153 export * from './c'; -//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo] Inode:: 153 +//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo] Inode:: 154 {"root":["../src/c.ts","../src/index.ts"],"version":"FakeTSVersion"} -//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 154 +//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 155 { "root": [ "../src/c.ts", @@ -375,18 +375,18 @@ export * from './c'; "size": 68 } -//// [/home/src/projects/a/1/a-impl/a/lib/a.js] Inode:: 156 +//// [/home/src/projects/a/1/a-impl/a/lib/a.js] Inode:: 157 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.a = void 0; exports.a = 'test'; -//// [/home/src/projects/a/1/a-impl/a/lib/a.d.ts] Inode:: 157 +//// [/home/src/projects/a/1/a-impl/a/lib/a.d.ts] Inode:: 158 export declare const a: string; -//// [/home/src/projects/a/1/a-impl/a/lib/index.js] Inode:: 158 +//// [/home/src/projects/a/1/a-impl/a/lib/index.js] Inode:: 159 "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; @@ -407,15 +407,15 @@ __exportStar(require("./a"), exports); __exportStar(require("c"), exports); -//// [/home/src/projects/a/1/a-impl/a/lib/index.d.ts] Inode:: 159 +//// [/home/src/projects/a/1/a-impl/a/lib/index.d.ts] Inode:: 160 export * from './a'; export * from 'c'; -//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo] Inode:: 160 +//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo] Inode:: 161 {"root":["../src/a.ts","../src/index.ts"],"version":"FakeTSVersion"} -//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 161 +//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 162 { "root": [ "../src/a.ts", @@ -469,7 +469,7 @@ FsWatches:: /home/src/projects/a/1/a-impl/a: {"inode":19} /home/src/projects/a/1/a-impl/a/lib: *new* - {"inode":155} + {"inode":156} /home/src/projects/a/1/a-impl/a/node_modules: {"inode":25} /home/src/projects/a/1/a-impl/a/package.json: @@ -625,7 +625,7 @@ src/index.ts -//// [/home/src/projects/b/2/b-impl/b/lib/index.js] file written with same contents Inode:: 145 +//// [/home/src/projects/b/2/b-impl/b/lib/index.js] file written with same contents Inode:: 146 PolledWatches:: /home/src/projects/a/1/a-impl/a/lib/node_modules: *new* @@ -655,11 +655,11 @@ FsWatches:: /home/src/projects: {"inode":3} /home/src/projects/a/1/a-impl/a/lib: - {"inode":155} + {"inode":156} /home/src/projects/a/1/a-impl/a/lib/a.d.ts: *new* - {"inode":157} + {"inode":158} /home/src/projects/a/1/a-impl/a/lib/index.d.ts: *new* - {"inode":159} + {"inode":160} /home/src/projects/a/1/a-impl/a/node_modules: {"inode":25} /home/src/projects/a/1/a-impl/a/package.json: @@ -681,11 +681,11 @@ FsWatches:: /home/src/projects/b/2/b-impl/b/tsconfig.json: {"inode":36} /home/src/projects/c/3/c-impl/c/lib: *new* - {"inode":148} + {"inode":149} /home/src/projects/c/3/c-impl/c/lib/c.d.ts: *new* - {"inode":150} + {"inode":151} /home/src/projects/c/3/c-impl/c/lib/index.d.ts: *new* - {"inode":152} + {"inode":153} /home/src/projects/c/3/c-impl/c/package.json: *new* {"inode":12} /home/src/tslibs/TS/Lib/lib.d.ts: @@ -740,7 +740,7 @@ exitCode:: ExitStatus.undefined Change:: change in unrelated folder in a Input:: -//// [/home/src/projects/a/2/unrelated/anotherFile.ts] Inode:: 162 +//// [/home/src/projects/a/2/unrelated/anotherFile.ts] Inode:: 163 export const a = 10; @@ -758,7 +758,7 @@ exitCode:: ExitStatus.undefined Change:: change in unrelated folder in c Input:: -//// [/home/src/projects/c/4/unrelated/anotherFile.ts] Inode:: 163 +//// [/home/src/projects/c/4/unrelated/anotherFile.ts] Inode:: 164 export const a = 10; @@ -908,17 +908,17 @@ FsWatches:: FsWatches *deleted*:: /home/src/projects/a/1/a-impl/a/lib: - {"inode":155} + {"inode":156} /home/src/projects/a/1/a-impl/a/lib/a.d.ts: - {"inode":157} + {"inode":158} /home/src/projects/a/1/a-impl/a/lib/index.d.ts: - {"inode":159} + {"inode":160} /home/src/projects/c/3/c-impl/c/lib: - {"inode":148} + {"inode":149} /home/src/projects/c/3/c-impl/c/lib/c.d.ts: - {"inode":150} + {"inode":151} /home/src/projects/c/3/c-impl/c/lib/index.d.ts: - {"inode":152} + {"inode":153} Timeout callback:: count: 2 18: timerToUpdateProgram *new* @@ -1022,7 +1022,7 @@ src/index.ts -//// [/home/src/projects/b/2/b-impl/b/lib/index.js] file written with same contents Inode:: 145 +//// [/home/src/projects/b/2/b-impl/b/lib/index.js] file written with same contents Inode:: 146 PolledWatches:: /home/src/projects/b/2/b-impl/b/node_modules/@types: @@ -1147,18 +1147,18 @@ exitCode:: ExitStatus.undefined Change:: Build dependencies Input:: -//// [/home/src/projects/c/3/c-impl/c/lib/c.js] Inode:: 165 +//// [/home/src/projects/c/3/c-impl/c/lib/c.js] Inode:: 166 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.c = void 0; exports.c = 'test'; -//// [/home/src/projects/c/3/c-impl/c/lib/c.d.ts] Inode:: 166 +//// [/home/src/projects/c/3/c-impl/c/lib/c.d.ts] Inode:: 167 export declare const c: string; -//// [/home/src/projects/c/3/c-impl/c/lib/index.js] Inode:: 167 +//// [/home/src/projects/c/3/c-impl/c/lib/index.js] Inode:: 168 "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; @@ -1178,14 +1178,14 @@ Object.defineProperty(exports, "__esModule", { value: true }); __exportStar(require("./c"), exports); -//// [/home/src/projects/c/3/c-impl/c/lib/index.d.ts] Inode:: 168 +//// [/home/src/projects/c/3/c-impl/c/lib/index.d.ts] Inode:: 169 export * from './c'; -//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo] Inode:: 169 +//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo] Inode:: 170 {"root":["../src/c.ts","../src/index.ts"],"version":"FakeTSVersion"} -//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 170 +//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 171 { "root": [ "../src/c.ts", @@ -1195,18 +1195,18 @@ export * from './c'; "size": 68 } -//// [/home/src/projects/a/1/a-impl/a/lib/a.js] Inode:: 172 +//// [/home/src/projects/a/1/a-impl/a/lib/a.js] Inode:: 173 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.a = void 0; exports.a = 'test'; -//// [/home/src/projects/a/1/a-impl/a/lib/a.d.ts] Inode:: 173 +//// [/home/src/projects/a/1/a-impl/a/lib/a.d.ts] Inode:: 174 export declare const a: string; -//// [/home/src/projects/a/1/a-impl/a/lib/index.js] Inode:: 174 +//// [/home/src/projects/a/1/a-impl/a/lib/index.js] Inode:: 175 "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; @@ -1227,15 +1227,15 @@ __exportStar(require("./a"), exports); __exportStar(require("c"), exports); -//// [/home/src/projects/a/1/a-impl/a/lib/index.d.ts] Inode:: 175 +//// [/home/src/projects/a/1/a-impl/a/lib/index.d.ts] Inode:: 176 export * from './a'; export * from 'c'; -//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo] Inode:: 176 +//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo] Inode:: 177 {"root":["../src/a.ts","../src/index.ts"],"version":"FakeTSVersion"} -//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 177 +//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 178 { "root": [ "../src/a.ts", @@ -1289,7 +1289,7 @@ FsWatches:: /home/src/projects/a/1/a-impl/a: {"inode":19} /home/src/projects/a/1/a-impl/a/lib: *new* - {"inode":171} + {"inode":172} /home/src/projects/a/1/a-impl/a/node_modules: {"inode":25} /home/src/projects/a/1/a-impl/a/package.json: @@ -1443,7 +1443,7 @@ src/index.ts -//// [/home/src/projects/b/2/b-impl/b/lib/index.js] file written with same contents Inode:: 145 +//// [/home/src/projects/b/2/b-impl/b/lib/index.js] file written with same contents Inode:: 146 PolledWatches:: /home/src/projects/a/1/a-impl/a/lib/node_modules: *new* @@ -1473,11 +1473,11 @@ FsWatches:: /home/src/projects: {"inode":3} /home/src/projects/a/1/a-impl/a/lib: - {"inode":171} + {"inode":172} /home/src/projects/a/1/a-impl/a/lib/a.d.ts: *new* - {"inode":173} + {"inode":174} /home/src/projects/a/1/a-impl/a/lib/index.d.ts: *new* - {"inode":175} + {"inode":176} /home/src/projects/a/1/a-impl/a/node_modules: {"inode":25} /home/src/projects/a/1/a-impl/a/package.json: @@ -1499,11 +1499,11 @@ FsWatches:: /home/src/projects/b/2/b-impl/b/tsconfig.json: {"inode":36} /home/src/projects/c/3/c-impl/c/lib: *new* - {"inode":164} + {"inode":165} /home/src/projects/c/3/c-impl/c/lib/c.d.ts: *new* - {"inode":166} + {"inode":167} /home/src/projects/c/3/c-impl/c/lib/index.d.ts: *new* - {"inode":168} + {"inode":169} /home/src/projects/c/3/c-impl/c/package.json: *new* {"inode":12} /home/src/tslibs/TS/Lib/lib.d.ts: diff --git a/tests/baselines/reference/tscWatch/symlinks/packages-outside-project-folder-MacOs.js b/tests/baselines/reference/tscWatch/symlinks/packages-outside-project-folder-MacOs.js index 7df25cac1d7a8..071939be41163 100644 --- a/tests/baselines/reference/tscWatch/symlinks/packages-outside-project-folder-MacOs.js +++ b/tests/baselines/reference/tscWatch/symlinks/packages-outside-project-folder-MacOs.js @@ -203,7 +203,7 @@ DirectoryWatcher:: Added:: WatchInfo: /home/src/projects/b/2/b-impl/b/src 1 unde Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/projects/b/2/b-impl/b/src 1 undefined Wild card directory -//// [/home/src/projects/b/2/b-impl/b/lib/index.js] Inode:: 145 +//// [/home/src/projects/b/2/b-impl/b/lib/index.js] Inode:: 146 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); @@ -287,7 +287,7 @@ exitCode:: ExitStatus.undefined Change:: change in unrelated folder in a Input:: -//// [/home/src/projects/a/2/unrelated/somethingUnrelated.ts] Inode:: 146 +//// [/home/src/projects/a/2/unrelated/somethingUnrelated.ts] Inode:: 147 export const a = 10; @@ -305,7 +305,7 @@ exitCode:: ExitStatus.undefined Change:: change in unrelated folder in c Input:: -//// [/home/src/projects/c/4/unrelated/somethingUnrelated.ts] Inode:: 147 +//// [/home/src/projects/c/4/unrelated/somethingUnrelated.ts] Inode:: 148 export const a = 10; @@ -323,18 +323,18 @@ exitCode:: ExitStatus.undefined Change:: Build dependencies Input:: -//// [/home/src/projects/c/3/c-impl/c/lib/c.js] Inode:: 149 +//// [/home/src/projects/c/3/c-impl/c/lib/c.js] Inode:: 150 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.c = void 0; exports.c = 'test'; -//// [/home/src/projects/c/3/c-impl/c/lib/c.d.ts] Inode:: 150 +//// [/home/src/projects/c/3/c-impl/c/lib/c.d.ts] Inode:: 151 export declare const c: string; -//// [/home/src/projects/c/3/c-impl/c/lib/index.js] Inode:: 151 +//// [/home/src/projects/c/3/c-impl/c/lib/index.js] Inode:: 152 "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; @@ -354,14 +354,14 @@ Object.defineProperty(exports, "__esModule", { value: true }); __exportStar(require("./c"), exports); -//// [/home/src/projects/c/3/c-impl/c/lib/index.d.ts] Inode:: 152 +//// [/home/src/projects/c/3/c-impl/c/lib/index.d.ts] Inode:: 153 export * from './c'; -//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo] Inode:: 153 +//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo] Inode:: 154 {"root":["../src/c.ts","../src/index.ts"],"version":"FakeTSVersion"} -//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 154 +//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 155 { "root": [ "../src/c.ts", @@ -371,18 +371,18 @@ export * from './c'; "size": 68 } -//// [/home/src/projects/a/1/a-impl/a/lib/a.js] Inode:: 156 +//// [/home/src/projects/a/1/a-impl/a/lib/a.js] Inode:: 157 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.a = void 0; exports.a = 'test'; -//// [/home/src/projects/a/1/a-impl/a/lib/a.d.ts] Inode:: 157 +//// [/home/src/projects/a/1/a-impl/a/lib/a.d.ts] Inode:: 158 export declare const a: string; -//// [/home/src/projects/a/1/a-impl/a/lib/index.js] Inode:: 158 +//// [/home/src/projects/a/1/a-impl/a/lib/index.js] Inode:: 159 "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; @@ -403,15 +403,15 @@ __exportStar(require("./a"), exports); __exportStar(require("c"), exports); -//// [/home/src/projects/a/1/a-impl/a/lib/index.d.ts] Inode:: 159 +//// [/home/src/projects/a/1/a-impl/a/lib/index.d.ts] Inode:: 160 export * from './a'; export * from 'c'; -//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo] Inode:: 160 +//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo] Inode:: 161 {"root":["../src/a.ts","../src/index.ts"],"version":"FakeTSVersion"} -//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 161 +//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 162 { "root": [ "../src/a.ts", @@ -574,7 +574,7 @@ src/index.ts -//// [/home/src/projects/b/2/b-impl/b/lib/index.js] file written with same contents Inode:: 145 +//// [/home/src/projects/b/2/b-impl/b/lib/index.js] file written with same contents Inode:: 146 PolledWatches:: /home/src/projects/a/1/a-impl/a/lib/node_modules: *new* @@ -604,9 +604,9 @@ FsWatches:: /home/src/projects: {"inode":3} /home/src/projects/a/1/a-impl/a/lib/a.d.ts: *new* - {"inode":157} + {"inode":158} /home/src/projects/a/1/a-impl/a/lib/index.d.ts: *new* - {"inode":159} + {"inode":160} /home/src/projects/a/1/a-impl/a/package.json: {"inode":24} /home/src/projects/b: @@ -622,9 +622,9 @@ FsWatches:: /home/src/projects/b/2/b-impl/b/tsconfig.json: {"inode":36} /home/src/projects/c/3/c-impl/c/lib/c.d.ts: *new* - {"inode":150} + {"inode":151} /home/src/projects/c/3/c-impl/c/lib/index.d.ts: *new* - {"inode":152} + {"inode":153} /home/src/projects/c/3/c-impl/c/package.json: *new* {"inode":12} /home/src/tslibs/TS/Lib/lib.d.ts: @@ -691,7 +691,7 @@ exitCode:: ExitStatus.undefined Change:: change in unrelated folder in a Input:: -//// [/home/src/projects/a/2/unrelated/anotherFile.ts] Inode:: 162 +//// [/home/src/projects/a/2/unrelated/anotherFile.ts] Inode:: 163 export const a = 10; @@ -720,7 +720,7 @@ exitCode:: ExitStatus.undefined Change:: change in unrelated folder in c Input:: -//// [/home/src/projects/c/4/unrelated/anotherFile.ts] Inode:: 163 +//// [/home/src/projects/c/4/unrelated/anotherFile.ts] Inode:: 164 export const a = 10; @@ -869,13 +869,13 @@ FsWatches:: FsWatches *deleted*:: /home/src/projects/a/1/a-impl/a/lib/a.d.ts: - {"inode":157} + {"inode":158} /home/src/projects/a/1/a-impl/a/lib/index.d.ts: - {"inode":159} + {"inode":160} /home/src/projects/c/3/c-impl/c/lib/c.d.ts: - {"inode":150} + {"inode":151} /home/src/projects/c/3/c-impl/c/lib/index.d.ts: - {"inode":152} + {"inode":153} FsWatchesRecursive:: /home/src/projects/a: @@ -991,7 +991,7 @@ src/index.ts -//// [/home/src/projects/b/2/b-impl/b/lib/index.js] file written with same contents Inode:: 145 +//// [/home/src/projects/b/2/b-impl/b/lib/index.js] file written with same contents Inode:: 146 PolledWatches:: /home/src/projects/b/2/b-impl/b/node_modules/@types: @@ -1097,18 +1097,18 @@ exitCode:: ExitStatus.undefined Change:: Build dependencies Input:: -//// [/home/src/projects/c/3/c-impl/c/lib/c.js] Inode:: 165 +//// [/home/src/projects/c/3/c-impl/c/lib/c.js] Inode:: 166 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.c = void 0; exports.c = 'test'; -//// [/home/src/projects/c/3/c-impl/c/lib/c.d.ts] Inode:: 166 +//// [/home/src/projects/c/3/c-impl/c/lib/c.d.ts] Inode:: 167 export declare const c: string; -//// [/home/src/projects/c/3/c-impl/c/lib/index.js] Inode:: 167 +//// [/home/src/projects/c/3/c-impl/c/lib/index.js] Inode:: 168 "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; @@ -1128,14 +1128,14 @@ Object.defineProperty(exports, "__esModule", { value: true }); __exportStar(require("./c"), exports); -//// [/home/src/projects/c/3/c-impl/c/lib/index.d.ts] Inode:: 168 +//// [/home/src/projects/c/3/c-impl/c/lib/index.d.ts] Inode:: 169 export * from './c'; -//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo] Inode:: 169 +//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo] Inode:: 170 {"root":["../src/c.ts","../src/index.ts"],"version":"FakeTSVersion"} -//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 170 +//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 171 { "root": [ "../src/c.ts", @@ -1145,18 +1145,18 @@ export * from './c'; "size": 68 } -//// [/home/src/projects/a/1/a-impl/a/lib/a.js] Inode:: 172 +//// [/home/src/projects/a/1/a-impl/a/lib/a.js] Inode:: 173 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.a = void 0; exports.a = 'test'; -//// [/home/src/projects/a/1/a-impl/a/lib/a.d.ts] Inode:: 173 +//// [/home/src/projects/a/1/a-impl/a/lib/a.d.ts] Inode:: 174 export declare const a: string; -//// [/home/src/projects/a/1/a-impl/a/lib/index.js] Inode:: 174 +//// [/home/src/projects/a/1/a-impl/a/lib/index.js] Inode:: 175 "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; @@ -1177,15 +1177,15 @@ __exportStar(require("./a"), exports); __exportStar(require("c"), exports); -//// [/home/src/projects/a/1/a-impl/a/lib/index.d.ts] Inode:: 175 +//// [/home/src/projects/a/1/a-impl/a/lib/index.d.ts] Inode:: 176 export * from './a'; export * from 'c'; -//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo] Inode:: 176 +//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo] Inode:: 177 {"root":["../src/a.ts","../src/index.ts"],"version":"FakeTSVersion"} -//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 177 +//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 178 { "root": [ "../src/a.ts", @@ -1346,7 +1346,7 @@ src/index.ts -//// [/home/src/projects/b/2/b-impl/b/lib/index.js] file written with same contents Inode:: 145 +//// [/home/src/projects/b/2/b-impl/b/lib/index.js] file written with same contents Inode:: 146 PolledWatches:: /home/src/projects/a/1/a-impl/a/lib/node_modules: *new* @@ -1376,9 +1376,9 @@ FsWatches:: /home/src/projects: {"inode":3} /home/src/projects/a/1/a-impl/a/lib/a.d.ts: *new* - {"inode":173} + {"inode":174} /home/src/projects/a/1/a-impl/a/lib/index.d.ts: *new* - {"inode":175} + {"inode":176} /home/src/projects/a/1/a-impl/a/package.json: {"inode":24} /home/src/projects/b: @@ -1394,9 +1394,9 @@ FsWatches:: /home/src/projects/b/2/b-impl/b/tsconfig.json: {"inode":36} /home/src/projects/c/3/c-impl/c/lib/c.d.ts: *new* - {"inode":166} + {"inode":167} /home/src/projects/c/3/c-impl/c/lib/index.d.ts: *new* - {"inode":168} + {"inode":169} /home/src/projects/c/3/c-impl/c/package.json: *new* {"inode":12} /home/src/tslibs/TS/Lib/lib.d.ts: diff --git a/tests/baselines/reference/tscWatch/symlinks/packages-outside-project-folder-built-Linux.js b/tests/baselines/reference/tscWatch/symlinks/packages-outside-project-folder-built-Linux.js index 45d715974e609..d0e3051efeae6 100644 --- a/tests/baselines/reference/tscWatch/symlinks/packages-outside-project-folder-built-Linux.js +++ b/tests/baselines/reference/tscWatch/symlinks/packages-outside-project-folder-built-Linux.js @@ -87,18 +87,18 @@ interface Array { length: number; [n: number]: T; } interface ReadonlyArray {} declare const console: { log(msg: any): void; }; -//// [/home/src/projects/c/3/c-impl/c/lib/c.js] Inode:: 145 +//// [/home/src/projects/c/3/c-impl/c/lib/c.js] Inode:: 146 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.c = void 0; exports.c = 'test'; -//// [/home/src/projects/c/3/c-impl/c/lib/c.d.ts] Inode:: 146 +//// [/home/src/projects/c/3/c-impl/c/lib/c.d.ts] Inode:: 147 export declare const c: string; -//// [/home/src/projects/c/3/c-impl/c/lib/index.js] Inode:: 147 +//// [/home/src/projects/c/3/c-impl/c/lib/index.js] Inode:: 148 "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; @@ -118,14 +118,14 @@ Object.defineProperty(exports, "__esModule", { value: true }); __exportStar(require("./c"), exports); -//// [/home/src/projects/c/3/c-impl/c/lib/index.d.ts] Inode:: 148 +//// [/home/src/projects/c/3/c-impl/c/lib/index.d.ts] Inode:: 149 export * from './c'; -//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo] Inode:: 149 +//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo] Inode:: 150 {"root":["../src/c.ts","../src/index.ts"],"version":"FakeTSVersion"} -//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 150 +//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 151 { "root": [ "../src/c.ts", @@ -135,18 +135,18 @@ export * from './c'; "size": 68 } -//// [/home/src/projects/a/1/a-impl/a/lib/a.js] Inode:: 152 +//// [/home/src/projects/a/1/a-impl/a/lib/a.js] Inode:: 153 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.a = void 0; exports.a = 'test'; -//// [/home/src/projects/a/1/a-impl/a/lib/a.d.ts] Inode:: 153 +//// [/home/src/projects/a/1/a-impl/a/lib/a.d.ts] Inode:: 154 export declare const a: string; -//// [/home/src/projects/a/1/a-impl/a/lib/index.js] Inode:: 154 +//// [/home/src/projects/a/1/a-impl/a/lib/index.js] Inode:: 155 "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; @@ -167,15 +167,15 @@ __exportStar(require("./a"), exports); __exportStar(require("c"), exports); -//// [/home/src/projects/a/1/a-impl/a/lib/index.d.ts] Inode:: 155 +//// [/home/src/projects/a/1/a-impl/a/lib/index.d.ts] Inode:: 156 export * from './a'; export * from 'c'; -//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo] Inode:: 156 +//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo] Inode:: 157 {"root":["../src/a.ts","../src/index.ts"],"version":"FakeTSVersion"} -//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 157 +//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 158 { "root": [ "../src/a.ts", @@ -317,7 +317,7 @@ DirectoryWatcher:: Added:: WatchInfo: /home/src/projects/b/2/b-impl/b/src 1 unde Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/projects/b/2/b-impl/b/src 1 undefined Wild card directory -//// [/home/src/projects/b/2/b-impl/b/lib/index.js] Inode:: 159 +//// [/home/src/projects/b/2/b-impl/b/lib/index.js] Inode:: 160 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); @@ -341,11 +341,11 @@ FsWatches:: /home/src/projects: *new* {"inode":3} /home/src/projects/a/1/a-impl/a/lib: *new* - {"inode":151} + {"inode":152} /home/src/projects/a/1/a-impl/a/lib/a.d.ts: *new* - {"inode":153} + {"inode":154} /home/src/projects/a/1/a-impl/a/lib/index.d.ts: *new* - {"inode":155} + {"inode":156} /home/src/projects/a/1/a-impl/a/node_modules: *new* {"inode":25} /home/src/projects/a/1/a-impl/a/package.json: *new* @@ -367,11 +367,11 @@ FsWatches:: /home/src/projects/b/2/b-impl/b/tsconfig.json: *new* {"inode":36} /home/src/projects/c/3/c-impl/c/lib: *new* - {"inode":144} + {"inode":145} /home/src/projects/c/3/c-impl/c/lib/c.d.ts: *new* - {"inode":146} + {"inode":147} /home/src/projects/c/3/c-impl/c/lib/index.d.ts: *new* - {"inode":148} + {"inode":149} /home/src/projects/c/3/c-impl/c/package.json: *new* {"inode":12} /home/src/tslibs/TS/Lib/lib.d.ts: *new* @@ -419,7 +419,7 @@ exitCode:: ExitStatus.undefined Change:: change in unrelated folder in a Input:: -//// [/home/src/projects/a/2/unrelated/somethingUnrelated.ts] Inode:: 160 +//// [/home/src/projects/a/2/unrelated/somethingUnrelated.ts] Inode:: 161 export const a = 10; @@ -437,7 +437,7 @@ exitCode:: ExitStatus.undefined Change:: change in unrelated folder in c Input:: -//// [/home/src/projects/c/4/unrelated/somethingUnrelated.ts] Inode:: 161 +//// [/home/src/projects/c/4/unrelated/somethingUnrelated.ts] Inode:: 162 export const a = 10; @@ -455,7 +455,7 @@ exitCode:: ExitStatus.undefined Change:: change in unrelated folder in a Input:: -//// [/home/src/projects/a/2/unrelated/anotherFile.ts] Inode:: 162 +//// [/home/src/projects/a/2/unrelated/anotherFile.ts] Inode:: 163 export const a = 10; @@ -473,7 +473,7 @@ exitCode:: ExitStatus.undefined Change:: change in unrelated folder in c Input:: -//// [/home/src/projects/c/4/unrelated/anotherFile.ts] Inode:: 163 +//// [/home/src/projects/c/4/unrelated/anotherFile.ts] Inode:: 164 export const a = 10; @@ -623,17 +623,17 @@ FsWatches:: FsWatches *deleted*:: /home/src/projects/a/1/a-impl/a/lib: - {"inode":151} + {"inode":152} /home/src/projects/a/1/a-impl/a/lib/a.d.ts: - {"inode":153} + {"inode":154} /home/src/projects/a/1/a-impl/a/lib/index.d.ts: - {"inode":155} + {"inode":156} /home/src/projects/c/3/c-impl/c/lib: - {"inode":144} + {"inode":145} /home/src/projects/c/3/c-impl/c/lib/c.d.ts: - {"inode":146} + {"inode":147} /home/src/projects/c/3/c-impl/c/lib/index.d.ts: - {"inode":148} + {"inode":149} Timeout callback:: count: 2 13: timerToUpdateProgram *new* @@ -737,7 +737,7 @@ src/index.ts -//// [/home/src/projects/b/2/b-impl/b/lib/index.js] file written with same contents Inode:: 159 +//// [/home/src/projects/b/2/b-impl/b/lib/index.js] file written with same contents Inode:: 160 PolledWatches:: /home/src/projects/b/2/b-impl/b/node_modules/@types: @@ -862,18 +862,18 @@ exitCode:: ExitStatus.undefined Change:: Build dependencies Input:: -//// [/home/src/projects/c/3/c-impl/c/lib/c.js] Inode:: 165 +//// [/home/src/projects/c/3/c-impl/c/lib/c.js] Inode:: 166 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.c = void 0; exports.c = 'test'; -//// [/home/src/projects/c/3/c-impl/c/lib/c.d.ts] Inode:: 166 +//// [/home/src/projects/c/3/c-impl/c/lib/c.d.ts] Inode:: 167 export declare const c: string; -//// [/home/src/projects/c/3/c-impl/c/lib/index.js] Inode:: 167 +//// [/home/src/projects/c/3/c-impl/c/lib/index.js] Inode:: 168 "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; @@ -893,14 +893,14 @@ Object.defineProperty(exports, "__esModule", { value: true }); __exportStar(require("./c"), exports); -//// [/home/src/projects/c/3/c-impl/c/lib/index.d.ts] Inode:: 168 +//// [/home/src/projects/c/3/c-impl/c/lib/index.d.ts] Inode:: 169 export * from './c'; -//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo] Inode:: 169 +//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo] Inode:: 170 {"root":["../src/c.ts","../src/index.ts"],"version":"FakeTSVersion"} -//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 170 +//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 171 { "root": [ "../src/c.ts", @@ -910,18 +910,18 @@ export * from './c'; "size": 68 } -//// [/home/src/projects/a/1/a-impl/a/lib/a.js] Inode:: 172 +//// [/home/src/projects/a/1/a-impl/a/lib/a.js] Inode:: 173 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.a = void 0; exports.a = 'test'; -//// [/home/src/projects/a/1/a-impl/a/lib/a.d.ts] Inode:: 173 +//// [/home/src/projects/a/1/a-impl/a/lib/a.d.ts] Inode:: 174 export declare const a: string; -//// [/home/src/projects/a/1/a-impl/a/lib/index.js] Inode:: 174 +//// [/home/src/projects/a/1/a-impl/a/lib/index.js] Inode:: 175 "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; @@ -942,15 +942,15 @@ __exportStar(require("./a"), exports); __exportStar(require("c"), exports); -//// [/home/src/projects/a/1/a-impl/a/lib/index.d.ts] Inode:: 175 +//// [/home/src/projects/a/1/a-impl/a/lib/index.d.ts] Inode:: 176 export * from './a'; export * from 'c'; -//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo] Inode:: 176 +//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo] Inode:: 177 {"root":["../src/a.ts","../src/index.ts"],"version":"FakeTSVersion"} -//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 177 +//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 178 { "root": [ "../src/a.ts", @@ -1004,7 +1004,7 @@ FsWatches:: /home/src/projects/a/1/a-impl/a: {"inode":19} /home/src/projects/a/1/a-impl/a/lib: *new* - {"inode":171} + {"inode":172} /home/src/projects/a/1/a-impl/a/node_modules: {"inode":25} /home/src/projects/a/1/a-impl/a/package.json: @@ -1158,7 +1158,7 @@ src/index.ts -//// [/home/src/projects/b/2/b-impl/b/lib/index.js] file written with same contents Inode:: 159 +//// [/home/src/projects/b/2/b-impl/b/lib/index.js] file written with same contents Inode:: 160 PolledWatches:: /home/src/projects/a/1/a-impl/a/lib/node_modules: *new* @@ -1188,11 +1188,11 @@ FsWatches:: /home/src/projects: {"inode":3} /home/src/projects/a/1/a-impl/a/lib: - {"inode":171} + {"inode":172} /home/src/projects/a/1/a-impl/a/lib/a.d.ts: *new* - {"inode":173} + {"inode":174} /home/src/projects/a/1/a-impl/a/lib/index.d.ts: *new* - {"inode":175} + {"inode":176} /home/src/projects/a/1/a-impl/a/node_modules: {"inode":25} /home/src/projects/a/1/a-impl/a/package.json: @@ -1214,11 +1214,11 @@ FsWatches:: /home/src/projects/b/2/b-impl/b/tsconfig.json: {"inode":36} /home/src/projects/c/3/c-impl/c/lib: *new* - {"inode":164} + {"inode":165} /home/src/projects/c/3/c-impl/c/lib/c.d.ts: *new* - {"inode":166} + {"inode":167} /home/src/projects/c/3/c-impl/c/lib/index.d.ts: *new* - {"inode":168} + {"inode":169} /home/src/projects/c/3/c-impl/c/package.json: *new* {"inode":12} /home/src/tslibs/TS/Lib/lib.d.ts: diff --git a/tests/baselines/reference/tscWatch/symlinks/packages-outside-project-folder-built-MacOs.js b/tests/baselines/reference/tscWatch/symlinks/packages-outside-project-folder-built-MacOs.js index dbb5c3bf8cab3..9b0de96b33b13 100644 --- a/tests/baselines/reference/tscWatch/symlinks/packages-outside-project-folder-built-MacOs.js +++ b/tests/baselines/reference/tscWatch/symlinks/packages-outside-project-folder-built-MacOs.js @@ -87,18 +87,18 @@ interface Array { length: number; [n: number]: T; } interface ReadonlyArray {} declare const console: { log(msg: any): void; }; -//// [/home/src/projects/c/3/c-impl/c/lib/c.js] Inode:: 145 +//// [/home/src/projects/c/3/c-impl/c/lib/c.js] Inode:: 146 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.c = void 0; exports.c = 'test'; -//// [/home/src/projects/c/3/c-impl/c/lib/c.d.ts] Inode:: 146 +//// [/home/src/projects/c/3/c-impl/c/lib/c.d.ts] Inode:: 147 export declare const c: string; -//// [/home/src/projects/c/3/c-impl/c/lib/index.js] Inode:: 147 +//// [/home/src/projects/c/3/c-impl/c/lib/index.js] Inode:: 148 "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; @@ -118,14 +118,14 @@ Object.defineProperty(exports, "__esModule", { value: true }); __exportStar(require("./c"), exports); -//// [/home/src/projects/c/3/c-impl/c/lib/index.d.ts] Inode:: 148 +//// [/home/src/projects/c/3/c-impl/c/lib/index.d.ts] Inode:: 149 export * from './c'; -//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo] Inode:: 149 +//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo] Inode:: 150 {"root":["../src/c.ts","../src/index.ts"],"version":"FakeTSVersion"} -//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 150 +//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 151 { "root": [ "../src/c.ts", @@ -135,18 +135,18 @@ export * from './c'; "size": 68 } -//// [/home/src/projects/a/1/a-impl/a/lib/a.js] Inode:: 152 +//// [/home/src/projects/a/1/a-impl/a/lib/a.js] Inode:: 153 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.a = void 0; exports.a = 'test'; -//// [/home/src/projects/a/1/a-impl/a/lib/a.d.ts] Inode:: 153 +//// [/home/src/projects/a/1/a-impl/a/lib/a.d.ts] Inode:: 154 export declare const a: string; -//// [/home/src/projects/a/1/a-impl/a/lib/index.js] Inode:: 154 +//// [/home/src/projects/a/1/a-impl/a/lib/index.js] Inode:: 155 "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; @@ -167,15 +167,15 @@ __exportStar(require("./a"), exports); __exportStar(require("c"), exports); -//// [/home/src/projects/a/1/a-impl/a/lib/index.d.ts] Inode:: 155 +//// [/home/src/projects/a/1/a-impl/a/lib/index.d.ts] Inode:: 156 export * from './a'; export * from 'c'; -//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo] Inode:: 156 +//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo] Inode:: 157 {"root":["../src/a.ts","../src/index.ts"],"version":"FakeTSVersion"} -//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 157 +//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 158 { "root": [ "../src/a.ts", @@ -317,7 +317,7 @@ DirectoryWatcher:: Added:: WatchInfo: /home/src/projects/b/2/b-impl/b/src 1 unde Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/projects/b/2/b-impl/b/src 1 undefined Wild card directory -//// [/home/src/projects/b/2/b-impl/b/lib/index.js] Inode:: 159 +//// [/home/src/projects/b/2/b-impl/b/lib/index.js] Inode:: 160 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); @@ -341,9 +341,9 @@ FsWatches:: /home/src/projects: *new* {"inode":3} /home/src/projects/a/1/a-impl/a/lib/a.d.ts: *new* - {"inode":153} + {"inode":154} /home/src/projects/a/1/a-impl/a/lib/index.d.ts: *new* - {"inode":155} + {"inode":156} /home/src/projects/a/1/a-impl/a/package.json: *new* {"inode":24} /home/src/projects/b: *new* @@ -359,9 +359,9 @@ FsWatches:: /home/src/projects/b/2/b-impl/b/tsconfig.json: *new* {"inode":36} /home/src/projects/c/3/c-impl/c/lib/c.d.ts: *new* - {"inode":146} + {"inode":147} /home/src/projects/c/3/c-impl/c/lib/index.d.ts: *new* - {"inode":148} + {"inode":149} /home/src/projects/c/3/c-impl/c/package.json: *new* {"inode":12} /home/src/tslibs/TS/Lib/lib.d.ts: *new* @@ -421,7 +421,7 @@ exitCode:: ExitStatus.undefined Change:: change in unrelated folder in a Input:: -//// [/home/src/projects/a/2/unrelated/somethingUnrelated.ts] Inode:: 160 +//// [/home/src/projects/a/2/unrelated/somethingUnrelated.ts] Inode:: 161 export const a = 10; @@ -450,7 +450,7 @@ exitCode:: ExitStatus.undefined Change:: change in unrelated folder in c Input:: -//// [/home/src/projects/c/4/unrelated/somethingUnrelated.ts] Inode:: 161 +//// [/home/src/projects/c/4/unrelated/somethingUnrelated.ts] Inode:: 162 export const a = 10; @@ -479,7 +479,7 @@ exitCode:: ExitStatus.undefined Change:: change in unrelated folder in a Input:: -//// [/home/src/projects/a/2/unrelated/anotherFile.ts] Inode:: 162 +//// [/home/src/projects/a/2/unrelated/anotherFile.ts] Inode:: 163 export const a = 10; @@ -508,7 +508,7 @@ exitCode:: ExitStatus.undefined Change:: change in unrelated folder in c Input:: -//// [/home/src/projects/c/4/unrelated/anotherFile.ts] Inode:: 163 +//// [/home/src/projects/c/4/unrelated/anotherFile.ts] Inode:: 164 export const a = 10; @@ -657,13 +657,13 @@ FsWatches:: FsWatches *deleted*:: /home/src/projects/a/1/a-impl/a/lib/a.d.ts: - {"inode":153} + {"inode":154} /home/src/projects/a/1/a-impl/a/lib/index.d.ts: - {"inode":155} + {"inode":156} /home/src/projects/c/3/c-impl/c/lib/c.d.ts: - {"inode":146} + {"inode":147} /home/src/projects/c/3/c-impl/c/lib/index.d.ts: - {"inode":148} + {"inode":149} FsWatchesRecursive:: /home/src/projects/a: @@ -779,7 +779,7 @@ src/index.ts -//// [/home/src/projects/b/2/b-impl/b/lib/index.js] file written with same contents Inode:: 159 +//// [/home/src/projects/b/2/b-impl/b/lib/index.js] file written with same contents Inode:: 160 PolledWatches:: /home/src/projects/b/2/b-impl/b/node_modules/@types: @@ -885,18 +885,18 @@ exitCode:: ExitStatus.undefined Change:: Build dependencies Input:: -//// [/home/src/projects/c/3/c-impl/c/lib/c.js] Inode:: 165 +//// [/home/src/projects/c/3/c-impl/c/lib/c.js] Inode:: 166 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.c = void 0; exports.c = 'test'; -//// [/home/src/projects/c/3/c-impl/c/lib/c.d.ts] Inode:: 166 +//// [/home/src/projects/c/3/c-impl/c/lib/c.d.ts] Inode:: 167 export declare const c: string; -//// [/home/src/projects/c/3/c-impl/c/lib/index.js] Inode:: 167 +//// [/home/src/projects/c/3/c-impl/c/lib/index.js] Inode:: 168 "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; @@ -916,14 +916,14 @@ Object.defineProperty(exports, "__esModule", { value: true }); __exportStar(require("./c"), exports); -//// [/home/src/projects/c/3/c-impl/c/lib/index.d.ts] Inode:: 168 +//// [/home/src/projects/c/3/c-impl/c/lib/index.d.ts] Inode:: 169 export * from './c'; -//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo] Inode:: 169 +//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo] Inode:: 170 {"root":["../src/c.ts","../src/index.ts"],"version":"FakeTSVersion"} -//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 170 +//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 171 { "root": [ "../src/c.ts", @@ -933,18 +933,18 @@ export * from './c'; "size": 68 } -//// [/home/src/projects/a/1/a-impl/a/lib/a.js] Inode:: 172 +//// [/home/src/projects/a/1/a-impl/a/lib/a.js] Inode:: 173 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.a = void 0; exports.a = 'test'; -//// [/home/src/projects/a/1/a-impl/a/lib/a.d.ts] Inode:: 173 +//// [/home/src/projects/a/1/a-impl/a/lib/a.d.ts] Inode:: 174 export declare const a: string; -//// [/home/src/projects/a/1/a-impl/a/lib/index.js] Inode:: 174 +//// [/home/src/projects/a/1/a-impl/a/lib/index.js] Inode:: 175 "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; @@ -965,15 +965,15 @@ __exportStar(require("./a"), exports); __exportStar(require("c"), exports); -//// [/home/src/projects/a/1/a-impl/a/lib/index.d.ts] Inode:: 175 +//// [/home/src/projects/a/1/a-impl/a/lib/index.d.ts] Inode:: 176 export * from './a'; export * from 'c'; -//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo] Inode:: 176 +//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo] Inode:: 177 {"root":["../src/a.ts","../src/index.ts"],"version":"FakeTSVersion"} -//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 177 +//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 178 { "root": [ "../src/a.ts", @@ -1134,7 +1134,7 @@ src/index.ts -//// [/home/src/projects/b/2/b-impl/b/lib/index.js] file written with same contents Inode:: 159 +//// [/home/src/projects/b/2/b-impl/b/lib/index.js] file written with same contents Inode:: 160 PolledWatches:: /home/src/projects/a/1/a-impl/a/lib/node_modules: *new* @@ -1164,9 +1164,9 @@ FsWatches:: /home/src/projects: {"inode":3} /home/src/projects/a/1/a-impl/a/lib/a.d.ts: *new* - {"inode":173} + {"inode":174} /home/src/projects/a/1/a-impl/a/lib/index.d.ts: *new* - {"inode":175} + {"inode":176} /home/src/projects/a/1/a-impl/a/package.json: {"inode":24} /home/src/projects/b: @@ -1182,9 +1182,9 @@ FsWatches:: /home/src/projects/b/2/b-impl/b/tsconfig.json: {"inode":36} /home/src/projects/c/3/c-impl/c/lib/c.d.ts: *new* - {"inode":166} + {"inode":167} /home/src/projects/c/3/c-impl/c/lib/index.d.ts: *new* - {"inode":168} + {"inode":169} /home/src/projects/c/3/c-impl/c/package.json: *new* {"inode":12} /home/src/tslibs/TS/Lib/lib.d.ts: diff --git a/tests/baselines/reference/tscWatch/watchEnvironment/fsWatch/fsWatchWithTimestamp-true-useFsEventsOnParentDirectory.js b/tests/baselines/reference/tscWatch/watchEnvironment/fsWatch/fsWatchWithTimestamp-true-useFsEventsOnParentDirectory.js index c97926c12a2bd..ac713190c7780 100644 --- a/tests/baselines/reference/tscWatch/watchEnvironment/fsWatch/fsWatchWithTimestamp-true-useFsEventsOnParentDirectory.js +++ b/tests/baselines/reference/tscWatch/watchEnvironment/fsWatch/fsWatchWithTimestamp-true-useFsEventsOnParentDirectory.js @@ -45,7 +45,7 @@ Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/node -//// [/user/username/projects/myproject/main.js] Inode:: 114 +//// [/user/username/projects/myproject/main.js] Inode:: 115 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.x = void 0; @@ -131,7 +131,7 @@ CreatingProgramWith:: -//// [/user/username/projects/myproject/main.js] Inode:: 114 +//// [/user/username/projects/myproject/main.js] Inode:: 115 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.y = exports.x = void 0; diff --git a/tests/baselines/reference/tscWatch/watchEnvironment/fsWatch/fsWatchWithTimestamp-true.js b/tests/baselines/reference/tscWatch/watchEnvironment/fsWatch/fsWatchWithTimestamp-true.js index 708ae17fe6b64..7027b37140d89 100644 --- a/tests/baselines/reference/tscWatch/watchEnvironment/fsWatch/fsWatchWithTimestamp-true.js +++ b/tests/baselines/reference/tscWatch/watchEnvironment/fsWatch/fsWatchWithTimestamp-true.js @@ -45,7 +45,7 @@ Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/node -//// [/user/username/projects/myproject/main.js] Inode:: 114 +//// [/user/username/projects/myproject/main.js] Inode:: 115 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.x = void 0; @@ -133,7 +133,7 @@ CreatingProgramWith:: -//// [/user/username/projects/myproject/main.js] Inode:: 114 +//// [/user/username/projects/myproject/main.js] Inode:: 115 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.y = exports.x = void 0; diff --git a/tests/baselines/reference/tscWatch/watchEnvironment/fsWatch/when-using-file-watching-thats-on-inode-when-rename-event-ends-with-tilde.js b/tests/baselines/reference/tscWatch/watchEnvironment/fsWatch/when-using-file-watching-thats-on-inode-when-rename-event-ends-with-tilde.js index 1a0065607d1af..f0be513208258 100644 --- a/tests/baselines/reference/tscWatch/watchEnvironment/fsWatch/when-using-file-watching-thats-on-inode-when-rename-event-ends-with-tilde.js +++ b/tests/baselines/reference/tscWatch/watchEnvironment/fsWatch/when-using-file-watching-thats-on-inode-when-rename-event-ends-with-tilde.js @@ -57,7 +57,7 @@ Elapsed:: *ms DirectoryWatcher:: Triggered with /user/username/projects/myprojec -//// [/user/username/projects/myproject/main.js] Inode:: 115 +//// [/user/username/projects/myproject/main.js] Inode:: 116 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var foo_1 = require("./foo"); @@ -113,7 +113,7 @@ exitCode:: ExitStatus.undefined Change:: Replace file with rename event that introduces error Input:: -//// [/user/username/projects/myproject/foo.d.ts] Inode:: 116 +//// [/user/username/projects/myproject/foo.d.ts] Inode:: 117 export function foo2(): string; @@ -162,7 +162,7 @@ FsWatches:: /user/username/projects/myproject: {"inode":4} /user/username/projects/myproject/foo.d.ts: - {"inode":116} *new* + {"inode":117} *new* /user/username/projects/myproject/main.ts: {"inode":5} /user/username/projects/myproject/tsconfig.json: @@ -203,7 +203,7 @@ CreatingProgramWith:: -//// [/user/username/projects/myproject/main.js] file written with same contents Inode:: 115 +//// [/user/username/projects/myproject/main.js] file written with same contents Inode:: 116 Timeout callback:: count: 0 9: timerToInvalidateFailedLookupResolutions *deleted* @@ -237,7 +237,7 @@ exitCode:: ExitStatus.undefined Change:: Replace file with rename event that fixes error Input:: -//// [/user/username/projects/myproject/foo.d.ts] Inode:: 117 +//// [/user/username/projects/myproject/foo.d.ts] Inode:: 118 export function foo(): string; @@ -286,7 +286,7 @@ FsWatches:: /user/username/projects/myproject: {"inode":4} /user/username/projects/myproject/foo.d.ts: - {"inode":117} *new* + {"inode":118} *new* /user/username/projects/myproject/main.ts: {"inode":5} /user/username/projects/myproject/tsconfig.json: @@ -294,7 +294,7 @@ FsWatches:: FsWatches *deleted*:: /user/username/projects/myproject/foo.d.ts: - {"inode":116} + {"inode":117} Timeout callback:: count: 2 16: timerToUpdateProgram *new* @@ -317,7 +317,7 @@ CreatingProgramWith:: -//// [/user/username/projects/myproject/main.js] file written with same contents Inode:: 115 +//// [/user/username/projects/myproject/main.js] file written with same contents Inode:: 116 Timeout callback:: count: 0 18: timerToInvalidateFailedLookupResolutions *deleted* diff --git a/tests/baselines/reference/tscWatch/watchEnvironment/fsWatch/when-using-file-watching-thats-on-inode-when-rename-occurs-when-file-is-still-on-the-disk.js b/tests/baselines/reference/tscWatch/watchEnvironment/fsWatch/when-using-file-watching-thats-on-inode-when-rename-occurs-when-file-is-still-on-the-disk.js index 95668866db5d2..b6a91e2199f4f 100644 --- a/tests/baselines/reference/tscWatch/watchEnvironment/fsWatch/when-using-file-watching-thats-on-inode-when-rename-occurs-when-file-is-still-on-the-disk.js +++ b/tests/baselines/reference/tscWatch/watchEnvironment/fsWatch/when-using-file-watching-thats-on-inode-when-rename-occurs-when-file-is-still-on-the-disk.js @@ -53,12 +53,12 @@ Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/node -//// [/user/username/projects/myproject/foo.js] Inode:: 115 +//// [/user/username/projects/myproject/foo.js] Inode:: 116 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -//// [/user/username/projects/myproject/main.js] Inode:: 116 +//// [/user/username/projects/myproject/main.js] Inode:: 117 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var foo_1 = require("./foo"); @@ -112,7 +112,7 @@ exitCode:: ExitStatus.undefined Change:: Introduce error such that when callback happens file is already appeared Input:: -//// [/user/username/projects/myproject/foo.ts] Inode:: 117 +//// [/user/username/projects/myproject/foo.ts] Inode:: 118 export declare function foo2(): string; @@ -172,8 +172,8 @@ CreatingProgramWith:: -//// [/user/username/projects/myproject/foo.js] file written with same contents Inode:: 115 -//// [/user/username/projects/myproject/main.js] file written with same contents Inode:: 116 +//// [/user/username/projects/myproject/foo.js] file written with same contents Inode:: 116 +//// [/user/username/projects/myproject/main.js] file written with same contents Inode:: 117 Program root files: [ @@ -204,7 +204,7 @@ exitCode:: ExitStatus.undefined Change:: Replace file with rename event that fixes error Input:: -//// [/user/username/projects/myproject/foo.ts] Inode:: 118 +//// [/user/username/projects/myproject/foo.ts] Inode:: 119 export declare function foo(): string; @@ -233,7 +233,7 @@ FsWatches:: /home/src/tslibs/TS/Lib/lib.d.ts: {"inode":13} /user/username/projects/myproject/foo.ts: - {"inode":118} *new* + {"inode":119} *new* /user/username/projects/myproject/main.ts: {"inode":5} /user/username/projects/myproject/tsconfig.json: @@ -262,8 +262,8 @@ CreatingProgramWith:: -//// [/user/username/projects/myproject/foo.js] file written with same contents Inode:: 115 -//// [/user/username/projects/myproject/main.js] file written with same contents Inode:: 116 +//// [/user/username/projects/myproject/foo.js] file written with same contents Inode:: 116 +//// [/user/username/projects/myproject/main.js] file written with same contents Inode:: 117 Program root files: [ diff --git a/tests/baselines/reference/tscWatch/watchEnvironment/fsWatch/when-using-file-watching-thats-on-inode.js b/tests/baselines/reference/tscWatch/watchEnvironment/fsWatch/when-using-file-watching-thats-on-inode.js index 53ef95b9bf469..a91478c76a011 100644 --- a/tests/baselines/reference/tscWatch/watchEnvironment/fsWatch/when-using-file-watching-thats-on-inode.js +++ b/tests/baselines/reference/tscWatch/watchEnvironment/fsWatch/when-using-file-watching-thats-on-inode.js @@ -57,7 +57,7 @@ Elapsed:: *ms DirectoryWatcher:: Triggered with /user/username/projects/myprojec -//// [/user/username/projects/myproject/main.js] Inode:: 115 +//// [/user/username/projects/myproject/main.js] Inode:: 116 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var foo_1 = require("./foo"); @@ -113,7 +113,7 @@ exitCode:: ExitStatus.undefined Change:: Replace file with rename event that introduces error Input:: -//// [/user/username/projects/myproject/foo.d.ts] Inode:: 116 +//// [/user/username/projects/myproject/foo.d.ts] Inode:: 117 export function foo2(): string; @@ -150,7 +150,7 @@ FsWatches:: /user/username/projects/myproject: {"inode":4} /user/username/projects/myproject/foo.d.ts: - {"inode":116} *new* + {"inode":117} *new* /user/username/projects/myproject/main.ts: {"inode":5} /user/username/projects/myproject/tsconfig.json: @@ -191,7 +191,7 @@ CreatingProgramWith:: -//// [/user/username/projects/myproject/main.js] file written with same contents Inode:: 115 +//// [/user/username/projects/myproject/main.js] file written with same contents Inode:: 116 Timeout callback:: count: 0 5: timerToInvalidateFailedLookupResolutions *deleted* @@ -225,7 +225,7 @@ exitCode:: ExitStatus.undefined Change:: Replace file with rename event that fixes error Input:: -//// [/user/username/projects/myproject/foo.d.ts] Inode:: 117 +//// [/user/username/projects/myproject/foo.d.ts] Inode:: 118 export function foo(): string; @@ -262,7 +262,7 @@ FsWatches:: /user/username/projects/myproject: {"inode":4} /user/username/projects/myproject/foo.d.ts: - {"inode":117} *new* + {"inode":118} *new* /user/username/projects/myproject/main.ts: {"inode":5} /user/username/projects/myproject/tsconfig.json: @@ -270,7 +270,7 @@ FsWatches:: FsWatches *deleted*:: /user/username/projects/myproject/foo.d.ts: - {"inode":116} + {"inode":117} Timeout callback:: count: 2 9: timerToUpdateProgram *new* @@ -293,7 +293,7 @@ CreatingProgramWith:: -//// [/user/username/projects/myproject/main.js] file written with same contents Inode:: 115 +//// [/user/username/projects/myproject/main.js] file written with same contents Inode:: 116 Timeout callback:: count: 0 10: timerToInvalidateFailedLookupResolutions *deleted* diff --git a/tests/baselines/reference/tscWatch/watchEnvironment/watchDirectories/uses-non-recursive-dynamic-polling-when-renaming-file-in-subfolder.js b/tests/baselines/reference/tscWatch/watchEnvironment/watchDirectories/uses-non-recursive-dynamic-polling-when-renaming-file-in-subfolder.js index 05cd4145c7856..898101b768a07 100644 --- a/tests/baselines/reference/tscWatch/watchEnvironment/watchDirectories/uses-non-recursive-dynamic-polling-when-renaming-file-in-subfolder.js +++ b/tests/baselines/reference/tscWatch/watchEnvironment/watchDirectories/uses-non-recursive-dynamic-polling-when-renaming-file-in-subfolder.js @@ -34,7 +34,7 @@ Output:: -//// [/a/username/projects/project/src/file1.js] Inode:: 115 +//// [/a/username/projects/project/src/file1.js] Inode:: 116 @@ -74,7 +74,7 @@ exitCode:: ExitStatus.undefined Change:: Rename file1 to file2 Input:: -//// [/a/username/projects/project/src/file2.ts] Inode:: 116 +//// [/a/username/projects/project/src/file2.ts] Inode:: 117 //// [/a/username/projects/project/src/file1.ts] deleted @@ -128,7 +128,7 @@ Output:: -//// [/a/username/projects/project/src/file2.js] Inode:: 117 +//// [/a/username/projects/project/src/file2.js] Inode:: 118 @@ -138,7 +138,7 @@ PolledWatches *deleted*:: FsWatches:: /a/username/projects/project/src/file2.ts: *new* - {"inode":116} + {"inode":117} /a/username/projects/project/tsconfig.json: {"inode":7} /home/src/tslibs/TS/Lib/lib.d.ts: diff --git a/tests/baselines/reference/tscWatch/watchEnvironment/watchDirectories/uses-non-recursive-watchDirectory-when-renaming-file-in-subfolder.js b/tests/baselines/reference/tscWatch/watchEnvironment/watchDirectories/uses-non-recursive-watchDirectory-when-renaming-file-in-subfolder.js index 84bb2e109d82b..88493a7884369 100644 --- a/tests/baselines/reference/tscWatch/watchEnvironment/watchDirectories/uses-non-recursive-watchDirectory-when-renaming-file-in-subfolder.js +++ b/tests/baselines/reference/tscWatch/watchEnvironment/watchDirectories/uses-non-recursive-watchDirectory-when-renaming-file-in-subfolder.js @@ -34,7 +34,7 @@ Output:: -//// [/a/username/projects/project/src/file1.js] Inode:: 115 +//// [/a/username/projects/project/src/file1.js] Inode:: 116 @@ -81,7 +81,7 @@ exitCode:: ExitStatus.undefined Change:: Rename file1 to file2 Input:: -//// [/a/username/projects/project/src/file2.ts] Inode:: 116 +//// [/a/username/projects/project/src/file2.ts] Inode:: 117 //// [/a/username/projects/project/src/file1.ts] deleted @@ -128,7 +128,7 @@ Output:: -//// [/a/username/projects/project/src/file2.js] Inode:: 117 +//// [/a/username/projects/project/src/file2.js] Inode:: 118 @@ -148,7 +148,7 @@ FsWatches:: /a/username/projects/project/src: {"inode":5} /a/username/projects/project/src/file2.ts: *new* - {"inode":116} + {"inode":117} /a/username/projects/project/tsconfig.json: {"inode":7} /home/src/tslibs/TS/Lib/lib.d.ts: diff --git a/tests/baselines/reference/tscWatch/watchEnvironment/watchDirectories/uses-watchFile-when-renaming-file-in-subfolder.js b/tests/baselines/reference/tscWatch/watchEnvironment/watchDirectories/uses-watchFile-when-renaming-file-in-subfolder.js index 530acb147ec77..3ceb739579998 100644 --- a/tests/baselines/reference/tscWatch/watchEnvironment/watchDirectories/uses-watchFile-when-renaming-file-in-subfolder.js +++ b/tests/baselines/reference/tscWatch/watchEnvironment/watchDirectories/uses-watchFile-when-renaming-file-in-subfolder.js @@ -34,7 +34,7 @@ Output:: -//// [/a/username/projects/project/src/file1.js] Inode:: 115 +//// [/a/username/projects/project/src/file1.js] Inode:: 116 @@ -81,7 +81,7 @@ exitCode:: ExitStatus.undefined Change:: Rename file1 to file2 Input:: -//// [/a/username/projects/project/src/file2.ts] Inode:: 116 +//// [/a/username/projects/project/src/file2.ts] Inode:: 117 //// [/a/username/projects/project/src/file1.ts] deleted @@ -128,7 +128,7 @@ Output:: -//// [/a/username/projects/project/src/file2.js] Inode:: 117 +//// [/a/username/projects/project/src/file2.js] Inode:: 118 @@ -148,7 +148,7 @@ PolledWatches *deleted*:: FsWatches:: /a/username/projects/project/src/file2.ts: *new* - {"inode":116} + {"inode":117} /a/username/projects/project/tsconfig.json: {"inode":7} /home/src/tslibs/TS/Lib/lib.d.ts: diff --git a/tests/baselines/reference/tscWatch/watchEnvironment/watchDirectories/when-there-are-symlinks-to-folders-in-recursive-folders-with-synchronousWatchDirectory.js b/tests/baselines/reference/tscWatch/watchEnvironment/watchDirectories/when-there-are-symlinks-to-folders-in-recursive-folders-with-synchronousWatchDirectory.js index 735f76eeb8c6b..8963e82b7122c 100644 --- a/tests/baselines/reference/tscWatch/watchEnvironment/watchDirectories/when-there-are-symlinks-to-folders-in-recursive-folders-with-synchronousWatchDirectory.js +++ b/tests/baselines/reference/tscWatch/watchEnvironment/watchDirectories/when-there-are-symlinks-to-folders-in-recursive-folders-with-synchronousWatchDirectory.js @@ -110,7 +110,7 @@ DirectoryWatcher:: Added:: WatchInfo: /home/user/projects/myproject 1 {"synchron Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/user/projects/myproject 1 {"synchronousWatchDirectory":true} Wild card directory -//// [/home/user/projects/myproject/src/file.js] Inode:: 125 +//// [/home/user/projects/myproject/src/file.js] Inode:: 126 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); @@ -335,7 +335,7 @@ FileWatcher:: Close:: WatchInfo: /home/user/projects/package.json 2000 {"synchro -//// [/home/user/projects/myproject/src/file.js] file written with same contents Inode:: 125 +//// [/home/user/projects/myproject/src/file.js] file written with same contents Inode:: 126 PolledWatches:: /home/user/projects/myproject/node_modules/@types: diff --git a/tests/baselines/reference/tscWatch/watchEnvironment/watchDirectories/when-there-are-symlinks-to-folders-in-recursive-folders.js b/tests/baselines/reference/tscWatch/watchEnvironment/watchDirectories/when-there-are-symlinks-to-folders-in-recursive-folders.js index 4e800e71ccc5a..7f975769fd363 100644 --- a/tests/baselines/reference/tscWatch/watchEnvironment/watchDirectories/when-there-are-symlinks-to-folders-in-recursive-folders.js +++ b/tests/baselines/reference/tscWatch/watchEnvironment/watchDirectories/when-there-are-symlinks-to-folders-in-recursive-folders.js @@ -105,7 +105,7 @@ DirectoryWatcher:: Added:: WatchInfo: /home/user/projects/myproject 1 undefined Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/user/projects/myproject 1 undefined Wild card directory -//// [/home/user/projects/myproject/src/file.js] Inode:: 125 +//// [/home/user/projects/myproject/src/file.js] Inode:: 126 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); @@ -341,7 +341,7 @@ Elapsed:: *ms DirectoryWatcher:: Triggered with /home/user/projects/myproject/no sysLog:: Elapsed:: *ms:: onTimerToUpdateChildWatches:: 0 undefined -//// [/home/user/projects/myproject/src/file.js] file written with same contents Inode:: 125 +//// [/home/user/projects/myproject/src/file.js] file written with same contents Inode:: 126 PolledWatches:: /home/user/projects/myproject/node_modules/@types: diff --git a/tests/baselines/reference/tscWatch/watchEnvironment/watchDirectories/with-non-synchronous-watch-directory-renaming-a-file.js b/tests/baselines/reference/tscWatch/watchEnvironment/watchDirectories/with-non-synchronous-watch-directory-renaming-a-file.js index dd0e79906a110..c11e2d57d013d 100644 --- a/tests/baselines/reference/tscWatch/watchEnvironment/watchDirectories/with-non-synchronous-watch-directory-renaming-a-file.js +++ b/tests/baselines/reference/tscWatch/watchEnvironment/watchDirectories/with-non-synchronous-watch-directory-renaming-a-file.js @@ -37,14 +37,14 @@ Output:: -//// [/user/username/projects/myproject/dist/file2.js] Inode:: 117 +//// [/user/username/projects/myproject/dist/file2.js] Inode:: 118 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.x = void 0; exports.x = 10; -//// [/user/username/projects/myproject/dist/file1.js] Inode:: 118 +//// [/user/username/projects/myproject/dist/file1.js] Inode:: 119 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); @@ -62,7 +62,7 @@ FsWatches:: /user/username/projects/myproject: *new* {"inode":4} /user/username/projects/myproject/dist: *new* - {"inode":116} + {"inode":117} /user/username/projects/myproject/src: *new* {"inode":5} /user/username/projects/myproject/src/file1.ts: *new* @@ -109,7 +109,7 @@ exitCode:: ExitStatus.undefined Change:: rename the file Input:: -//// [/user/username/projects/myproject/src/renamed.ts] Inode:: 119 +//// [/user/username/projects/myproject/src/renamed.ts] Inode:: 120 export const x = 10; //// [/user/username/projects/myproject/src/file2.ts] deleted @@ -132,7 +132,7 @@ FsWatches:: /user/username/projects/myproject: {"inode":4} /user/username/projects/myproject/dist: - {"inode":116} + {"inode":117} /user/username/projects/myproject/src: {"inode":5} /user/username/projects/myproject/src/file1.ts: @@ -166,7 +166,7 @@ Output:: -//// [/user/username/projects/myproject/dist/file1.js] file written with same contents Inode:: 118 +//// [/user/username/projects/myproject/dist/file1.js] file written with same contents Inode:: 119 PolledWatches:: /user/username/projects/myproject/node_modules/@types: @@ -186,7 +186,7 @@ FsWatches:: /user/username/projects/myproject: {"inode":4} /user/username/projects/myproject/dist: - {"inode":116} + {"inode":117} /user/username/projects/myproject/src: {"inode":5} /user/username/projects/myproject/src/file1.ts: @@ -249,7 +249,7 @@ Output:: -//// [/user/username/projects/myproject/dist/renamed.js] Inode:: 120 +//// [/user/username/projects/myproject/dist/renamed.js] Inode:: 121 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.x = void 0; @@ -273,13 +273,13 @@ FsWatches:: /user/username/projects/myproject: {"inode":4} /user/username/projects/myproject/dist: - {"inode":116} + {"inode":117} /user/username/projects/myproject/src: {"inode":5} /user/username/projects/myproject/src/file1.ts: {"inode":6} /user/username/projects/myproject/src/renamed.ts: *new* - {"inode":119} + {"inode":120} /user/username/projects/myproject/tsconfig.json: {"inode":8} diff --git a/tests/baselines/reference/tscWatch/watchEnvironment/watchDirectories/with-non-synchronous-watch-directory-with-outDir-and-declaration-enabled.js b/tests/baselines/reference/tscWatch/watchEnvironment/watchDirectories/with-non-synchronous-watch-directory-with-outDir-and-declaration-enabled.js index bb41a714508cf..8b519b9d1952c 100644 --- a/tests/baselines/reference/tscWatch/watchEnvironment/watchDirectories/with-non-synchronous-watch-directory-with-outDir-and-declaration-enabled.js +++ b/tests/baselines/reference/tscWatch/watchEnvironment/watchDirectories/with-non-synchronous-watch-directory-with-outDir-and-declaration-enabled.js @@ -38,12 +38,12 @@ Output:: -//// [/user/username/projects/myproject/dist/file1.js] Inode:: 119 +//// [/user/username/projects/myproject/dist/file1.js] Inode:: 120 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -//// [/user/username/projects/myproject/dist/file1.d.ts] Inode:: 120 +//// [/user/username/projects/myproject/dist/file1.d.ts] Inode:: 121 export {}; @@ -70,7 +70,7 @@ FsWatches:: /user/username/projects/myproject: *new* {"inode":4} /user/username/projects/myproject/dist: *new* - {"inode":118} + {"inode":119} /user/username/projects/myproject/node_modules: *new* {"inode":7} /user/username/projects/myproject/node_modules/file2: *new* @@ -121,7 +121,7 @@ exitCode:: ExitStatus.undefined Change:: Add new file, should schedule and run timeout to update directory watcher Input:: -//// [/user/username/projects/myproject/src/file3.ts] Inode:: 121 +//// [/user/username/projects/myproject/src/file3.ts] Inode:: 122 export const y = 10; @@ -159,14 +159,14 @@ Output:: -//// [/user/username/projects/myproject/dist/file3.js] Inode:: 122 +//// [/user/username/projects/myproject/dist/file3.js] Inode:: 123 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.y = void 0; exports.y = 10; -//// [/user/username/projects/myproject/dist/file3.d.ts] Inode:: 123 +//// [/user/username/projects/myproject/dist/file3.d.ts] Inode:: 124 export declare const y = 10; @@ -193,7 +193,7 @@ FsWatches:: /user/username/projects/myproject: {"inode":4} /user/username/projects/myproject/dist: - {"inode":118} + {"inode":119} /user/username/projects/myproject/node_modules: {"inode":7} /user/username/projects/myproject/node_modules/file2: @@ -205,7 +205,7 @@ FsWatches:: /user/username/projects/myproject/src/file1.ts: {"inode":6} /user/username/projects/myproject/src/file3.ts: *new* - {"inode":121} + {"inode":122} /user/username/projects/myproject/tsconfig.json: {"inode":10} diff --git a/tests/baselines/reference/tscWatch/watchEnvironment/watchDirectories/with-non-synchronous-watch-directory.js b/tests/baselines/reference/tscWatch/watchEnvironment/watchDirectories/with-non-synchronous-watch-directory.js index 217387010fe2b..e24137acc2a13 100644 --- a/tests/baselines/reference/tscWatch/watchEnvironment/watchDirectories/with-non-synchronous-watch-directory.js +++ b/tests/baselines/reference/tscWatch/watchEnvironment/watchDirectories/with-non-synchronous-watch-directory.js @@ -39,7 +39,7 @@ Output:: -//// [/user/username/projects/myproject/src/file1.js] Inode:: 118 +//// [/user/username/projects/myproject/src/file1.js] Inode:: 119 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); @@ -191,7 +191,7 @@ Output:: -//// [/user/username/projects/myproject/src/file1.js] file written with same contents Inode:: 118 +//// [/user/username/projects/myproject/src/file1.js] file written with same contents Inode:: 119 PolledWatches:: /user/username/projects/myproject/node_modules: @@ -343,7 +343,7 @@ FsWatches:: /user/username/projects/myproject: {"inode":4} /user/username/projects/myproject/node_modules: *new* - {"inode":119} + {"inode":120} /user/username/projects/myproject/src: {"inode":5} /user/username/projects/myproject/src/file1.ts: @@ -371,7 +371,7 @@ exitCode:: ExitStatus.undefined Change:: npm install index file in file2 Input:: -//// [/user/username/projects/myproject/node_modules/file2/index.d.ts] Inode:: 121 +//// [/user/username/projects/myproject/node_modules/file2/index.d.ts] Inode:: 122 export const x = 10; @@ -401,9 +401,9 @@ FsWatches:: /user/username/projects/myproject: {"inode":4} /user/username/projects/myproject/node_modules: - {"inode":119} -/user/username/projects/myproject/node_modules/file2: *new* {"inode":120} +/user/username/projects/myproject/node_modules/file2: *new* + {"inode":121} /user/username/projects/myproject/src: {"inode":5} /user/username/projects/myproject/src/file1.ts: @@ -459,7 +459,7 @@ Output:: -//// [/user/username/projects/myproject/src/file1.js] file written with same contents Inode:: 118 +//// [/user/username/projects/myproject/src/file1.js] file written with same contents Inode:: 119 PolledWatches:: /user/username/projects/myproject/node_modules/@types: @@ -485,11 +485,11 @@ FsWatches:: /user/username/projects/myproject: {"inode":4} /user/username/projects/myproject/node_modules: - {"inode":119} -/user/username/projects/myproject/node_modules/file2: {"inode":120} -/user/username/projects/myproject/node_modules/file2/index.d.ts: *new* +/user/username/projects/myproject/node_modules/file2: {"inode":121} +/user/username/projects/myproject/node_modules/file2/index.d.ts: *new* + {"inode":122} /user/username/projects/myproject/src: {"inode":5} /user/username/projects/myproject/src/file1.ts: diff --git a/tests/baselines/reference/tscWatch/watchEnvironment/watchOptions/with-excludeDirectories-option-with-recursive-directory-watching-extendedDiagnostics.js b/tests/baselines/reference/tscWatch/watchEnvironment/watchOptions/with-excludeDirectories-option-with-recursive-directory-watching-extendedDiagnostics.js index 5be5625625763..2d6f938b91040 100644 --- a/tests/baselines/reference/tscWatch/watchEnvironment/watchOptions/with-excludeDirectories-option-with-recursive-directory-watching-extendedDiagnostics.js +++ b/tests/baselines/reference/tscWatch/watchEnvironment/watchOptions/with-excludeDirectories-option-with-recursive-directory-watching-extendedDiagnostics.js @@ -78,7 +78,7 @@ DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/myproject 1 {"excl Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/myproject 1 {"excludeDirectories":["/user/username/projects/myproject/**/temp"]} Wild card directory -//// [/user/username/projects/myproject/src/main.js] Inode:: 122 +//// [/user/username/projects/myproject/src/main.js] Inode:: 123 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var bar_1 = require("bar"); @@ -180,7 +180,7 @@ exitCode:: ExitStatus.undefined Change:: add new folder to temp Input:: -//// [/user/username/projects/myproject/node_modules/bar/temp/fooBar/index.d.ts] Inode:: 124 +//// [/user/username/projects/myproject/node_modules/bar/temp/fooBar/index.d.ts] Inode:: 125 export function temp(): string; diff --git a/tests/baselines/reference/tscWatch/watchEnvironment/watchOptions/with-excludeDirectories-option-with-recursive-directory-watching.js b/tests/baselines/reference/tscWatch/watchEnvironment/watchOptions/with-excludeDirectories-option-with-recursive-directory-watching.js index 0a663c86ac9e2..1685ce3f05b6d 100644 --- a/tests/baselines/reference/tscWatch/watchEnvironment/watchOptions/with-excludeDirectories-option-with-recursive-directory-watching.js +++ b/tests/baselines/reference/tscWatch/watchEnvironment/watchOptions/with-excludeDirectories-option-with-recursive-directory-watching.js @@ -51,7 +51,7 @@ Output:: -//// [/user/username/projects/myproject/src/main.js] Inode:: 122 +//// [/user/username/projects/myproject/src/main.js] Inode:: 123 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var bar_1 = require("bar"); @@ -141,7 +141,7 @@ exitCode:: ExitStatus.undefined Change:: add new folder to temp Input:: -//// [/user/username/projects/myproject/node_modules/bar/temp/fooBar/index.d.ts] Inode:: 124 +//// [/user/username/projects/myproject/node_modules/bar/temp/fooBar/index.d.ts] Inode:: 125 export function temp(): string; diff --git a/tests/baselines/reference/tscWatch/watchEnvironment/watchOptions/with-fallbackPolling-option.js b/tests/baselines/reference/tscWatch/watchEnvironment/watchOptions/with-fallbackPolling-option.js index 36f09e06376bb..befbdd3f8dd71 100644 --- a/tests/baselines/reference/tscWatch/watchEnvironment/watchOptions/with-fallbackPolling-option.js +++ b/tests/baselines/reference/tscWatch/watchEnvironment/watchOptions/with-fallbackPolling-option.js @@ -42,11 +42,11 @@ sysLog:: /home/src/tslibs/TS/Lib/lib.d.ts:: Changing to watchFile sysLog:: /user/username/projects/project:: Changing to watchFile -//// [/user/username/projects/project/commonFile1.js] Inode:: 115 +//// [/user/username/projects/project/commonFile1.js] Inode:: 116 var x = 1; -//// [/user/username/projects/project/commonFile2.js] Inode:: 116 +//// [/user/username/projects/project/commonFile2.js] Inode:: 117 var y = 1; diff --git a/tests/baselines/reference/tscWatch/watchEnvironment/watchOptions/with-watchDirectory-option.js b/tests/baselines/reference/tscWatch/watchEnvironment/watchOptions/with-watchDirectory-option.js index 9e333354c90b3..ce74ac0903904 100644 --- a/tests/baselines/reference/tscWatch/watchEnvironment/watchOptions/with-watchDirectory-option.js +++ b/tests/baselines/reference/tscWatch/watchEnvironment/watchOptions/with-watchDirectory-option.js @@ -37,11 +37,11 @@ Output:: -//// [/user/username/projects/project/commonFile1.js] Inode:: 115 +//// [/user/username/projects/project/commonFile1.js] Inode:: 116 var x = 1; -//// [/user/username/projects/project/commonFile2.js] Inode:: 116 +//// [/user/username/projects/project/commonFile2.js] Inode:: 117 var y = 1; diff --git a/tests/baselines/reference/tsserver/projectErrors/file-rename-on-wsl2.js b/tests/baselines/reference/tsserver/projectErrors/file-rename-on-wsl2.js index 29aea416971b2..cd20902d6264f 100644 --- a/tests/baselines/reference/tsserver/projectErrors/file-rename-on-wsl2.js +++ b/tests/baselines/reference/tsserver/projectErrors/file-rename-on-wsl2.js @@ -216,7 +216,7 @@ Info seq [hh:mm:ss:mss] Scheduled: /home/username/workspaces/project/tsconfig.j Info seq [hh:mm:ss:mss] Scheduled: *ensureProjectForOpenFiles* Info seq [hh:mm:ss:mss] Elapsed:: *ms FileWatcher:: Triggered with /home/username/workspaces/project/src/b.ts 2:: WatchInfo: /home/username/workspaces/project/src/b.ts 500 undefined WatchType: Closed Script info Before request -//// [/home/username/workspaces/project/src/c.ts] Inode:: 118 +//// [/home/username/workspaces/project/src/c.ts] Inode:: 119 export const b = 10; //// [/home/username/workspaces/project/src/b.ts] deleted @@ -494,7 +494,7 @@ FsWatches:: /home/username/workspaces/project/src: {"inode":5} /home/username/workspaces/project/src/c.ts: *new* - {"inode":118} + {"inode":119} /home/username/workspaces/project/tsconfig.json: {"inode":8} diff --git a/tests/baselines/reference/tsserver/resolutionCache/when-resolution-fails-in-global-typings-location-with-currentDirectory-at-root.js b/tests/baselines/reference/tsserver/resolutionCache/when-resolution-fails-in-global-typings-location-with-currentDirectory-at-root.js index 503fc2b860eec..2baa883972c8e 100644 --- a/tests/baselines/reference/tsserver/resolutionCache/when-resolution-fails-in-global-typings-location-with-currentDirectory-at-root.js +++ b/tests/baselines/reference/tsserver/resolutionCache/when-resolution-fails-in-global-typings-location-with-currentDirectory-at-root.js @@ -118,10 +118,10 @@ TI:: [hh:mm:ss:mss] Updating types-registry npm package... TI:: [hh:mm:ss:mss] npm install --ignore-scripts types-registry@latest TI:: [hh:mm:ss:mss] Updated types-registry npm package TI:: typing installer creation complete -//// [/home/src/Library/Caches/typescript/package.json] Inode:: 111 +//// [/home/src/Library/Caches/typescript/package.json] Inode:: 112 { "private": true } -//// [/home/src/Library/Caches/typescript/node_modules/types-registry/index.json] Inode:: 114 +//// [/home/src/Library/Caches/typescript/node_modules/types-registry/index.json] Inode:: 115 { "entries": {} } diff --git a/tests/baselines/reference/tsserver/resolutionCache/when-resolution-fails-in-global-typings-location.js b/tests/baselines/reference/tsserver/resolutionCache/when-resolution-fails-in-global-typings-location.js index 820227692296e..1c460e44f2b75 100644 --- a/tests/baselines/reference/tsserver/resolutionCache/when-resolution-fails-in-global-typings-location.js +++ b/tests/baselines/reference/tsserver/resolutionCache/when-resolution-fails-in-global-typings-location.js @@ -175,10 +175,10 @@ TI:: [hh:mm:ss:mss] Updating types-registry npm package... TI:: [hh:mm:ss:mss] npm install --ignore-scripts types-registry@latest TI:: [hh:mm:ss:mss] Updated types-registry npm package TI:: typing installer creation complete -//// [/home/src/Library/Caches/typescript/package.json] Inode:: 114 +//// [/home/src/Library/Caches/typescript/package.json] Inode:: 115 { "private": true } -//// [/home/src/Library/Caches/typescript/node_modules/types-registry/index.json] Inode:: 117 +//// [/home/src/Library/Caches/typescript/node_modules/types-registry/index.json] Inode:: 118 { "entries": {} } diff --git a/tests/baselines/reference/tsserver/resolutionCache/when-resolution-is-succeeds-in-global-typings-location-with-import-from-the-cache-file-failing-with-currentDirectory-at-root.js b/tests/baselines/reference/tsserver/resolutionCache/when-resolution-is-succeeds-in-global-typings-location-with-import-from-the-cache-file-failing-with-currentDirectory-at-root.js index a86bbd397669b..6bddea8333a31 100644 --- a/tests/baselines/reference/tsserver/resolutionCache/when-resolution-is-succeeds-in-global-typings-location-with-import-from-the-cache-file-failing-with-currentDirectory-at-root.js +++ b/tests/baselines/reference/tsserver/resolutionCache/when-resolution-is-succeeds-in-global-typings-location-with-import-from-the-cache-file-failing-with-currentDirectory-at-root.js @@ -22,10 +22,10 @@ interface Array { length: number; [n: number]: T; } interface ReadonlyArray {} declare const console: { log(msg: any): void; }; -//// [/home/src/Library/Caches/typescript/package.json] Inode:: 115 +//// [/home/src/Library/Caches/typescript/package.json] Inode:: 116 { "private": true } -//// [/home/src/Library/Caches/typescript/node_modules/types-registry/index.json] Inode:: 117 +//// [/home/src/Library/Caches/typescript/node_modules/types-registry/index.json] Inode:: 118 { "entries": {} } @@ -152,7 +152,7 @@ PolledWatches:: FsWatches:: /home/src/Library/Caches/typescript/package.json: *new* - {"inode":115} + {"inode":116} /home/src/tslibs/TS/Lib/lib.es2020.full.d.ts: *new* {"inode":19} diff --git a/tests/baselines/reference/tsserver/resolutionCache/when-resolution-is-succeeds-in-global-typings-location-with-import-from-the-cache-file-failing.js b/tests/baselines/reference/tsserver/resolutionCache/when-resolution-is-succeeds-in-global-typings-location-with-import-from-the-cache-file-failing.js index 1269c60a80684..d69ffd3d1d7a8 100644 --- a/tests/baselines/reference/tsserver/resolutionCache/when-resolution-is-succeeds-in-global-typings-location-with-import-from-the-cache-file-failing.js +++ b/tests/baselines/reference/tsserver/resolutionCache/when-resolution-is-succeeds-in-global-typings-location-with-import-from-the-cache-file-failing.js @@ -22,10 +22,10 @@ interface Array { length: number; [n: number]: T; } interface ReadonlyArray {} declare const console: { log(msg: any): void; }; -//// [/home/src/Library/Caches/typescript/package.json] Inode:: 118 +//// [/home/src/Library/Caches/typescript/package.json] Inode:: 119 { "private": true } -//// [/home/src/Library/Caches/typescript/node_modules/types-registry/index.json] Inode:: 120 +//// [/home/src/Library/Caches/typescript/node_modules/types-registry/index.json] Inode:: 121 { "entries": {} } @@ -201,7 +201,7 @@ PolledWatches:: FsWatches:: /home/src/Library/Caches/typescript/package.json: *new* - {"inode":118} + {"inode":119} /home/src/Vscode: *new* {"inode":10} /home/src/Vscode/Projects: *new* @@ -401,7 +401,7 @@ PolledWatches:: FsWatches:: /home/src/Library/Caches/typescript/package.json: - {"inode":118} + {"inode":119} /home/src/Vscode: {"inode":10} /home/src/Vscode/Projects: diff --git a/tests/baselines/reference/tsserver/resolutionCache/when-resolution-is-succeeds-in-global-typings-location-with-import-from-the-cache-file-with-currentDirectory-at-root.js b/tests/baselines/reference/tsserver/resolutionCache/when-resolution-is-succeeds-in-global-typings-location-with-import-from-the-cache-file-with-currentDirectory-at-root.js index 37a13dd5f33fa..1f447db55e41c 100644 --- a/tests/baselines/reference/tsserver/resolutionCache/when-resolution-is-succeeds-in-global-typings-location-with-import-from-the-cache-file-with-currentDirectory-at-root.js +++ b/tests/baselines/reference/tsserver/resolutionCache/when-resolution-is-succeeds-in-global-typings-location-with-import-from-the-cache-file-with-currentDirectory-at-root.js @@ -26,10 +26,10 @@ interface Array { length: number; [n: number]: T; } interface ReadonlyArray {} declare const console: { log(msg: any): void; }; -//// [/home/src/Library/Caches/typescript/package.json] Inode:: 117 +//// [/home/src/Library/Caches/typescript/package.json] Inode:: 118 { "private": true } -//// [/home/src/Library/Caches/typescript/node_modules/types-registry/index.json] Inode:: 119 +//// [/home/src/Library/Caches/typescript/node_modules/types-registry/index.json] Inode:: 120 { "entries": {} } @@ -161,7 +161,7 @@ PolledWatches:: FsWatches:: /home/src/Library/Caches/typescript/package.json: *new* - {"inode":117} + {"inode":118} /home/src/tslibs/TS/Lib/lib.es2020.full.d.ts: *new* {"inode":21} diff --git a/tests/baselines/reference/tsserver/resolutionCache/when-resolution-is-succeeds-in-global-typings-location-with-import-from-the-cache-file.js b/tests/baselines/reference/tsserver/resolutionCache/when-resolution-is-succeeds-in-global-typings-location-with-import-from-the-cache-file.js index 5c43f5fabc833..c157c6b6c1466 100644 --- a/tests/baselines/reference/tsserver/resolutionCache/when-resolution-is-succeeds-in-global-typings-location-with-import-from-the-cache-file.js +++ b/tests/baselines/reference/tsserver/resolutionCache/when-resolution-is-succeeds-in-global-typings-location-with-import-from-the-cache-file.js @@ -26,10 +26,10 @@ interface Array { length: number; [n: number]: T; } interface ReadonlyArray {} declare const console: { log(msg: any): void; }; -//// [/home/src/Library/Caches/typescript/package.json] Inode:: 120 +//// [/home/src/Library/Caches/typescript/package.json] Inode:: 121 { "private": true } -//// [/home/src/Library/Caches/typescript/node_modules/types-registry/index.json] Inode:: 122 +//// [/home/src/Library/Caches/typescript/node_modules/types-registry/index.json] Inode:: 123 { "entries": {} } @@ -210,7 +210,7 @@ PolledWatches:: FsWatches:: /home/src/Library/Caches/typescript/package.json: *new* - {"inode":120} + {"inode":121} /home/src/Vscode: *new* {"inode":12} /home/src/Vscode/Projects: *new* @@ -406,7 +406,7 @@ PolledWatches:: FsWatches:: /home/src/Library/Caches/typescript/package.json: - {"inode":120} + {"inode":121} /home/src/Vscode: {"inode":12} /home/src/Vscode/Projects: diff --git a/tests/baselines/reference/tsserver/resolutionCache/when-resolution-is-succeeds-in-global-typings-location-with-relative-import-from-the-cache-file-with-currentDirectory-at-root.js b/tests/baselines/reference/tsserver/resolutionCache/when-resolution-is-succeeds-in-global-typings-location-with-relative-import-from-the-cache-file-with-currentDirectory-at-root.js index 7c0bf5288dbbd..3e7882850597f 100644 --- a/tests/baselines/reference/tsserver/resolutionCache/when-resolution-is-succeeds-in-global-typings-location-with-relative-import-from-the-cache-file-with-currentDirectory-at-root.js +++ b/tests/baselines/reference/tsserver/resolutionCache/when-resolution-is-succeeds-in-global-typings-location-with-relative-import-from-the-cache-file-with-currentDirectory-at-root.js @@ -26,10 +26,10 @@ interface Array { length: number; [n: number]: T; } interface ReadonlyArray {} declare const console: { log(msg: any): void; }; -//// [/home/src/Library/Caches/typescript/package.json] Inode:: 116 +//// [/home/src/Library/Caches/typescript/package.json] Inode:: 117 { "private": true } -//// [/home/src/Library/Caches/typescript/node_modules/types-registry/index.json] Inode:: 118 +//// [/home/src/Library/Caches/typescript/node_modules/types-registry/index.json] Inode:: 119 { "entries": {} } @@ -148,7 +148,7 @@ PolledWatches:: FsWatches:: /home/src/Library/Caches/typescript/package.json: *new* - {"inode":116} + {"inode":117} /home/src/tslibs/TS/Lib/lib.es2020.full.d.ts: *new* {"inode":20} diff --git a/tests/baselines/reference/tsserver/resolutionCache/when-resolution-is-succeeds-in-global-typings-location-with-relative-import-from-the-cache-file.js b/tests/baselines/reference/tsserver/resolutionCache/when-resolution-is-succeeds-in-global-typings-location-with-relative-import-from-the-cache-file.js index 3f3fb92fd3d8c..63da209d542e8 100644 --- a/tests/baselines/reference/tsserver/resolutionCache/when-resolution-is-succeeds-in-global-typings-location-with-relative-import-from-the-cache-file.js +++ b/tests/baselines/reference/tsserver/resolutionCache/when-resolution-is-succeeds-in-global-typings-location-with-relative-import-from-the-cache-file.js @@ -26,10 +26,10 @@ interface Array { length: number; [n: number]: T; } interface ReadonlyArray {} declare const console: { log(msg: any): void; }; -//// [/home/src/Library/Caches/typescript/package.json] Inode:: 119 +//// [/home/src/Library/Caches/typescript/package.json] Inode:: 120 { "private": true } -//// [/home/src/Library/Caches/typescript/node_modules/types-registry/index.json] Inode:: 121 +//// [/home/src/Library/Caches/typescript/node_modules/types-registry/index.json] Inode:: 122 { "entries": {} } @@ -197,7 +197,7 @@ PolledWatches:: FsWatches:: /home/src/Library/Caches/typescript/package.json: *new* - {"inode":119} + {"inode":120} /home/src/Vscode: *new* {"inode":11} /home/src/Vscode/Projects: *new* @@ -391,7 +391,7 @@ PolledWatches:: FsWatches:: /home/src/Library/Caches/typescript/package.json: - {"inode":119} + {"inode":120} /home/src/Vscode: {"inode":11} /home/src/Vscode/Projects: diff --git a/tests/baselines/reference/tsserver/symLinks/monorepo-style-sibling-packages-symlinked-Linux-canUseWatchEvents.js b/tests/baselines/reference/tsserver/symLinks/monorepo-style-sibling-packages-symlinked-Linux-canUseWatchEvents.js index cf22a075f9cfc..937a4fd7f2699 100644 --- a/tests/baselines/reference/tsserver/symLinks/monorepo-style-sibling-packages-symlinked-Linux-canUseWatchEvents.js +++ b/tests/baselines/reference/tsserver/symLinks/monorepo-style-sibling-packages-symlinked-Linux-canUseWatchEvents.js @@ -685,20 +685,20 @@ Custom watchDirectory:: Triggered Ignored:: {"id":8,"path":"/home/src/projects/p Custom watchDirectory:: Triggered Ignored:: {"id":8,"path":"/home/src/projects/project/node_modules/package1","recursive":true,"ignoreUpdate":true}:: /home/src/projects/project/node_modules/package1/tsconfig.tsbuildinfo.readable.baseline.txt created Custom watchDirectory:: Triggered Ignored:: {"id":8,"path":"/home/src/projects/project/node_modules/package1","recursive":true,"ignoreUpdate":true}:: /home/src/projects/project/node_modules/package1/tsconfig.tsbuildinfo.readable.baseline.txt updated Before request -//// [/home/src/projects/project/packages/package1/dist/index.js] Inode:: 127 +//// [/home/src/projects/project/packages/package1/dist/index.js] Inode:: 128 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -//// [/home/src/projects/project/packages/package1/dist/index.d.ts] Inode:: 128 +//// [/home/src/projects/project/packages/package1/dist/index.d.ts] Inode:: 129 export type FooType = "foo"; export type BarType = "bar"; -//// [/home/src/projects/project/packages/package1/tsconfig.tsbuildinfo] Inode:: 129 +//// [/home/src/projects/project/packages/package1/tsconfig.tsbuildinfo] Inode:: 130 {"root":["./src/index.ts"],"version":"FakeTSVersion"} -//// [/home/src/projects/project/packages/package1/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 130 +//// [/home/src/projects/project/packages/package1/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 131 { "root": [ "./src/index.ts" @@ -1429,14 +1429,14 @@ Custom watchDirectory:: Triggered Ignored:: {"id":8,"path":"/home/src/projects/p Custom watchDirectory:: Triggered Ignored:: {"id":8,"path":"/home/src/projects/project/node_modules/package1","recursive":true,"ignoreUpdate":true}:: /home/src/projects/project/node_modules/package1/tsconfig.tsbuildinfo updated Custom watchDirectory:: Triggered Ignored:: {"id":8,"path":"/home/src/projects/project/node_modules/package1","recursive":true,"ignoreUpdate":true}:: /home/src/projects/project/node_modules/package1/tsconfig.tsbuildinfo.readable.baseline.txt updated Before request -//// [/home/src/projects/project/packages/package1/tsconfig.tsbuildinfo] file written with same contents Inode:: 129 -//// [/home/src/projects/project/packages/package1/tsconfig.tsbuildinfo.readable.baseline.txt] file written with same contents Inode:: 130 -//// [/home/src/projects/project/packages/package1/dist/index.js] Inode:: 132 +//// [/home/src/projects/project/packages/package1/tsconfig.tsbuildinfo] file written with same contents Inode:: 130 +//// [/home/src/projects/project/packages/package1/tsconfig.tsbuildinfo.readable.baseline.txt] file written with same contents Inode:: 131 +//// [/home/src/projects/project/packages/package1/dist/index.js] Inode:: 133 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -//// [/home/src/projects/project/packages/package1/dist/index.d.ts] Inode:: 133 +//// [/home/src/projects/project/packages/package1/dist/index.d.ts] Inode:: 134 export type FooType = "foo"; export type BarType = "bar"; diff --git a/tests/baselines/reference/tsserver/symLinks/monorepo-style-sibling-packages-symlinked-Linux.js b/tests/baselines/reference/tsserver/symLinks/monorepo-style-sibling-packages-symlinked-Linux.js index 226c174afde5e..01ee8e010dcdb 100644 --- a/tests/baselines/reference/tsserver/symLinks/monorepo-style-sibling-packages-symlinked-Linux.js +++ b/tests/baselines/reference/tsserver/symLinks/monorepo-style-sibling-packages-symlinked-Linux.js @@ -495,20 +495,20 @@ After running Immedidate callback:: count: 0 Build dependencies Before running Timeout callback:: count: 1 7: timerToUpdateChildWatches -//// [/home/src/projects/project/packages/package1/dist/index.js] Inode:: 127 +//// [/home/src/projects/project/packages/package1/dist/index.js] Inode:: 128 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -//// [/home/src/projects/project/packages/package1/dist/index.d.ts] Inode:: 128 +//// [/home/src/projects/project/packages/package1/dist/index.d.ts] Inode:: 129 export type FooType = "foo"; export type BarType = "bar"; -//// [/home/src/projects/project/packages/package1/tsconfig.tsbuildinfo] Inode:: 129 +//// [/home/src/projects/project/packages/package1/tsconfig.tsbuildinfo] Inode:: 130 {"root":["./src/index.ts"],"version":"FakeTSVersion"} -//// [/home/src/projects/project/packages/package1/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 130 +//// [/home/src/projects/project/packages/package1/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 131 { "root": [ "./src/index.ts" @@ -554,7 +554,7 @@ FsWatches:: /home/src/projects/project/packages/package1: {"inode":6} /home/src/projects/project/packages/package1/dist: *new* - {"inode":126} + {"inode":127} /home/src/projects/project/packages/package1/package.json: {"inode":7} /home/src/projects/project/packages/package1/src: @@ -699,9 +699,9 @@ FsWatches:: /home/src/projects/project/packages/package1: {"inode":6} /home/src/projects/project/packages/package1/dist: - {"inode":126} + {"inode":127} /home/src/projects/project/packages/package1/dist/index.d.ts: *new* - {"inode":128} + {"inode":129} /home/src/projects/project/packages/package1/package.json: {"inode":7} /home/src/projects/project/packages/package1/src: @@ -910,9 +910,9 @@ FsWatches:: FsWatches *deleted*:: /home/src/projects/project/packages/package1/dist: - {"inode":126} + {"inode":127} /home/src/projects/project/packages/package1/dist/index.d.ts: - {"inode":128} + {"inode":129} Timeout callback:: count: 3 13: /home/src/projects/project/packages/package2/tsconfig.json *new* @@ -1348,14 +1348,14 @@ Info seq [hh:mm:ss:mss] FileWatcher:: Triggered with /home/src/projects/project Info seq [hh:mm:ss:mss] Elapsed:: *ms FileWatcher:: Triggered with /home/src/projects/project/packages/package1/dist/index.d.ts 0:: WatchInfo: /home/src/projects/project/packages/package1/dist/index.d.ts 500 undefined WatchType: Closed Script info Before running Timeout callback:: count: 1 25: timerToUpdateChildWatches -//// [/home/src/projects/project/packages/package1/tsconfig.tsbuildinfo] file written with same contents Inode:: 129 -//// [/home/src/projects/project/packages/package1/tsconfig.tsbuildinfo.readable.baseline.txt] file written with same contents Inode:: 130 -//// [/home/src/projects/project/packages/package1/dist/index.js] Inode:: 132 +//// [/home/src/projects/project/packages/package1/tsconfig.tsbuildinfo] file written with same contents Inode:: 130 +//// [/home/src/projects/project/packages/package1/tsconfig.tsbuildinfo.readable.baseline.txt] file written with same contents Inode:: 131 +//// [/home/src/projects/project/packages/package1/dist/index.js] Inode:: 133 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -//// [/home/src/projects/project/packages/package1/dist/index.d.ts] Inode:: 133 +//// [/home/src/projects/project/packages/package1/dist/index.d.ts] Inode:: 134 export type FooType = "foo"; export type BarType = "bar"; @@ -1389,7 +1389,7 @@ FsWatches:: /home/src/projects/project/packages/package1: {"inode":6} /home/src/projects/project/packages/package1/dist/index.d.ts: *new* - {"inode":133} + {"inode":134} /home/src/projects/project/packages/package1/package.json: {"inode":7} /home/src/projects/project/packages/package1/src: @@ -1455,9 +1455,9 @@ FsWatches:: /home/src/projects/project/packages/package1: {"inode":6} /home/src/projects/project/packages/package1/dist: *new* - {"inode":131} + {"inode":132} /home/src/projects/project/packages/package1/dist/index.d.ts: - {"inode":133} + {"inode":134} /home/src/projects/project/packages/package1/package.json: {"inode":7} /home/src/projects/project/packages/package1/src: @@ -1600,9 +1600,9 @@ FsWatches:: /home/src/projects/project/packages/package1: {"inode":6} /home/src/projects/project/packages/package1/dist: - {"inode":131} + {"inode":132} /home/src/projects/project/packages/package1/dist/index.d.ts: - {"inode":133} + {"inode":134} /home/src/projects/project/packages/package1/package.json: {"inode":7} /home/src/projects/project/packages/package1/src: diff --git a/tests/baselines/reference/tsserver/symLinks/monorepo-style-sibling-packages-symlinked-package1-built-Linux-canUseWatchEvents.js b/tests/baselines/reference/tsserver/symLinks/monorepo-style-sibling-packages-symlinked-package1-built-Linux-canUseWatchEvents.js index f894acf295042..47352983e9948 100644 --- a/tests/baselines/reference/tsserver/symLinks/monorepo-style-sibling-packages-symlinked-package1-built-Linux-canUseWatchEvents.js +++ b/tests/baselines/reference/tsserver/symLinks/monorepo-style-sibling-packages-symlinked-package1-built-Linux-canUseWatchEvents.js @@ -86,20 +86,20 @@ declare const console: { log(msg: any): void; }; //// [/home/src/tslibs/TS/Lib/lib.es2016.full.d.ts] *Lib* Inode:: 34 -//// [/home/src/projects/project/packages/package1/dist/index.js] Inode:: 127 +//// [/home/src/projects/project/packages/package1/dist/index.js] Inode:: 128 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -//// [/home/src/projects/project/packages/package1/dist/index.d.ts] Inode:: 128 +//// [/home/src/projects/project/packages/package1/dist/index.d.ts] Inode:: 129 export type FooType = "foo"; export type BarType = "bar"; -//// [/home/src/projects/project/packages/package1/tsconfig.tsbuildinfo] Inode:: 129 +//// [/home/src/projects/project/packages/package1/tsconfig.tsbuildinfo] Inode:: 130 {"root":["./src/index.ts"],"version":"FakeTSVersion"} -//// [/home/src/projects/project/packages/package1/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 130 +//// [/home/src/projects/project/packages/package1/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 131 { "root": [ "./src/index.ts" @@ -1047,14 +1047,14 @@ Custom watchDirectory:: Triggered Ignored:: {"id":9,"path":"/home/src/projects/p Custom watchDirectory:: Triggered Ignored:: {"id":9,"path":"/home/src/projects/project/node_modules/package1","recursive":true,"ignoreUpdate":true}:: /home/src/projects/project/node_modules/package1/tsconfig.tsbuildinfo updated Custom watchDirectory:: Triggered Ignored:: {"id":9,"path":"/home/src/projects/project/node_modules/package1","recursive":true,"ignoreUpdate":true}:: /home/src/projects/project/node_modules/package1/tsconfig.tsbuildinfo.readable.baseline.txt updated Before request -//// [/home/src/projects/project/packages/package1/tsconfig.tsbuildinfo] file written with same contents Inode:: 129 -//// [/home/src/projects/project/packages/package1/tsconfig.tsbuildinfo.readable.baseline.txt] file written with same contents Inode:: 130 -//// [/home/src/projects/project/packages/package1/dist/index.js] Inode:: 132 +//// [/home/src/projects/project/packages/package1/tsconfig.tsbuildinfo] file written with same contents Inode:: 130 +//// [/home/src/projects/project/packages/package1/tsconfig.tsbuildinfo.readable.baseline.txt] file written with same contents Inode:: 131 +//// [/home/src/projects/project/packages/package1/dist/index.js] Inode:: 133 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -//// [/home/src/projects/project/packages/package1/dist/index.d.ts] Inode:: 133 +//// [/home/src/projects/project/packages/package1/dist/index.d.ts] Inode:: 134 export type FooType = "foo"; export type BarType = "bar"; diff --git a/tests/baselines/reference/tsserver/symLinks/monorepo-style-sibling-packages-symlinked-package1-built-Linux.js b/tests/baselines/reference/tsserver/symLinks/monorepo-style-sibling-packages-symlinked-package1-built-Linux.js index 66603227a4624..8eb80222e5db1 100644 --- a/tests/baselines/reference/tsserver/symLinks/monorepo-style-sibling-packages-symlinked-package1-built-Linux.js +++ b/tests/baselines/reference/tsserver/symLinks/monorepo-style-sibling-packages-symlinked-package1-built-Linux.js @@ -86,20 +86,20 @@ declare const console: { log(msg: any): void; }; //// [/home/src/tslibs/TS/Lib/lib.es2016.full.d.ts] *Lib* Inode:: 34 -//// [/home/src/projects/project/packages/package1/dist/index.js] Inode:: 127 +//// [/home/src/projects/project/packages/package1/dist/index.js] Inode:: 128 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -//// [/home/src/projects/project/packages/package1/dist/index.d.ts] Inode:: 128 +//// [/home/src/projects/project/packages/package1/dist/index.d.ts] Inode:: 129 export type FooType = "foo"; export type BarType = "bar"; -//// [/home/src/projects/project/packages/package1/tsconfig.tsbuildinfo] Inode:: 129 +//// [/home/src/projects/project/packages/package1/tsconfig.tsbuildinfo] Inode:: 130 {"root":["./src/index.ts"],"version":"FakeTSVersion"} -//// [/home/src/projects/project/packages/package1/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 130 +//// [/home/src/projects/project/packages/package1/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 131 { "root": [ "./src/index.ts" @@ -330,9 +330,9 @@ FsWatches:: /home/src/projects/project/packages/package1: *new* {"inode":6} /home/src/projects/project/packages/package1/dist: *new* - {"inode":126} + {"inode":127} /home/src/projects/project/packages/package1/dist/index.d.ts: *new* - {"inode":128} + {"inode":129} /home/src/projects/project/packages/package1/package.json: *new* {"inode":7} /home/src/projects/project/packages/package1/src: *new* @@ -540,9 +540,9 @@ FsWatches:: FsWatches *deleted*:: /home/src/projects/project/packages/package1/dist: - {"inode":126} + {"inode":127} /home/src/projects/project/packages/package1/dist/index.d.ts: - {"inode":128} + {"inode":129} Timeout callback:: count: 3 2: /home/src/projects/project/packages/package2/tsconfig.json *new* @@ -983,14 +983,14 @@ Info seq [hh:mm:ss:mss] FileWatcher:: Triggered with /home/src/projects/project Info seq [hh:mm:ss:mss] Elapsed:: *ms FileWatcher:: Triggered with /home/src/projects/project/packages/package1/dist/index.d.ts 0:: WatchInfo: /home/src/projects/project/packages/package1/dist/index.d.ts 500 undefined WatchType: Closed Script info Before running Timeout callback:: count: 1 14: timerToUpdateChildWatches -//// [/home/src/projects/project/packages/package1/tsconfig.tsbuildinfo] file written with same contents Inode:: 129 -//// [/home/src/projects/project/packages/package1/tsconfig.tsbuildinfo.readable.baseline.txt] file written with same contents Inode:: 130 -//// [/home/src/projects/project/packages/package1/dist/index.js] Inode:: 132 +//// [/home/src/projects/project/packages/package1/tsconfig.tsbuildinfo] file written with same contents Inode:: 130 +//// [/home/src/projects/project/packages/package1/tsconfig.tsbuildinfo.readable.baseline.txt] file written with same contents Inode:: 131 +//// [/home/src/projects/project/packages/package1/dist/index.js] Inode:: 133 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -//// [/home/src/projects/project/packages/package1/dist/index.d.ts] Inode:: 133 +//// [/home/src/projects/project/packages/package1/dist/index.d.ts] Inode:: 134 export type FooType = "foo"; export type BarType = "bar"; @@ -1024,7 +1024,7 @@ FsWatches:: /home/src/projects/project/packages/package1: {"inode":6} /home/src/projects/project/packages/package1/dist/index.d.ts: *new* - {"inode":133} + {"inode":134} /home/src/projects/project/packages/package1/package.json: {"inode":7} /home/src/projects/project/packages/package1/src: @@ -1090,9 +1090,9 @@ FsWatches:: /home/src/projects/project/packages/package1: {"inode":6} /home/src/projects/project/packages/package1/dist: *new* - {"inode":131} + {"inode":132} /home/src/projects/project/packages/package1/dist/index.d.ts: - {"inode":133} + {"inode":134} /home/src/projects/project/packages/package1/package.json: {"inode":7} /home/src/projects/project/packages/package1/src: @@ -1235,9 +1235,9 @@ FsWatches:: /home/src/projects/project/packages/package1: {"inode":6} /home/src/projects/project/packages/package1/dist: - {"inode":131} + {"inode":132} /home/src/projects/project/packages/package1/dist/index.d.ts: - {"inode":133} + {"inode":134} /home/src/projects/project/packages/package1/package.json: {"inode":7} /home/src/projects/project/packages/package1/src: diff --git a/tests/baselines/reference/tsserver/symLinks/packages-outside-project-folder-Linux-canUseWatchEvents.js b/tests/baselines/reference/tsserver/symLinks/packages-outside-project-folder-Linux-canUseWatchEvents.js index d09f35306a249..17004c2f1dc65 100644 --- a/tests/baselines/reference/tsserver/symLinks/packages-outside-project-folder-Linux-canUseWatchEvents.js +++ b/tests/baselines/reference/tsserver/symLinks/packages-outside-project-folder-Linux-canUseWatchEvents.js @@ -688,7 +688,7 @@ After running Immedidate callback:: count: 0 change in unrelated folder in a Before running Timeout callback:: count: 0 -//// [/home/src/projects/a/2/unrelated/somethingUnrelated.ts] Inode:: 147 +//// [/home/src/projects/a/2/unrelated/somethingUnrelated.ts] Inode:: 148 export const a = 10; @@ -818,7 +818,7 @@ After running Immedidate callback:: count: 0 change in unrelated folder in c Before running Timeout callback:: count: 0 -//// [/home/src/projects/c/4/unrelated/somethingUnrelated.ts] Inode:: 148 +//// [/home/src/projects/c/4/unrelated/somethingUnrelated.ts] Inode:: 149 export const a = 10; @@ -968,18 +968,18 @@ Custom watchDirectory:: Triggered Ignored:: {"id":9,"path":"/home/src/projects/b Custom watchDirectory:: Triggered Ignored:: {"id":9,"path":"/home/src/projects/b/2/b-impl/b/node_modules/a","recursive":true,"ignoreUpdate":true}:: /home/src/projects/b/2/b-impl/b/node_modules/a/lib/tsconfig.tsbuildinfo.readable.baseline.txt updated Custom watchDirectory:: Triggered Ignored:: {"id":9,"path":"/home/src/projects/b/2/b-impl/b/node_modules/a","recursive":true,"ignoreUpdate":true}:: /home/src/projects/b/2/b-impl/b/node_modules/a/lib updated Before request -//// [/home/src/projects/c/3/c-impl/c/lib/c.js] Inode:: 150 +//// [/home/src/projects/c/3/c-impl/c/lib/c.js] Inode:: 151 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.c = void 0; exports.c = 'test'; -//// [/home/src/projects/c/3/c-impl/c/lib/c.d.ts] Inode:: 151 +//// [/home/src/projects/c/3/c-impl/c/lib/c.d.ts] Inode:: 152 export declare const c: string; -//// [/home/src/projects/c/3/c-impl/c/lib/index.js] Inode:: 152 +//// [/home/src/projects/c/3/c-impl/c/lib/index.js] Inode:: 153 "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; @@ -999,14 +999,14 @@ Object.defineProperty(exports, "__esModule", { value: true }); __exportStar(require("./c"), exports); -//// [/home/src/projects/c/3/c-impl/c/lib/index.d.ts] Inode:: 153 +//// [/home/src/projects/c/3/c-impl/c/lib/index.d.ts] Inode:: 154 export * from './c'; -//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo] Inode:: 154 +//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo] Inode:: 155 {"root":["../src/c.ts","../src/index.ts"],"version":"FakeTSVersion"} -//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 155 +//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 156 { "root": [ "../src/c.ts", @@ -1016,18 +1016,18 @@ export * from './c'; "size": 68 } -//// [/home/src/projects/a/1/a-impl/a/lib/a.js] Inode:: 157 +//// [/home/src/projects/a/1/a-impl/a/lib/a.js] Inode:: 158 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.a = void 0; exports.a = 'test'; -//// [/home/src/projects/a/1/a-impl/a/lib/a.d.ts] Inode:: 158 +//// [/home/src/projects/a/1/a-impl/a/lib/a.d.ts] Inode:: 159 export declare const a: string; -//// [/home/src/projects/a/1/a-impl/a/lib/index.js] Inode:: 159 +//// [/home/src/projects/a/1/a-impl/a/lib/index.js] Inode:: 160 "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; @@ -1048,15 +1048,15 @@ __exportStar(require("./a"), exports); __exportStar(require("c"), exports); -//// [/home/src/projects/a/1/a-impl/a/lib/index.d.ts] Inode:: 160 +//// [/home/src/projects/a/1/a-impl/a/lib/index.d.ts] Inode:: 161 export * from './a'; export * from 'c'; -//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo] Inode:: 161 +//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo] Inode:: 162 {"root":["../src/a.ts","../src/index.ts"],"version":"FakeTSVersion"} -//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 162 +//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 163 { "root": [ "../src/a.ts", @@ -1579,7 +1579,7 @@ After running Immedidate callback:: count: 0 change in unrelated folder in a Before running Timeout callback:: count: 0 -//// [/home/src/projects/a/2/unrelated/anotherFile.ts] Inode:: 163 +//// [/home/src/projects/a/2/unrelated/anotherFile.ts] Inode:: 164 export const a = 10; @@ -1695,7 +1695,7 @@ After running Immedidate callback:: count: 0 change in unrelated folder in c Before running Timeout callback:: count: 0 -//// [/home/src/projects/c/4/unrelated/anotherFile.ts] Inode:: 164 +//// [/home/src/projects/c/4/unrelated/anotherFile.ts] Inode:: 165 export const a = 10; @@ -2403,18 +2403,18 @@ Custom watchDirectory:: Triggered Ignored:: {"id":30,"path":"/home/src/projects/ Custom watchDirectory:: Triggered Ignored:: {"id":30,"path":"/home/src/projects/b/2/b-impl/b/node_modules/a","recursive":true,"ignoreUpdate":true}:: /home/src/projects/b/2/b-impl/b/node_modules/a/lib/tsconfig.tsbuildinfo.readable.baseline.txt updated Custom watchDirectory:: Triggered Ignored:: {"id":30,"path":"/home/src/projects/b/2/b-impl/b/node_modules/a","recursive":true,"ignoreUpdate":true}:: /home/src/projects/b/2/b-impl/b/node_modules/a/lib updated Before request -//// [/home/src/projects/c/3/c-impl/c/lib/c.js] Inode:: 166 +//// [/home/src/projects/c/3/c-impl/c/lib/c.js] Inode:: 167 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.c = void 0; exports.c = 'test'; -//// [/home/src/projects/c/3/c-impl/c/lib/c.d.ts] Inode:: 167 +//// [/home/src/projects/c/3/c-impl/c/lib/c.d.ts] Inode:: 168 export declare const c: string; -//// [/home/src/projects/c/3/c-impl/c/lib/index.js] Inode:: 168 +//// [/home/src/projects/c/3/c-impl/c/lib/index.js] Inode:: 169 "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; @@ -2434,14 +2434,14 @@ Object.defineProperty(exports, "__esModule", { value: true }); __exportStar(require("./c"), exports); -//// [/home/src/projects/c/3/c-impl/c/lib/index.d.ts] Inode:: 169 +//// [/home/src/projects/c/3/c-impl/c/lib/index.d.ts] Inode:: 170 export * from './c'; -//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo] Inode:: 170 +//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo] Inode:: 171 {"root":["../src/c.ts","../src/index.ts"],"version":"FakeTSVersion"} -//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 171 +//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 172 { "root": [ "../src/c.ts", @@ -2451,18 +2451,18 @@ export * from './c'; "size": 68 } -//// [/home/src/projects/a/1/a-impl/a/lib/a.js] Inode:: 173 +//// [/home/src/projects/a/1/a-impl/a/lib/a.js] Inode:: 174 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.a = void 0; exports.a = 'test'; -//// [/home/src/projects/a/1/a-impl/a/lib/a.d.ts] Inode:: 174 +//// [/home/src/projects/a/1/a-impl/a/lib/a.d.ts] Inode:: 175 export declare const a: string; -//// [/home/src/projects/a/1/a-impl/a/lib/index.js] Inode:: 175 +//// [/home/src/projects/a/1/a-impl/a/lib/index.js] Inode:: 176 "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; @@ -2483,15 +2483,15 @@ __exportStar(require("./a"), exports); __exportStar(require("c"), exports); -//// [/home/src/projects/a/1/a-impl/a/lib/index.d.ts] Inode:: 176 +//// [/home/src/projects/a/1/a-impl/a/lib/index.d.ts] Inode:: 177 export * from './a'; export * from 'c'; -//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo] Inode:: 177 +//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo] Inode:: 178 {"root":["../src/a.ts","../src/index.ts"],"version":"FakeTSVersion"} -//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 178 +//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 179 { "root": [ "../src/a.ts", diff --git a/tests/baselines/reference/tsserver/symLinks/packages-outside-project-folder-Linux.js b/tests/baselines/reference/tsserver/symLinks/packages-outside-project-folder-Linux.js index 75073a5a68442..ec5fb4b0c9483 100644 --- a/tests/baselines/reference/tsserver/symLinks/packages-outside-project-folder-Linux.js +++ b/tests/baselines/reference/tsserver/symLinks/packages-outside-project-folder-Linux.js @@ -443,7 +443,7 @@ After running Immedidate callback:: count: 0 change in unrelated folder in a Before running Timeout callback:: count: 0 -//// [/home/src/projects/a/2/unrelated/somethingUnrelated.ts] Inode:: 147 +//// [/home/src/projects/a/2/unrelated/somethingUnrelated.ts] Inode:: 148 export const a = 10; @@ -573,7 +573,7 @@ After running Immedidate callback:: count: 0 change in unrelated folder in c Before running Timeout callback:: count: 0 -//// [/home/src/projects/c/4/unrelated/somethingUnrelated.ts] Inode:: 148 +//// [/home/src/projects/c/4/unrelated/somethingUnrelated.ts] Inode:: 149 export const a = 10; @@ -704,18 +704,18 @@ After running Immedidate callback:: count: 0 Build dependencies Before running Timeout callback:: count: 1 5: timerToUpdateChildWatches -//// [/home/src/projects/c/3/c-impl/c/lib/c.js] Inode:: 150 +//// [/home/src/projects/c/3/c-impl/c/lib/c.js] Inode:: 151 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.c = void 0; exports.c = 'test'; -//// [/home/src/projects/c/3/c-impl/c/lib/c.d.ts] Inode:: 151 +//// [/home/src/projects/c/3/c-impl/c/lib/c.d.ts] Inode:: 152 export declare const c: string; -//// [/home/src/projects/c/3/c-impl/c/lib/index.js] Inode:: 152 +//// [/home/src/projects/c/3/c-impl/c/lib/index.js] Inode:: 153 "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; @@ -735,14 +735,14 @@ Object.defineProperty(exports, "__esModule", { value: true }); __exportStar(require("./c"), exports); -//// [/home/src/projects/c/3/c-impl/c/lib/index.d.ts] Inode:: 153 +//// [/home/src/projects/c/3/c-impl/c/lib/index.d.ts] Inode:: 154 export * from './c'; -//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo] Inode:: 154 +//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo] Inode:: 155 {"root":["../src/c.ts","../src/index.ts"],"version":"FakeTSVersion"} -//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 155 +//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 156 { "root": [ "../src/c.ts", @@ -752,18 +752,18 @@ export * from './c'; "size": 68 } -//// [/home/src/projects/a/1/a-impl/a/lib/a.js] Inode:: 157 +//// [/home/src/projects/a/1/a-impl/a/lib/a.js] Inode:: 158 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.a = void 0; exports.a = 'test'; -//// [/home/src/projects/a/1/a-impl/a/lib/a.d.ts] Inode:: 158 +//// [/home/src/projects/a/1/a-impl/a/lib/a.d.ts] Inode:: 159 export declare const a: string; -//// [/home/src/projects/a/1/a-impl/a/lib/index.js] Inode:: 159 +//// [/home/src/projects/a/1/a-impl/a/lib/index.js] Inode:: 160 "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; @@ -784,15 +784,15 @@ __exportStar(require("./a"), exports); __exportStar(require("c"), exports); -//// [/home/src/projects/a/1/a-impl/a/lib/index.d.ts] Inode:: 160 +//// [/home/src/projects/a/1/a-impl/a/lib/index.d.ts] Inode:: 161 export * from './a'; export * from 'c'; -//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo] Inode:: 161 +//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo] Inode:: 162 {"root":["../src/a.ts","../src/index.ts"],"version":"FakeTSVersion"} -//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 162 +//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 163 { "root": [ "../src/a.ts", @@ -840,7 +840,7 @@ FsWatches:: /home/src/projects/a/1/a-impl/a: {"inode":19} /home/src/projects/a/1/a-impl/a/lib: *new* - {"inode":156} + {"inode":157} /home/src/projects/a/1/a-impl/a/node_modules: {"inode":25} /home/src/projects/a/1/a-impl/a/package.json: @@ -1001,11 +1001,11 @@ FsWatches:: /home/src/projects: {"inode":3} /home/src/projects/a/1/a-impl/a/lib: - {"inode":156} + {"inode":157} /home/src/projects/a/1/a-impl/a/lib/a.d.ts: *new* - {"inode":158} + {"inode":159} /home/src/projects/a/1/a-impl/a/lib/index.d.ts: *new* - {"inode":160} + {"inode":161} /home/src/projects/a/1/a-impl/a/node_modules: {"inode":25} /home/src/projects/a/1/a-impl/a/package.json: @@ -1025,11 +1025,11 @@ FsWatches:: /home/src/projects/b/2/b-impl/b/tsconfig.json: {"inode":36} /home/src/projects/c/3/c-impl/c/lib: *new* - {"inode":149} + {"inode":150} /home/src/projects/c/3/c-impl/c/lib/c.d.ts: *new* - {"inode":151} + {"inode":152} /home/src/projects/c/3/c-impl/c/lib/index.d.ts: *new* - {"inode":153} + {"inode":154} /home/src/projects/c/3/c-impl/c/package.json: *new* {"inode":12} /home/src/tslibs/TS/Lib/lib.d.ts: @@ -1182,7 +1182,7 @@ After running Immedidate callback:: count: 0 change in unrelated folder in a Before running Timeout callback:: count: 0 -//// [/home/src/projects/a/2/unrelated/anotherFile.ts] Inode:: 163 +//// [/home/src/projects/a/2/unrelated/anotherFile.ts] Inode:: 164 export const a = 10; @@ -1298,7 +1298,7 @@ After running Immedidate callback:: count: 0 change in unrelated folder in c Before running Timeout callback:: count: 0 -//// [/home/src/projects/c/4/unrelated/anotherFile.ts] Inode:: 164 +//// [/home/src/projects/c/4/unrelated/anotherFile.ts] Inode:: 165 export const a = 10; @@ -1542,17 +1542,17 @@ FsWatches:: FsWatches *deleted*:: /home/src/projects/a/1/a-impl/a/lib: - {"inode":156} + {"inode":157} /home/src/projects/a/1/a-impl/a/lib/a.d.ts: - {"inode":158} + {"inode":159} /home/src/projects/a/1/a-impl/a/lib/index.d.ts: - {"inode":160} + {"inode":161} /home/src/projects/c/3/c-impl/c/lib: - {"inode":149} + {"inode":150} /home/src/projects/c/3/c-impl/c/lib/c.d.ts: - {"inode":151} + {"inode":152} /home/src/projects/c/3/c-impl/c/lib/index.d.ts: - {"inode":153} + {"inode":154} Timeout callback:: count: 3 28: /home/src/projects/b/2/b-impl/b/tsconfig.json *new* @@ -1888,18 +1888,18 @@ Info seq [hh:mm:ss:mss] FileWatcher:: Triggered with /home/src/projects/a/1/a-i Info seq [hh:mm:ss:mss] Elapsed:: *ms FileWatcher:: Triggered with /home/src/projects/a/1/a-impl/a/lib/index.d.ts 0:: WatchInfo: /home/src/projects/a/1/a-impl/a/lib/index.d.ts 500 undefined WatchType: Closed Script info Before running Timeout callback:: count: 1 37: timerToUpdateChildWatches -//// [/home/src/projects/c/3/c-impl/c/lib/c.js] Inode:: 166 +//// [/home/src/projects/c/3/c-impl/c/lib/c.js] Inode:: 167 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.c = void 0; exports.c = 'test'; -//// [/home/src/projects/c/3/c-impl/c/lib/c.d.ts] Inode:: 167 +//// [/home/src/projects/c/3/c-impl/c/lib/c.d.ts] Inode:: 168 export declare const c: string; -//// [/home/src/projects/c/3/c-impl/c/lib/index.js] Inode:: 168 +//// [/home/src/projects/c/3/c-impl/c/lib/index.js] Inode:: 169 "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; @@ -1919,14 +1919,14 @@ Object.defineProperty(exports, "__esModule", { value: true }); __exportStar(require("./c"), exports); -//// [/home/src/projects/c/3/c-impl/c/lib/index.d.ts] Inode:: 169 +//// [/home/src/projects/c/3/c-impl/c/lib/index.d.ts] Inode:: 170 export * from './c'; -//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo] Inode:: 170 +//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo] Inode:: 171 {"root":["../src/c.ts","../src/index.ts"],"version":"FakeTSVersion"} -//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 171 +//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 172 { "root": [ "../src/c.ts", @@ -1936,18 +1936,18 @@ export * from './c'; "size": 68 } -//// [/home/src/projects/a/1/a-impl/a/lib/a.js] Inode:: 173 +//// [/home/src/projects/a/1/a-impl/a/lib/a.js] Inode:: 174 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.a = void 0; exports.a = 'test'; -//// [/home/src/projects/a/1/a-impl/a/lib/a.d.ts] Inode:: 174 +//// [/home/src/projects/a/1/a-impl/a/lib/a.d.ts] Inode:: 175 export declare const a: string; -//// [/home/src/projects/a/1/a-impl/a/lib/index.js] Inode:: 175 +//// [/home/src/projects/a/1/a-impl/a/lib/index.js] Inode:: 176 "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; @@ -1968,15 +1968,15 @@ __exportStar(require("./a"), exports); __exportStar(require("c"), exports); -//// [/home/src/projects/a/1/a-impl/a/lib/index.d.ts] Inode:: 176 +//// [/home/src/projects/a/1/a-impl/a/lib/index.d.ts] Inode:: 177 export * from './a'; export * from 'c'; -//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo] Inode:: 177 +//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo] Inode:: 178 {"root":["../src/a.ts","../src/index.ts"],"version":"FakeTSVersion"} -//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 178 +//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 179 { "root": [ "../src/a.ts", @@ -2023,9 +2023,9 @@ FsWatches:: /home/src/projects/a/1/a-impl/a: {"inode":19} /home/src/projects/a/1/a-impl/a/lib/a.d.ts: *new* - {"inode":174} + {"inode":175} /home/src/projects/a/1/a-impl/a/lib/index.d.ts: *new* - {"inode":176} + {"inode":177} /home/src/projects/a/1/a-impl/a/node_modules: {"inode":25} /home/src/projects/a/1/a-impl/a/package.json: @@ -2049,9 +2049,9 @@ FsWatches:: /home/src/projects/b/2/b-impl/b/tsconfig.json: {"inode":36} /home/src/projects/c/3/c-impl/c/lib/c.d.ts: *new* - {"inode":167} + {"inode":168} /home/src/projects/c/3/c-impl/c/lib/index.d.ts: *new* - {"inode":169} + {"inode":170} /home/src/tslibs/TS/Lib/lib.d.ts: {"inode":45} @@ -2122,11 +2122,11 @@ FsWatches:: /home/src/projects/a/1/a-impl/a: {"inode":19} /home/src/projects/a/1/a-impl/a/lib: *new* - {"inode":172} + {"inode":173} /home/src/projects/a/1/a-impl/a/lib/a.d.ts: - {"inode":174} + {"inode":175} /home/src/projects/a/1/a-impl/a/lib/index.d.ts: - {"inode":176} + {"inode":177} /home/src/projects/a/1/a-impl/a/node_modules: {"inode":25} /home/src/projects/a/1/a-impl/a/package.json: @@ -2150,9 +2150,9 @@ FsWatches:: /home/src/projects/b/2/b-impl/b/tsconfig.json: {"inode":36} /home/src/projects/c/3/c-impl/c/lib/c.d.ts: - {"inode":167} + {"inode":168} /home/src/projects/c/3/c-impl/c/lib/index.d.ts: - {"inode":169} + {"inode":170} /home/src/tslibs/TS/Lib/lib.d.ts: {"inode":45} @@ -2286,11 +2286,11 @@ FsWatches:: /home/src/projects: {"inode":3} /home/src/projects/a/1/a-impl/a/lib: - {"inode":172} + {"inode":173} /home/src/projects/a/1/a-impl/a/lib/a.d.ts: - {"inode":174} + {"inode":175} /home/src/projects/a/1/a-impl/a/lib/index.d.ts: - {"inode":176} + {"inode":177} /home/src/projects/a/1/a-impl/a/node_modules: {"inode":25} /home/src/projects/a/1/a-impl/a/package.json: @@ -2310,11 +2310,11 @@ FsWatches:: /home/src/projects/b/2/b-impl/b/tsconfig.json: {"inode":36} /home/src/projects/c/3/c-impl/c/lib: *new* - {"inode":165} + {"inode":166} /home/src/projects/c/3/c-impl/c/lib/c.d.ts: - {"inode":167} + {"inode":168} /home/src/projects/c/3/c-impl/c/lib/index.d.ts: - {"inode":169} + {"inode":170} /home/src/projects/c/3/c-impl/c/package.json: *new* {"inode":12} /home/src/tslibs/TS/Lib/lib.d.ts: diff --git a/tests/baselines/reference/tsserver/symLinks/packages-outside-project-folder-MacOs-canUseWatchEvents.js b/tests/baselines/reference/tsserver/symLinks/packages-outside-project-folder-MacOs-canUseWatchEvents.js index cb6f35a4b0a73..4360d79aeef56 100644 --- a/tests/baselines/reference/tsserver/symLinks/packages-outside-project-folder-MacOs-canUseWatchEvents.js +++ b/tests/baselines/reference/tsserver/symLinks/packages-outside-project-folder-MacOs-canUseWatchEvents.js @@ -688,7 +688,7 @@ After running Immedidate callback:: count: 0 change in unrelated folder in a Before running Timeout callback:: count: 0 -//// [/home/src/projects/a/2/unrelated/somethingUnrelated.ts] Inode:: 147 +//// [/home/src/projects/a/2/unrelated/somethingUnrelated.ts] Inode:: 148 export const a = 10; @@ -818,7 +818,7 @@ After running Immedidate callback:: count: 0 change in unrelated folder in c Before running Timeout callback:: count: 0 -//// [/home/src/projects/c/4/unrelated/somethingUnrelated.ts] Inode:: 148 +//// [/home/src/projects/c/4/unrelated/somethingUnrelated.ts] Inode:: 149 export const a = 10; @@ -955,18 +955,18 @@ Custom watchDirectory:: Triggered Ignored:: {"id":9,"path":"/home/src/projects/b Custom watchDirectory:: Triggered Ignored:: {"id":9,"path":"/home/src/projects/b/2/b-impl/b/node_modules/a","recursive":true,"ignoreUpdate":true}:: /home/src/projects/b/2/b-impl/b/node_modules/a/lib/tsconfig.tsbuildinfo created Custom watchDirectory:: Triggered Ignored:: {"id":9,"path":"/home/src/projects/b/2/b-impl/b/node_modules/a","recursive":true,"ignoreUpdate":true}:: /home/src/projects/b/2/b-impl/b/node_modules/a/lib/tsconfig.tsbuildinfo.readable.baseline.txt created Before request -//// [/home/src/projects/c/3/c-impl/c/lib/c.js] Inode:: 150 +//// [/home/src/projects/c/3/c-impl/c/lib/c.js] Inode:: 151 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.c = void 0; exports.c = 'test'; -//// [/home/src/projects/c/3/c-impl/c/lib/c.d.ts] Inode:: 151 +//// [/home/src/projects/c/3/c-impl/c/lib/c.d.ts] Inode:: 152 export declare const c: string; -//// [/home/src/projects/c/3/c-impl/c/lib/index.js] Inode:: 152 +//// [/home/src/projects/c/3/c-impl/c/lib/index.js] Inode:: 153 "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; @@ -986,14 +986,14 @@ Object.defineProperty(exports, "__esModule", { value: true }); __exportStar(require("./c"), exports); -//// [/home/src/projects/c/3/c-impl/c/lib/index.d.ts] Inode:: 153 +//// [/home/src/projects/c/3/c-impl/c/lib/index.d.ts] Inode:: 154 export * from './c'; -//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo] Inode:: 154 +//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo] Inode:: 155 {"root":["../src/c.ts","../src/index.ts"],"version":"FakeTSVersion"} -//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 155 +//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 156 { "root": [ "../src/c.ts", @@ -1003,18 +1003,18 @@ export * from './c'; "size": 68 } -//// [/home/src/projects/a/1/a-impl/a/lib/a.js] Inode:: 157 +//// [/home/src/projects/a/1/a-impl/a/lib/a.js] Inode:: 158 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.a = void 0; exports.a = 'test'; -//// [/home/src/projects/a/1/a-impl/a/lib/a.d.ts] Inode:: 158 +//// [/home/src/projects/a/1/a-impl/a/lib/a.d.ts] Inode:: 159 export declare const a: string; -//// [/home/src/projects/a/1/a-impl/a/lib/index.js] Inode:: 159 +//// [/home/src/projects/a/1/a-impl/a/lib/index.js] Inode:: 160 "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; @@ -1035,15 +1035,15 @@ __exportStar(require("./a"), exports); __exportStar(require("c"), exports); -//// [/home/src/projects/a/1/a-impl/a/lib/index.d.ts] Inode:: 160 +//// [/home/src/projects/a/1/a-impl/a/lib/index.d.ts] Inode:: 161 export * from './a'; export * from 'c'; -//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo] Inode:: 161 +//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo] Inode:: 162 {"root":["../src/a.ts","../src/index.ts"],"version":"FakeTSVersion"} -//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 162 +//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 163 { "root": [ "../src/a.ts", @@ -1566,7 +1566,7 @@ After running Immedidate callback:: count: 0 change in unrelated folder in a Before running Timeout callback:: count: 0 -//// [/home/src/projects/a/2/unrelated/anotherFile.ts] Inode:: 163 +//// [/home/src/projects/a/2/unrelated/anotherFile.ts] Inode:: 164 export const a = 10; @@ -1682,7 +1682,7 @@ After running Immedidate callback:: count: 0 change in unrelated folder in c Before running Timeout callback:: count: 0 -//// [/home/src/projects/c/4/unrelated/anotherFile.ts] Inode:: 164 +//// [/home/src/projects/c/4/unrelated/anotherFile.ts] Inode:: 165 export const a = 10; @@ -2377,18 +2377,18 @@ Custom watchDirectory:: Triggered Ignored:: {"id":30,"path":"/home/src/projects/ Custom watchDirectory:: Triggered Ignored:: {"id":30,"path":"/home/src/projects/b/2/b-impl/b/node_modules/a","recursive":true,"ignoreUpdate":true}:: /home/src/projects/b/2/b-impl/b/node_modules/a/lib/tsconfig.tsbuildinfo created Custom watchDirectory:: Triggered Ignored:: {"id":30,"path":"/home/src/projects/b/2/b-impl/b/node_modules/a","recursive":true,"ignoreUpdate":true}:: /home/src/projects/b/2/b-impl/b/node_modules/a/lib/tsconfig.tsbuildinfo.readable.baseline.txt created Before request -//// [/home/src/projects/c/3/c-impl/c/lib/c.js] Inode:: 166 +//// [/home/src/projects/c/3/c-impl/c/lib/c.js] Inode:: 167 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.c = void 0; exports.c = 'test'; -//// [/home/src/projects/c/3/c-impl/c/lib/c.d.ts] Inode:: 167 +//// [/home/src/projects/c/3/c-impl/c/lib/c.d.ts] Inode:: 168 export declare const c: string; -//// [/home/src/projects/c/3/c-impl/c/lib/index.js] Inode:: 168 +//// [/home/src/projects/c/3/c-impl/c/lib/index.js] Inode:: 169 "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; @@ -2408,14 +2408,14 @@ Object.defineProperty(exports, "__esModule", { value: true }); __exportStar(require("./c"), exports); -//// [/home/src/projects/c/3/c-impl/c/lib/index.d.ts] Inode:: 169 +//// [/home/src/projects/c/3/c-impl/c/lib/index.d.ts] Inode:: 170 export * from './c'; -//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo] Inode:: 170 +//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo] Inode:: 171 {"root":["../src/c.ts","../src/index.ts"],"version":"FakeTSVersion"} -//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 171 +//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 172 { "root": [ "../src/c.ts", @@ -2425,18 +2425,18 @@ export * from './c'; "size": 68 } -//// [/home/src/projects/a/1/a-impl/a/lib/a.js] Inode:: 173 +//// [/home/src/projects/a/1/a-impl/a/lib/a.js] Inode:: 174 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.a = void 0; exports.a = 'test'; -//// [/home/src/projects/a/1/a-impl/a/lib/a.d.ts] Inode:: 174 +//// [/home/src/projects/a/1/a-impl/a/lib/a.d.ts] Inode:: 175 export declare const a: string; -//// [/home/src/projects/a/1/a-impl/a/lib/index.js] Inode:: 175 +//// [/home/src/projects/a/1/a-impl/a/lib/index.js] Inode:: 176 "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; @@ -2457,15 +2457,15 @@ __exportStar(require("./a"), exports); __exportStar(require("c"), exports); -//// [/home/src/projects/a/1/a-impl/a/lib/index.d.ts] Inode:: 176 +//// [/home/src/projects/a/1/a-impl/a/lib/index.d.ts] Inode:: 177 export * from './a'; export * from 'c'; -//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo] Inode:: 177 +//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo] Inode:: 178 {"root":["../src/a.ts","../src/index.ts"],"version":"FakeTSVersion"} -//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 178 +//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 179 { "root": [ "../src/a.ts", diff --git a/tests/baselines/reference/tsserver/symLinks/packages-outside-project-folder-MacOs.js b/tests/baselines/reference/tsserver/symLinks/packages-outside-project-folder-MacOs.js index aed62e132d867..d173e17c7b0fe 100644 --- a/tests/baselines/reference/tsserver/symLinks/packages-outside-project-folder-MacOs.js +++ b/tests/baselines/reference/tsserver/symLinks/packages-outside-project-folder-MacOs.js @@ -439,7 +439,7 @@ After running Immedidate callback:: count: 0 change in unrelated folder in a Before running Timeout callback:: count: 0 -//// [/home/src/projects/a/2/unrelated/somethingUnrelated.ts] Inode:: 147 +//// [/home/src/projects/a/2/unrelated/somethingUnrelated.ts] Inode:: 148 export const a = 10; @@ -569,7 +569,7 @@ After running Immedidate callback:: count: 0 change in unrelated folder in c Before running Timeout callback:: count: 0 -//// [/home/src/projects/c/4/unrelated/somethingUnrelated.ts] Inode:: 148 +//// [/home/src/projects/c/4/unrelated/somethingUnrelated.ts] Inode:: 149 export const a = 10; @@ -721,18 +721,18 @@ Info seq [hh:mm:ss:mss] Scheduled: /home/src/projects/b/2/b-impl/b/tsconfig.jso Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Triggered with /home/src/projects/b/2/b-impl/b/node_modules/a/lib/tsconfig.tsbuildinfo.readable.baseline.txt :: WatchInfo: /home/src/projects/b/2/b-impl/b/node_modules/a 1 undefined Project: /home/src/projects/b/2/b-impl/b/tsconfig.json WatchType: Failed Lookup Locations Before running Timeout callback:: count: 1 10: /home/src/projects/b/2/b-impl/b/tsconfig.jsonFailedLookupInvalidation -//// [/home/src/projects/c/3/c-impl/c/lib/c.js] Inode:: 150 +//// [/home/src/projects/c/3/c-impl/c/lib/c.js] Inode:: 151 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.c = void 0; exports.c = 'test'; -//// [/home/src/projects/c/3/c-impl/c/lib/c.d.ts] Inode:: 151 +//// [/home/src/projects/c/3/c-impl/c/lib/c.d.ts] Inode:: 152 export declare const c: string; -//// [/home/src/projects/c/3/c-impl/c/lib/index.js] Inode:: 152 +//// [/home/src/projects/c/3/c-impl/c/lib/index.js] Inode:: 153 "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; @@ -752,14 +752,14 @@ Object.defineProperty(exports, "__esModule", { value: true }); __exportStar(require("./c"), exports); -//// [/home/src/projects/c/3/c-impl/c/lib/index.d.ts] Inode:: 153 +//// [/home/src/projects/c/3/c-impl/c/lib/index.d.ts] Inode:: 154 export * from './c'; -//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo] Inode:: 154 +//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo] Inode:: 155 {"root":["../src/c.ts","../src/index.ts"],"version":"FakeTSVersion"} -//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 155 +//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 156 { "root": [ "../src/c.ts", @@ -769,18 +769,18 @@ export * from './c'; "size": 68 } -//// [/home/src/projects/a/1/a-impl/a/lib/a.js] Inode:: 157 +//// [/home/src/projects/a/1/a-impl/a/lib/a.js] Inode:: 158 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.a = void 0; exports.a = 'test'; -//// [/home/src/projects/a/1/a-impl/a/lib/a.d.ts] Inode:: 158 +//// [/home/src/projects/a/1/a-impl/a/lib/a.d.ts] Inode:: 159 export declare const a: string; -//// [/home/src/projects/a/1/a-impl/a/lib/index.js] Inode:: 159 +//// [/home/src/projects/a/1/a-impl/a/lib/index.js] Inode:: 160 "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; @@ -801,15 +801,15 @@ __exportStar(require("./a"), exports); __exportStar(require("c"), exports); -//// [/home/src/projects/a/1/a-impl/a/lib/index.d.ts] Inode:: 160 +//// [/home/src/projects/a/1/a-impl/a/lib/index.d.ts] Inode:: 161 export * from './a'; export * from 'c'; -//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo] Inode:: 161 +//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo] Inode:: 162 {"root":["../src/a.ts","../src/index.ts"],"version":"FakeTSVersion"} -//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 162 +//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 163 { "root": [ "../src/a.ts", @@ -952,9 +952,9 @@ FsWatches:: /home/src/projects: {"inode":3} /home/src/projects/a/1/a-impl/a/lib/a.d.ts: *new* - {"inode":158} + {"inode":159} /home/src/projects/a/1/a-impl/a/lib/index.d.ts: *new* - {"inode":160} + {"inode":161} /home/src/projects/a/1/a-impl/a/package.json: {"inode":24} /home/src/projects/b: @@ -968,9 +968,9 @@ FsWatches:: /home/src/projects/b/2/b-impl/b/tsconfig.json: {"inode":36} /home/src/projects/c/3/c-impl/c/lib/c.d.ts: *new* - {"inode":151} + {"inode":152} /home/src/projects/c/3/c-impl/c/lib/index.d.ts: *new* - {"inode":153} + {"inode":154} /home/src/projects/c/3/c-impl/c/package.json: *new* {"inode":12} /home/src/tslibs/TS/Lib/lib.d.ts: @@ -1139,7 +1139,7 @@ Info seq [hh:mm:ss:mss] Scheduled: /home/src/projects/b/2/b-impl/b/tsconfig.jso Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Triggered with /home/src/projects/a/2/unrelated/anotherFile.ts :: WatchInfo: /home/src/projects/a 1 undefined Project: /home/src/projects/b/2/b-impl/b/tsconfig.json WatchType: Failed Lookup Locations Before running Timeout callback:: count: 1 14: /home/src/projects/b/2/b-impl/b/tsconfig.jsonFailedLookupInvalidation -//// [/home/src/projects/a/2/unrelated/anotherFile.ts] Inode:: 163 +//// [/home/src/projects/a/2/unrelated/anotherFile.ts] Inode:: 164 export const a = 10; @@ -1263,7 +1263,7 @@ Info seq [hh:mm:ss:mss] Scheduled: /home/src/projects/b/2/b-impl/b/tsconfig.jso Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Triggered with /home/src/projects/c/4/unrelated/anotherFile.ts :: WatchInfo: /home/src/projects/c 1 undefined Project: /home/src/projects/b/2/b-impl/b/tsconfig.json WatchType: Failed Lookup Locations Before running Timeout callback:: count: 1 16: /home/src/projects/b/2/b-impl/b/tsconfig.jsonFailedLookupInvalidation -//// [/home/src/projects/c/4/unrelated/anotherFile.ts] Inode:: 164 +//// [/home/src/projects/c/4/unrelated/anotherFile.ts] Inode:: 165 export const a = 10; @@ -1501,13 +1501,13 @@ FsWatches:: FsWatches *deleted*:: /home/src/projects/a/1/a-impl/a/lib/a.d.ts: - {"inode":158} + {"inode":159} /home/src/projects/a/1/a-impl/a/lib/index.d.ts: - {"inode":160} + {"inode":161} /home/src/projects/c/3/c-impl/c/lib/c.d.ts: - {"inode":151} + {"inode":152} /home/src/projects/c/3/c-impl/c/lib/index.d.ts: - {"inode":153} + {"inode":154} FsWatchesRecursive:: /home/src/projects/a: @@ -1876,18 +1876,18 @@ Info seq [hh:mm:ss:mss] Scheduled: /home/src/projects/b/2/b-impl/b/tsconfig.jso Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Triggered with /home/src/projects/b/2/b-impl/b/node_modules/a/lib/tsconfig.tsbuildinfo.readable.baseline.txt :: WatchInfo: /home/src/projects/b/2/b-impl/b/node_modules/a 1 undefined Project: /home/src/projects/b/2/b-impl/b/tsconfig.json WatchType: Failed Lookup Locations Before running Timeout callback:: count: 1 47: /home/src/projects/b/2/b-impl/b/tsconfig.jsonFailedLookupInvalidation -//// [/home/src/projects/c/3/c-impl/c/lib/c.js] Inode:: 166 +//// [/home/src/projects/c/3/c-impl/c/lib/c.js] Inode:: 167 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.c = void 0; exports.c = 'test'; -//// [/home/src/projects/c/3/c-impl/c/lib/c.d.ts] Inode:: 167 +//// [/home/src/projects/c/3/c-impl/c/lib/c.d.ts] Inode:: 168 export declare const c: string; -//// [/home/src/projects/c/3/c-impl/c/lib/index.js] Inode:: 168 +//// [/home/src/projects/c/3/c-impl/c/lib/index.js] Inode:: 169 "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; @@ -1907,14 +1907,14 @@ Object.defineProperty(exports, "__esModule", { value: true }); __exportStar(require("./c"), exports); -//// [/home/src/projects/c/3/c-impl/c/lib/index.d.ts] Inode:: 169 +//// [/home/src/projects/c/3/c-impl/c/lib/index.d.ts] Inode:: 170 export * from './c'; -//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo] Inode:: 170 +//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo] Inode:: 171 {"root":["../src/c.ts","../src/index.ts"],"version":"FakeTSVersion"} -//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 171 +//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 172 { "root": [ "../src/c.ts", @@ -1924,18 +1924,18 @@ export * from './c'; "size": 68 } -//// [/home/src/projects/a/1/a-impl/a/lib/a.js] Inode:: 173 +//// [/home/src/projects/a/1/a-impl/a/lib/a.js] Inode:: 174 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.a = void 0; exports.a = 'test'; -//// [/home/src/projects/a/1/a-impl/a/lib/a.d.ts] Inode:: 174 +//// [/home/src/projects/a/1/a-impl/a/lib/a.d.ts] Inode:: 175 export declare const a: string; -//// [/home/src/projects/a/1/a-impl/a/lib/index.js] Inode:: 175 +//// [/home/src/projects/a/1/a-impl/a/lib/index.js] Inode:: 176 "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; @@ -1956,15 +1956,15 @@ __exportStar(require("./a"), exports); __exportStar(require("c"), exports); -//// [/home/src/projects/a/1/a-impl/a/lib/index.d.ts] Inode:: 176 +//// [/home/src/projects/a/1/a-impl/a/lib/index.d.ts] Inode:: 177 export * from './a'; export * from 'c'; -//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo] Inode:: 177 +//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo] Inode:: 178 {"root":["../src/a.ts","../src/index.ts"],"version":"FakeTSVersion"} -//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 178 +//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 179 { "root": [ "../src/a.ts", @@ -2009,9 +2009,9 @@ FsWatches:: /home/src/projects: {"inode":3} /home/src/projects/a/1/a-impl/a/lib/a.d.ts: *new* - {"inode":174} + {"inode":175} /home/src/projects/a/1/a-impl/a/lib/index.d.ts: *new* - {"inode":176} + {"inode":177} /home/src/projects/a/1/a-impl/a/package.json: {"inode":24} /home/src/projects/b: @@ -2025,9 +2025,9 @@ FsWatches:: /home/src/projects/b/2/b-impl/b/tsconfig.json: {"inode":36} /home/src/projects/c/3/c-impl/c/lib/c.d.ts: *new* - {"inode":167} + {"inode":168} /home/src/projects/c/3/c-impl/c/lib/index.d.ts: *new* - {"inode":169} + {"inode":170} /home/src/tslibs/TS/Lib/lib.d.ts: {"inode":45} @@ -2196,9 +2196,9 @@ FsWatches:: /home/src/projects: {"inode":3} /home/src/projects/a/1/a-impl/a/lib/a.d.ts: - {"inode":174} + {"inode":175} /home/src/projects/a/1/a-impl/a/lib/index.d.ts: - {"inode":176} + {"inode":177} /home/src/projects/a/1/a-impl/a/package.json: {"inode":24} /home/src/projects/b: @@ -2212,9 +2212,9 @@ FsWatches:: /home/src/projects/b/2/b-impl/b/tsconfig.json: {"inode":36} /home/src/projects/c/3/c-impl/c/lib/c.d.ts: - {"inode":167} + {"inode":168} /home/src/projects/c/3/c-impl/c/lib/index.d.ts: - {"inode":169} + {"inode":170} /home/src/projects/c/3/c-impl/c/package.json: *new* {"inode":12} /home/src/tslibs/TS/Lib/lib.d.ts: diff --git a/tests/baselines/reference/tsserver/symLinks/packages-outside-project-folder-built-Linux-canUseWatchEvents.js b/tests/baselines/reference/tsserver/symLinks/packages-outside-project-folder-built-Linux-canUseWatchEvents.js index 78de0838b7d59..820afdda5ccc0 100644 --- a/tests/baselines/reference/tsserver/symLinks/packages-outside-project-folder-built-Linux-canUseWatchEvents.js +++ b/tests/baselines/reference/tsserver/symLinks/packages-outside-project-folder-built-Linux-canUseWatchEvents.js @@ -90,18 +90,18 @@ interface Array { length: number; [n: number]: T; } interface ReadonlyArray {} declare const console: { log(msg: any): void; }; -//// [/home/src/projects/c/3/c-impl/c/lib/c.js] Inode:: 148 +//// [/home/src/projects/c/3/c-impl/c/lib/c.js] Inode:: 149 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.c = void 0; exports.c = 'test'; -//// [/home/src/projects/c/3/c-impl/c/lib/c.d.ts] Inode:: 149 +//// [/home/src/projects/c/3/c-impl/c/lib/c.d.ts] Inode:: 150 export declare const c: string; -//// [/home/src/projects/c/3/c-impl/c/lib/index.js] Inode:: 150 +//// [/home/src/projects/c/3/c-impl/c/lib/index.js] Inode:: 151 "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; @@ -121,14 +121,14 @@ Object.defineProperty(exports, "__esModule", { value: true }); __exportStar(require("./c"), exports); -//// [/home/src/projects/c/3/c-impl/c/lib/index.d.ts] Inode:: 151 +//// [/home/src/projects/c/3/c-impl/c/lib/index.d.ts] Inode:: 152 export * from './c'; -//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo] Inode:: 152 +//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo] Inode:: 153 {"root":["../src/c.ts","../src/index.ts"],"version":"FakeTSVersion"} -//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 153 +//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 154 { "root": [ "../src/c.ts", @@ -138,18 +138,18 @@ export * from './c'; "size": 68 } -//// [/home/src/projects/a/1/a-impl/a/lib/a.js] Inode:: 155 +//// [/home/src/projects/a/1/a-impl/a/lib/a.js] Inode:: 156 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.a = void 0; exports.a = 'test'; -//// [/home/src/projects/a/1/a-impl/a/lib/a.d.ts] Inode:: 156 +//// [/home/src/projects/a/1/a-impl/a/lib/a.d.ts] Inode:: 157 export declare const a: string; -//// [/home/src/projects/a/1/a-impl/a/lib/index.js] Inode:: 157 +//// [/home/src/projects/a/1/a-impl/a/lib/index.js] Inode:: 158 "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; @@ -170,15 +170,15 @@ __exportStar(require("./a"), exports); __exportStar(require("c"), exports); -//// [/home/src/projects/a/1/a-impl/a/lib/index.d.ts] Inode:: 158 +//// [/home/src/projects/a/1/a-impl/a/lib/index.d.ts] Inode:: 159 export * from './a'; export * from 'c'; -//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo] Inode:: 159 +//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo] Inode:: 160 {"root":["../src/a.ts","../src/index.ts"],"version":"FakeTSVersion"} -//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 160 +//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 161 { "root": [ "../src/a.ts", @@ -855,7 +855,7 @@ After running Immedidate callback:: count: 0 change in unrelated folder in a Before running Timeout callback:: count: 0 -//// [/home/src/projects/a/2/unrelated/somethingUnrelated.ts] Inode:: 161 +//// [/home/src/projects/a/2/unrelated/somethingUnrelated.ts] Inode:: 162 export const a = 10; @@ -971,7 +971,7 @@ After running Immedidate callback:: count: 0 change in unrelated folder in c Before running Timeout callback:: count: 0 -//// [/home/src/projects/c/4/unrelated/somethingUnrelated.ts] Inode:: 162 +//// [/home/src/projects/c/4/unrelated/somethingUnrelated.ts] Inode:: 163 export const a = 10; @@ -1087,7 +1087,7 @@ After running Immedidate callback:: count: 0 change in unrelated folder in a Before running Timeout callback:: count: 0 -//// [/home/src/projects/a/2/unrelated/anotherFile.ts] Inode:: 163 +//// [/home/src/projects/a/2/unrelated/anotherFile.ts] Inode:: 164 export const a = 10; @@ -1203,7 +1203,7 @@ After running Immedidate callback:: count: 0 change in unrelated folder in c Before running Timeout callback:: count: 0 -//// [/home/src/projects/c/4/unrelated/anotherFile.ts] Inode:: 164 +//// [/home/src/projects/c/4/unrelated/anotherFile.ts] Inode:: 165 export const a = 10; @@ -1913,18 +1913,18 @@ Custom watchDirectory:: Triggered Ignored:: {"id":25,"path":"/home/src/projects/ Custom watchDirectory:: Triggered Ignored:: {"id":25,"path":"/home/src/projects/b/2/b-impl/b/node_modules/a","recursive":true,"ignoreUpdate":true}:: /home/src/projects/b/2/b-impl/b/node_modules/a/lib/tsconfig.tsbuildinfo.readable.baseline.txt updated Custom watchDirectory:: Triggered Ignored:: {"id":25,"path":"/home/src/projects/b/2/b-impl/b/node_modules/a","recursive":true,"ignoreUpdate":true}:: /home/src/projects/b/2/b-impl/b/node_modules/a/lib updated Before request -//// [/home/src/projects/c/3/c-impl/c/lib/c.js] Inode:: 166 +//// [/home/src/projects/c/3/c-impl/c/lib/c.js] Inode:: 167 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.c = void 0; exports.c = 'test'; -//// [/home/src/projects/c/3/c-impl/c/lib/c.d.ts] Inode:: 167 +//// [/home/src/projects/c/3/c-impl/c/lib/c.d.ts] Inode:: 168 export declare const c: string; -//// [/home/src/projects/c/3/c-impl/c/lib/index.js] Inode:: 168 +//// [/home/src/projects/c/3/c-impl/c/lib/index.js] Inode:: 169 "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; @@ -1944,14 +1944,14 @@ Object.defineProperty(exports, "__esModule", { value: true }); __exportStar(require("./c"), exports); -//// [/home/src/projects/c/3/c-impl/c/lib/index.d.ts] Inode:: 169 +//// [/home/src/projects/c/3/c-impl/c/lib/index.d.ts] Inode:: 170 export * from './c'; -//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo] Inode:: 170 +//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo] Inode:: 171 {"root":["../src/c.ts","../src/index.ts"],"version":"FakeTSVersion"} -//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 171 +//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 172 { "root": [ "../src/c.ts", @@ -1961,18 +1961,18 @@ export * from './c'; "size": 68 } -//// [/home/src/projects/a/1/a-impl/a/lib/a.js] Inode:: 173 +//// [/home/src/projects/a/1/a-impl/a/lib/a.js] Inode:: 174 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.a = void 0; exports.a = 'test'; -//// [/home/src/projects/a/1/a-impl/a/lib/a.d.ts] Inode:: 174 +//// [/home/src/projects/a/1/a-impl/a/lib/a.d.ts] Inode:: 175 export declare const a: string; -//// [/home/src/projects/a/1/a-impl/a/lib/index.js] Inode:: 175 +//// [/home/src/projects/a/1/a-impl/a/lib/index.js] Inode:: 176 "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; @@ -1993,15 +1993,15 @@ __exportStar(require("./a"), exports); __exportStar(require("c"), exports); -//// [/home/src/projects/a/1/a-impl/a/lib/index.d.ts] Inode:: 176 +//// [/home/src/projects/a/1/a-impl/a/lib/index.d.ts] Inode:: 177 export * from './a'; export * from 'c'; -//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo] Inode:: 177 +//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo] Inode:: 178 {"root":["../src/a.ts","../src/index.ts"],"version":"FakeTSVersion"} -//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 178 +//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 179 { "root": [ "../src/a.ts", diff --git a/tests/baselines/reference/tsserver/symLinks/packages-outside-project-folder-built-Linux.js b/tests/baselines/reference/tsserver/symLinks/packages-outside-project-folder-built-Linux.js index aa325373f99b2..a83d83c4f6505 100644 --- a/tests/baselines/reference/tsserver/symLinks/packages-outside-project-folder-built-Linux.js +++ b/tests/baselines/reference/tsserver/symLinks/packages-outside-project-folder-built-Linux.js @@ -90,18 +90,18 @@ interface Array { length: number; [n: number]: T; } interface ReadonlyArray {} declare const console: { log(msg: any): void; }; -//// [/home/src/projects/c/3/c-impl/c/lib/c.js] Inode:: 148 +//// [/home/src/projects/c/3/c-impl/c/lib/c.js] Inode:: 149 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.c = void 0; exports.c = 'test'; -//// [/home/src/projects/c/3/c-impl/c/lib/c.d.ts] Inode:: 149 +//// [/home/src/projects/c/3/c-impl/c/lib/c.d.ts] Inode:: 150 export declare const c: string; -//// [/home/src/projects/c/3/c-impl/c/lib/index.js] Inode:: 150 +//// [/home/src/projects/c/3/c-impl/c/lib/index.js] Inode:: 151 "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; @@ -121,14 +121,14 @@ Object.defineProperty(exports, "__esModule", { value: true }); __exportStar(require("./c"), exports); -//// [/home/src/projects/c/3/c-impl/c/lib/index.d.ts] Inode:: 151 +//// [/home/src/projects/c/3/c-impl/c/lib/index.d.ts] Inode:: 152 export * from './c'; -//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo] Inode:: 152 +//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo] Inode:: 153 {"root":["../src/c.ts","../src/index.ts"],"version":"FakeTSVersion"} -//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 153 +//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 154 { "root": [ "../src/c.ts", @@ -138,18 +138,18 @@ export * from './c'; "size": 68 } -//// [/home/src/projects/a/1/a-impl/a/lib/a.js] Inode:: 155 +//// [/home/src/projects/a/1/a-impl/a/lib/a.js] Inode:: 156 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.a = void 0; exports.a = 'test'; -//// [/home/src/projects/a/1/a-impl/a/lib/a.d.ts] Inode:: 156 +//// [/home/src/projects/a/1/a-impl/a/lib/a.d.ts] Inode:: 157 export declare const a: string; -//// [/home/src/projects/a/1/a-impl/a/lib/index.js] Inode:: 157 +//// [/home/src/projects/a/1/a-impl/a/lib/index.js] Inode:: 158 "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; @@ -170,15 +170,15 @@ __exportStar(require("./a"), exports); __exportStar(require("c"), exports); -//// [/home/src/projects/a/1/a-impl/a/lib/index.d.ts] Inode:: 158 +//// [/home/src/projects/a/1/a-impl/a/lib/index.d.ts] Inode:: 159 export * from './a'; export * from 'c'; -//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo] Inode:: 159 +//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo] Inode:: 160 {"root":["../src/a.ts","../src/index.ts"],"version":"FakeTSVersion"} -//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 160 +//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 161 { "root": [ "../src/a.ts", @@ -388,11 +388,11 @@ FsWatches:: /home/src/projects: *new* {"inode":3} /home/src/projects/a/1/a-impl/a/lib: *new* - {"inode":154} + {"inode":155} /home/src/projects/a/1/a-impl/a/lib/a.d.ts: *new* - {"inode":156} + {"inode":157} /home/src/projects/a/1/a-impl/a/lib/index.d.ts: *new* - {"inode":158} + {"inode":159} /home/src/projects/a/1/a-impl/a/node_modules: *new* {"inode":25} /home/src/projects/a/1/a-impl/a/package.json: *new* @@ -412,11 +412,11 @@ FsWatches:: /home/src/projects/b/2/b-impl/b/tsconfig.json: *new* {"inode":36} /home/src/projects/c/3/c-impl/c/lib: *new* - {"inode":147} + {"inode":148} /home/src/projects/c/3/c-impl/c/lib/c.d.ts: *new* - {"inode":149} + {"inode":150} /home/src/projects/c/3/c-impl/c/lib/index.d.ts: *new* - {"inode":151} + {"inode":152} /home/src/projects/c/3/c-impl/c/package.json: *new* {"inode":12} /home/src/tslibs/TS/Lib/lib.d.ts: *new* @@ -560,7 +560,7 @@ After running Immedidate callback:: count: 0 change in unrelated folder in a Before running Timeout callback:: count: 0 -//// [/home/src/projects/a/2/unrelated/somethingUnrelated.ts] Inode:: 161 +//// [/home/src/projects/a/2/unrelated/somethingUnrelated.ts] Inode:: 162 export const a = 10; @@ -676,7 +676,7 @@ After running Immedidate callback:: count: 0 change in unrelated folder in c Before running Timeout callback:: count: 0 -//// [/home/src/projects/c/4/unrelated/somethingUnrelated.ts] Inode:: 162 +//// [/home/src/projects/c/4/unrelated/somethingUnrelated.ts] Inode:: 163 export const a = 10; @@ -792,7 +792,7 @@ After running Immedidate callback:: count: 0 change in unrelated folder in a Before running Timeout callback:: count: 0 -//// [/home/src/projects/a/2/unrelated/anotherFile.ts] Inode:: 163 +//// [/home/src/projects/a/2/unrelated/anotherFile.ts] Inode:: 164 export const a = 10; @@ -908,7 +908,7 @@ After running Immedidate callback:: count: 0 change in unrelated folder in c Before running Timeout callback:: count: 0 -//// [/home/src/projects/c/4/unrelated/anotherFile.ts] Inode:: 164 +//// [/home/src/projects/c/4/unrelated/anotherFile.ts] Inode:: 165 export const a = 10; @@ -1152,17 +1152,17 @@ FsWatches:: FsWatches *deleted*:: /home/src/projects/a/1/a-impl/a/lib: - {"inode":154} + {"inode":155} /home/src/projects/a/1/a-impl/a/lib/a.d.ts: - {"inode":156} + {"inode":157} /home/src/projects/a/1/a-impl/a/lib/index.d.ts: - {"inode":158} + {"inode":159} /home/src/projects/c/3/c-impl/c/lib: - {"inode":147} + {"inode":148} /home/src/projects/c/3/c-impl/c/lib/c.d.ts: - {"inode":149} + {"inode":150} /home/src/projects/c/3/c-impl/c/lib/index.d.ts: - {"inode":151} + {"inode":152} Timeout callback:: count: 3 21: /home/src/projects/b/2/b-impl/b/tsconfig.json *new* @@ -1500,18 +1500,18 @@ Info seq [hh:mm:ss:mss] FileWatcher:: Triggered with /home/src/projects/a/1/a-i Info seq [hh:mm:ss:mss] Elapsed:: *ms FileWatcher:: Triggered with /home/src/projects/a/1/a-impl/a/lib/index.d.ts 0:: WatchInfo: /home/src/projects/a/1/a-impl/a/lib/index.d.ts 500 undefined WatchType: Closed Script info Before running Timeout callback:: count: 1 30: timerToUpdateChildWatches -//// [/home/src/projects/c/3/c-impl/c/lib/c.js] Inode:: 166 +//// [/home/src/projects/c/3/c-impl/c/lib/c.js] Inode:: 167 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.c = void 0; exports.c = 'test'; -//// [/home/src/projects/c/3/c-impl/c/lib/c.d.ts] Inode:: 167 +//// [/home/src/projects/c/3/c-impl/c/lib/c.d.ts] Inode:: 168 export declare const c: string; -//// [/home/src/projects/c/3/c-impl/c/lib/index.js] Inode:: 168 +//// [/home/src/projects/c/3/c-impl/c/lib/index.js] Inode:: 169 "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; @@ -1531,14 +1531,14 @@ Object.defineProperty(exports, "__esModule", { value: true }); __exportStar(require("./c"), exports); -//// [/home/src/projects/c/3/c-impl/c/lib/index.d.ts] Inode:: 169 +//// [/home/src/projects/c/3/c-impl/c/lib/index.d.ts] Inode:: 170 export * from './c'; -//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo] Inode:: 170 +//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo] Inode:: 171 {"root":["../src/c.ts","../src/index.ts"],"version":"FakeTSVersion"} -//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 171 +//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 172 { "root": [ "../src/c.ts", @@ -1548,18 +1548,18 @@ export * from './c'; "size": 68 } -//// [/home/src/projects/a/1/a-impl/a/lib/a.js] Inode:: 173 +//// [/home/src/projects/a/1/a-impl/a/lib/a.js] Inode:: 174 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.a = void 0; exports.a = 'test'; -//// [/home/src/projects/a/1/a-impl/a/lib/a.d.ts] Inode:: 174 +//// [/home/src/projects/a/1/a-impl/a/lib/a.d.ts] Inode:: 175 export declare const a: string; -//// [/home/src/projects/a/1/a-impl/a/lib/index.js] Inode:: 175 +//// [/home/src/projects/a/1/a-impl/a/lib/index.js] Inode:: 176 "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; @@ -1580,15 +1580,15 @@ __exportStar(require("./a"), exports); __exportStar(require("c"), exports); -//// [/home/src/projects/a/1/a-impl/a/lib/index.d.ts] Inode:: 176 +//// [/home/src/projects/a/1/a-impl/a/lib/index.d.ts] Inode:: 177 export * from './a'; export * from 'c'; -//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo] Inode:: 177 +//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo] Inode:: 178 {"root":["../src/a.ts","../src/index.ts"],"version":"FakeTSVersion"} -//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 178 +//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 179 { "root": [ "../src/a.ts", @@ -1635,9 +1635,9 @@ FsWatches:: /home/src/projects/a/1/a-impl/a: {"inode":19} /home/src/projects/a/1/a-impl/a/lib/a.d.ts: *new* - {"inode":174} + {"inode":175} /home/src/projects/a/1/a-impl/a/lib/index.d.ts: *new* - {"inode":176} + {"inode":177} /home/src/projects/a/1/a-impl/a/node_modules: {"inode":25} /home/src/projects/a/1/a-impl/a/package.json: @@ -1661,9 +1661,9 @@ FsWatches:: /home/src/projects/b/2/b-impl/b/tsconfig.json: {"inode":36} /home/src/projects/c/3/c-impl/c/lib/c.d.ts: *new* - {"inode":167} + {"inode":168} /home/src/projects/c/3/c-impl/c/lib/index.d.ts: *new* - {"inode":169} + {"inode":170} /home/src/tslibs/TS/Lib/lib.d.ts: {"inode":45} @@ -1734,11 +1734,11 @@ FsWatches:: /home/src/projects/a/1/a-impl/a: {"inode":19} /home/src/projects/a/1/a-impl/a/lib: *new* - {"inode":172} + {"inode":173} /home/src/projects/a/1/a-impl/a/lib/a.d.ts: - {"inode":174} + {"inode":175} /home/src/projects/a/1/a-impl/a/lib/index.d.ts: - {"inode":176} + {"inode":177} /home/src/projects/a/1/a-impl/a/node_modules: {"inode":25} /home/src/projects/a/1/a-impl/a/package.json: @@ -1762,9 +1762,9 @@ FsWatches:: /home/src/projects/b/2/b-impl/b/tsconfig.json: {"inode":36} /home/src/projects/c/3/c-impl/c/lib/c.d.ts: - {"inode":167} + {"inode":168} /home/src/projects/c/3/c-impl/c/lib/index.d.ts: - {"inode":169} + {"inode":170} /home/src/tslibs/TS/Lib/lib.d.ts: {"inode":45} @@ -1898,11 +1898,11 @@ FsWatches:: /home/src/projects: {"inode":3} /home/src/projects/a/1/a-impl/a/lib: - {"inode":172} + {"inode":173} /home/src/projects/a/1/a-impl/a/lib/a.d.ts: - {"inode":174} + {"inode":175} /home/src/projects/a/1/a-impl/a/lib/index.d.ts: - {"inode":176} + {"inode":177} /home/src/projects/a/1/a-impl/a/node_modules: {"inode":25} /home/src/projects/a/1/a-impl/a/package.json: @@ -1922,11 +1922,11 @@ FsWatches:: /home/src/projects/b/2/b-impl/b/tsconfig.json: {"inode":36} /home/src/projects/c/3/c-impl/c/lib: *new* - {"inode":165} + {"inode":166} /home/src/projects/c/3/c-impl/c/lib/c.d.ts: - {"inode":167} + {"inode":168} /home/src/projects/c/3/c-impl/c/lib/index.d.ts: - {"inode":169} + {"inode":170} /home/src/projects/c/3/c-impl/c/package.json: *new* {"inode":12} /home/src/tslibs/TS/Lib/lib.d.ts: diff --git a/tests/baselines/reference/tsserver/symLinks/packages-outside-project-folder-built-MacOs-canUseWatchEvents.js b/tests/baselines/reference/tsserver/symLinks/packages-outside-project-folder-built-MacOs-canUseWatchEvents.js index 0d9fc84516a5e..3fe7a821b4e47 100644 --- a/tests/baselines/reference/tsserver/symLinks/packages-outside-project-folder-built-MacOs-canUseWatchEvents.js +++ b/tests/baselines/reference/tsserver/symLinks/packages-outside-project-folder-built-MacOs-canUseWatchEvents.js @@ -90,18 +90,18 @@ interface Array { length: number; [n: number]: T; } interface ReadonlyArray {} declare const console: { log(msg: any): void; }; -//// [/home/src/projects/c/3/c-impl/c/lib/c.js] Inode:: 148 +//// [/home/src/projects/c/3/c-impl/c/lib/c.js] Inode:: 149 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.c = void 0; exports.c = 'test'; -//// [/home/src/projects/c/3/c-impl/c/lib/c.d.ts] Inode:: 149 +//// [/home/src/projects/c/3/c-impl/c/lib/c.d.ts] Inode:: 150 export declare const c: string; -//// [/home/src/projects/c/3/c-impl/c/lib/index.js] Inode:: 150 +//// [/home/src/projects/c/3/c-impl/c/lib/index.js] Inode:: 151 "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; @@ -121,14 +121,14 @@ Object.defineProperty(exports, "__esModule", { value: true }); __exportStar(require("./c"), exports); -//// [/home/src/projects/c/3/c-impl/c/lib/index.d.ts] Inode:: 151 +//// [/home/src/projects/c/3/c-impl/c/lib/index.d.ts] Inode:: 152 export * from './c'; -//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo] Inode:: 152 +//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo] Inode:: 153 {"root":["../src/c.ts","../src/index.ts"],"version":"FakeTSVersion"} -//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 153 +//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 154 { "root": [ "../src/c.ts", @@ -138,18 +138,18 @@ export * from './c'; "size": 68 } -//// [/home/src/projects/a/1/a-impl/a/lib/a.js] Inode:: 155 +//// [/home/src/projects/a/1/a-impl/a/lib/a.js] Inode:: 156 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.a = void 0; exports.a = 'test'; -//// [/home/src/projects/a/1/a-impl/a/lib/a.d.ts] Inode:: 156 +//// [/home/src/projects/a/1/a-impl/a/lib/a.d.ts] Inode:: 157 export declare const a: string; -//// [/home/src/projects/a/1/a-impl/a/lib/index.js] Inode:: 157 +//// [/home/src/projects/a/1/a-impl/a/lib/index.js] Inode:: 158 "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; @@ -170,15 +170,15 @@ __exportStar(require("./a"), exports); __exportStar(require("c"), exports); -//// [/home/src/projects/a/1/a-impl/a/lib/index.d.ts] Inode:: 158 +//// [/home/src/projects/a/1/a-impl/a/lib/index.d.ts] Inode:: 159 export * from './a'; export * from 'c'; -//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo] Inode:: 159 +//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo] Inode:: 160 {"root":["../src/a.ts","../src/index.ts"],"version":"FakeTSVersion"} -//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 160 +//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 161 { "root": [ "../src/a.ts", @@ -855,7 +855,7 @@ After running Immedidate callback:: count: 0 change in unrelated folder in a Before running Timeout callback:: count: 0 -//// [/home/src/projects/a/2/unrelated/somethingUnrelated.ts] Inode:: 161 +//// [/home/src/projects/a/2/unrelated/somethingUnrelated.ts] Inode:: 162 export const a = 10; @@ -971,7 +971,7 @@ After running Immedidate callback:: count: 0 change in unrelated folder in c Before running Timeout callback:: count: 0 -//// [/home/src/projects/c/4/unrelated/somethingUnrelated.ts] Inode:: 162 +//// [/home/src/projects/c/4/unrelated/somethingUnrelated.ts] Inode:: 163 export const a = 10; @@ -1087,7 +1087,7 @@ After running Immedidate callback:: count: 0 change in unrelated folder in a Before running Timeout callback:: count: 0 -//// [/home/src/projects/a/2/unrelated/anotherFile.ts] Inode:: 163 +//// [/home/src/projects/a/2/unrelated/anotherFile.ts] Inode:: 164 export const a = 10; @@ -1203,7 +1203,7 @@ After running Immedidate callback:: count: 0 change in unrelated folder in c Before running Timeout callback:: count: 0 -//// [/home/src/projects/c/4/unrelated/anotherFile.ts] Inode:: 164 +//// [/home/src/projects/c/4/unrelated/anotherFile.ts] Inode:: 165 export const a = 10; @@ -1900,18 +1900,18 @@ Custom watchDirectory:: Triggered Ignored:: {"id":25,"path":"/home/src/projects/ Custom watchDirectory:: Triggered Ignored:: {"id":25,"path":"/home/src/projects/b/2/b-impl/b/node_modules/a","recursive":true,"ignoreUpdate":true}:: /home/src/projects/b/2/b-impl/b/node_modules/a/lib/tsconfig.tsbuildinfo created Custom watchDirectory:: Triggered Ignored:: {"id":25,"path":"/home/src/projects/b/2/b-impl/b/node_modules/a","recursive":true,"ignoreUpdate":true}:: /home/src/projects/b/2/b-impl/b/node_modules/a/lib/tsconfig.tsbuildinfo.readable.baseline.txt created Before request -//// [/home/src/projects/c/3/c-impl/c/lib/c.js] Inode:: 166 +//// [/home/src/projects/c/3/c-impl/c/lib/c.js] Inode:: 167 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.c = void 0; exports.c = 'test'; -//// [/home/src/projects/c/3/c-impl/c/lib/c.d.ts] Inode:: 167 +//// [/home/src/projects/c/3/c-impl/c/lib/c.d.ts] Inode:: 168 export declare const c: string; -//// [/home/src/projects/c/3/c-impl/c/lib/index.js] Inode:: 168 +//// [/home/src/projects/c/3/c-impl/c/lib/index.js] Inode:: 169 "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; @@ -1931,14 +1931,14 @@ Object.defineProperty(exports, "__esModule", { value: true }); __exportStar(require("./c"), exports); -//// [/home/src/projects/c/3/c-impl/c/lib/index.d.ts] Inode:: 169 +//// [/home/src/projects/c/3/c-impl/c/lib/index.d.ts] Inode:: 170 export * from './c'; -//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo] Inode:: 170 +//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo] Inode:: 171 {"root":["../src/c.ts","../src/index.ts"],"version":"FakeTSVersion"} -//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 171 +//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 172 { "root": [ "../src/c.ts", @@ -1948,18 +1948,18 @@ export * from './c'; "size": 68 } -//// [/home/src/projects/a/1/a-impl/a/lib/a.js] Inode:: 173 +//// [/home/src/projects/a/1/a-impl/a/lib/a.js] Inode:: 174 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.a = void 0; exports.a = 'test'; -//// [/home/src/projects/a/1/a-impl/a/lib/a.d.ts] Inode:: 174 +//// [/home/src/projects/a/1/a-impl/a/lib/a.d.ts] Inode:: 175 export declare const a: string; -//// [/home/src/projects/a/1/a-impl/a/lib/index.js] Inode:: 175 +//// [/home/src/projects/a/1/a-impl/a/lib/index.js] Inode:: 176 "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; @@ -1980,15 +1980,15 @@ __exportStar(require("./a"), exports); __exportStar(require("c"), exports); -//// [/home/src/projects/a/1/a-impl/a/lib/index.d.ts] Inode:: 176 +//// [/home/src/projects/a/1/a-impl/a/lib/index.d.ts] Inode:: 177 export * from './a'; export * from 'c'; -//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo] Inode:: 177 +//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo] Inode:: 178 {"root":["../src/a.ts","../src/index.ts"],"version":"FakeTSVersion"} -//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 178 +//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 179 { "root": [ "../src/a.ts", diff --git a/tests/baselines/reference/tsserver/symLinks/packages-outside-project-folder-built-MacOs.js b/tests/baselines/reference/tsserver/symLinks/packages-outside-project-folder-built-MacOs.js index 86dc5db3cdacc..aea117b20da5a 100644 --- a/tests/baselines/reference/tsserver/symLinks/packages-outside-project-folder-built-MacOs.js +++ b/tests/baselines/reference/tsserver/symLinks/packages-outside-project-folder-built-MacOs.js @@ -90,18 +90,18 @@ interface Array { length: number; [n: number]: T; } interface ReadonlyArray {} declare const console: { log(msg: any): void; }; -//// [/home/src/projects/c/3/c-impl/c/lib/c.js] Inode:: 148 +//// [/home/src/projects/c/3/c-impl/c/lib/c.js] Inode:: 149 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.c = void 0; exports.c = 'test'; -//// [/home/src/projects/c/3/c-impl/c/lib/c.d.ts] Inode:: 149 +//// [/home/src/projects/c/3/c-impl/c/lib/c.d.ts] Inode:: 150 export declare const c: string; -//// [/home/src/projects/c/3/c-impl/c/lib/index.js] Inode:: 150 +//// [/home/src/projects/c/3/c-impl/c/lib/index.js] Inode:: 151 "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; @@ -121,14 +121,14 @@ Object.defineProperty(exports, "__esModule", { value: true }); __exportStar(require("./c"), exports); -//// [/home/src/projects/c/3/c-impl/c/lib/index.d.ts] Inode:: 151 +//// [/home/src/projects/c/3/c-impl/c/lib/index.d.ts] Inode:: 152 export * from './c'; -//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo] Inode:: 152 +//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo] Inode:: 153 {"root":["../src/c.ts","../src/index.ts"],"version":"FakeTSVersion"} -//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 153 +//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 154 { "root": [ "../src/c.ts", @@ -138,18 +138,18 @@ export * from './c'; "size": 68 } -//// [/home/src/projects/a/1/a-impl/a/lib/a.js] Inode:: 155 +//// [/home/src/projects/a/1/a-impl/a/lib/a.js] Inode:: 156 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.a = void 0; exports.a = 'test'; -//// [/home/src/projects/a/1/a-impl/a/lib/a.d.ts] Inode:: 156 +//// [/home/src/projects/a/1/a-impl/a/lib/a.d.ts] Inode:: 157 export declare const a: string; -//// [/home/src/projects/a/1/a-impl/a/lib/index.js] Inode:: 157 +//// [/home/src/projects/a/1/a-impl/a/lib/index.js] Inode:: 158 "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; @@ -170,15 +170,15 @@ __exportStar(require("./a"), exports); __exportStar(require("c"), exports); -//// [/home/src/projects/a/1/a-impl/a/lib/index.d.ts] Inode:: 158 +//// [/home/src/projects/a/1/a-impl/a/lib/index.d.ts] Inode:: 159 export * from './a'; export * from 'c'; -//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo] Inode:: 159 +//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo] Inode:: 160 {"root":["../src/a.ts","../src/index.ts"],"version":"FakeTSVersion"} -//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 160 +//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 161 { "root": [ "../src/a.ts", @@ -388,9 +388,9 @@ FsWatches:: /home/src/projects: *new* {"inode":3} /home/src/projects/a/1/a-impl/a/lib/a.d.ts: *new* - {"inode":156} + {"inode":157} /home/src/projects/a/1/a-impl/a/lib/index.d.ts: *new* - {"inode":158} + {"inode":159} /home/src/projects/a/1/a-impl/a/package.json: *new* {"inode":24} /home/src/projects/b: *new* @@ -404,9 +404,9 @@ FsWatches:: /home/src/projects/b/2/b-impl/b/tsconfig.json: *new* {"inode":36} /home/src/projects/c/3/c-impl/c/lib/c.d.ts: *new* - {"inode":149} + {"inode":150} /home/src/projects/c/3/c-impl/c/lib/index.d.ts: *new* - {"inode":151} + {"inode":152} /home/src/projects/c/3/c-impl/c/package.json: *new* {"inode":12} /home/src/tslibs/TS/Lib/lib.d.ts: *new* @@ -566,7 +566,7 @@ Info seq [hh:mm:ss:mss] Scheduled: /home/src/projects/b/2/b-impl/b/tsconfig.jso Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Triggered with /home/src/projects/a/2/unrelated/somethingUnrelated.ts :: WatchInfo: /home/src/projects/a 1 undefined Project: /home/src/projects/b/2/b-impl/b/tsconfig.json WatchType: Failed Lookup Locations Before running Timeout callback:: count: 1 2: /home/src/projects/b/2/b-impl/b/tsconfig.jsonFailedLookupInvalidation -//// [/home/src/projects/a/2/unrelated/somethingUnrelated.ts] Inode:: 161 +//// [/home/src/projects/a/2/unrelated/somethingUnrelated.ts] Inode:: 162 export const a = 10; @@ -690,7 +690,7 @@ Info seq [hh:mm:ss:mss] Scheduled: /home/src/projects/b/2/b-impl/b/tsconfig.jso Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Triggered with /home/src/projects/c/4/unrelated/somethingUnrelated.ts :: WatchInfo: /home/src/projects/c 1 undefined Project: /home/src/projects/b/2/b-impl/b/tsconfig.json WatchType: Failed Lookup Locations Before running Timeout callback:: count: 1 4: /home/src/projects/b/2/b-impl/b/tsconfig.jsonFailedLookupInvalidation -//// [/home/src/projects/c/4/unrelated/somethingUnrelated.ts] Inode:: 162 +//// [/home/src/projects/c/4/unrelated/somethingUnrelated.ts] Inode:: 163 export const a = 10; @@ -814,7 +814,7 @@ Info seq [hh:mm:ss:mss] Scheduled: /home/src/projects/b/2/b-impl/b/tsconfig.jso Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Triggered with /home/src/projects/a/2/unrelated/anotherFile.ts :: WatchInfo: /home/src/projects/a 1 undefined Project: /home/src/projects/b/2/b-impl/b/tsconfig.json WatchType: Failed Lookup Locations Before running Timeout callback:: count: 1 6: /home/src/projects/b/2/b-impl/b/tsconfig.jsonFailedLookupInvalidation -//// [/home/src/projects/a/2/unrelated/anotherFile.ts] Inode:: 163 +//// [/home/src/projects/a/2/unrelated/anotherFile.ts] Inode:: 164 export const a = 10; @@ -938,7 +938,7 @@ Info seq [hh:mm:ss:mss] Scheduled: /home/src/projects/b/2/b-impl/b/tsconfig.jso Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Triggered with /home/src/projects/c/4/unrelated/anotherFile.ts :: WatchInfo: /home/src/projects/c 1 undefined Project: /home/src/projects/b/2/b-impl/b/tsconfig.json WatchType: Failed Lookup Locations Before running Timeout callback:: count: 1 8: /home/src/projects/b/2/b-impl/b/tsconfig.jsonFailedLookupInvalidation -//// [/home/src/projects/c/4/unrelated/anotherFile.ts] Inode:: 164 +//// [/home/src/projects/c/4/unrelated/anotherFile.ts] Inode:: 165 export const a = 10; @@ -1176,13 +1176,13 @@ FsWatches:: FsWatches *deleted*:: /home/src/projects/a/1/a-impl/a/lib/a.d.ts: - {"inode":156} + {"inode":157} /home/src/projects/a/1/a-impl/a/lib/index.d.ts: - {"inode":158} + {"inode":159} /home/src/projects/c/3/c-impl/c/lib/c.d.ts: - {"inode":149} + {"inode":150} /home/src/projects/c/3/c-impl/c/lib/index.d.ts: - {"inode":151} + {"inode":152} FsWatchesRecursive:: /home/src/projects/a: @@ -1553,18 +1553,18 @@ Info seq [hh:mm:ss:mss] Scheduled: /home/src/projects/b/2/b-impl/b/tsconfig.jso Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Triggered with /home/src/projects/b/2/b-impl/b/node_modules/a/lib/tsconfig.tsbuildinfo.readable.baseline.txt :: WatchInfo: /home/src/projects/b/2/b-impl/b/node_modules/a 1 undefined Project: /home/src/projects/b/2/b-impl/b/tsconfig.json WatchType: Failed Lookup Locations Before running Timeout callback:: count: 1 39: /home/src/projects/b/2/b-impl/b/tsconfig.jsonFailedLookupInvalidation -//// [/home/src/projects/c/3/c-impl/c/lib/c.js] Inode:: 166 +//// [/home/src/projects/c/3/c-impl/c/lib/c.js] Inode:: 167 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.c = void 0; exports.c = 'test'; -//// [/home/src/projects/c/3/c-impl/c/lib/c.d.ts] Inode:: 167 +//// [/home/src/projects/c/3/c-impl/c/lib/c.d.ts] Inode:: 168 export declare const c: string; -//// [/home/src/projects/c/3/c-impl/c/lib/index.js] Inode:: 168 +//// [/home/src/projects/c/3/c-impl/c/lib/index.js] Inode:: 169 "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; @@ -1584,14 +1584,14 @@ Object.defineProperty(exports, "__esModule", { value: true }); __exportStar(require("./c"), exports); -//// [/home/src/projects/c/3/c-impl/c/lib/index.d.ts] Inode:: 169 +//// [/home/src/projects/c/3/c-impl/c/lib/index.d.ts] Inode:: 170 export * from './c'; -//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo] Inode:: 170 +//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo] Inode:: 171 {"root":["../src/c.ts","../src/index.ts"],"version":"FakeTSVersion"} -//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 171 +//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 172 { "root": [ "../src/c.ts", @@ -1601,18 +1601,18 @@ export * from './c'; "size": 68 } -//// [/home/src/projects/a/1/a-impl/a/lib/a.js] Inode:: 173 +//// [/home/src/projects/a/1/a-impl/a/lib/a.js] Inode:: 174 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.a = void 0; exports.a = 'test'; -//// [/home/src/projects/a/1/a-impl/a/lib/a.d.ts] Inode:: 174 +//// [/home/src/projects/a/1/a-impl/a/lib/a.d.ts] Inode:: 175 export declare const a: string; -//// [/home/src/projects/a/1/a-impl/a/lib/index.js] Inode:: 175 +//// [/home/src/projects/a/1/a-impl/a/lib/index.js] Inode:: 176 "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; @@ -1633,15 +1633,15 @@ __exportStar(require("./a"), exports); __exportStar(require("c"), exports); -//// [/home/src/projects/a/1/a-impl/a/lib/index.d.ts] Inode:: 176 +//// [/home/src/projects/a/1/a-impl/a/lib/index.d.ts] Inode:: 177 export * from './a'; export * from 'c'; -//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo] Inode:: 177 +//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo] Inode:: 178 {"root":["../src/a.ts","../src/index.ts"],"version":"FakeTSVersion"} -//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 178 +//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 179 { "root": [ "../src/a.ts", @@ -1686,9 +1686,9 @@ FsWatches:: /home/src/projects: {"inode":3} /home/src/projects/a/1/a-impl/a/lib/a.d.ts: *new* - {"inode":174} + {"inode":175} /home/src/projects/a/1/a-impl/a/lib/index.d.ts: *new* - {"inode":176} + {"inode":177} /home/src/projects/a/1/a-impl/a/package.json: {"inode":24} /home/src/projects/b: @@ -1702,9 +1702,9 @@ FsWatches:: /home/src/projects/b/2/b-impl/b/tsconfig.json: {"inode":36} /home/src/projects/c/3/c-impl/c/lib/c.d.ts: *new* - {"inode":167} + {"inode":168} /home/src/projects/c/3/c-impl/c/lib/index.d.ts: *new* - {"inode":169} + {"inode":170} /home/src/tslibs/TS/Lib/lib.d.ts: {"inode":45} @@ -1873,9 +1873,9 @@ FsWatches:: /home/src/projects: {"inode":3} /home/src/projects/a/1/a-impl/a/lib/a.d.ts: - {"inode":174} + {"inode":175} /home/src/projects/a/1/a-impl/a/lib/index.d.ts: - {"inode":176} + {"inode":177} /home/src/projects/a/1/a-impl/a/package.json: {"inode":24} /home/src/projects/b: @@ -1889,9 +1889,9 @@ FsWatches:: /home/src/projects/b/2/b-impl/b/tsconfig.json: {"inode":36} /home/src/projects/c/3/c-impl/c/lib/c.d.ts: - {"inode":167} + {"inode":168} /home/src/projects/c/3/c-impl/c/lib/index.d.ts: - {"inode":169} + {"inode":170} /home/src/projects/c/3/c-impl/c/package.json: *new* {"inode":12} /home/src/tslibs/TS/Lib/lib.d.ts: diff --git a/tests/baselines/reference/tsserver/telemetry/does-not-expose-paths.js b/tests/baselines/reference/tsserver/telemetry/does-not-expose-paths.js index 6f10156e785b6..38530a1753a14 100644 --- a/tests/baselines/reference/tsserver/telemetry/does-not-expose-paths.js +++ b/tests/baselines/reference/tsserver/telemetry/does-not-expose-paths.js @@ -430,7 +430,7 @@ Info seq [hh:mm:ss:mss] event: "line": 34, "offset": 16 }, - "text": "Argument for '--lib' option must be: 'es5', 'es6', 'es2015', 'es7', 'es2016', 'es2017', 'es2018', 'es2019', 'es2020', 'es2021', 'es2022', 'es2023', 'es2024', 'esnext', 'dom', 'dom.iterable', 'dom.asynciterable', 'webworker', 'webworker.importscripts', 'webworker.iterable', 'webworker.asynciterable', 'scripthost', 'es2015.core', 'es2015.collection', 'es2015.generator', 'es2015.iterable', 'es2015.promise', 'es2015.proxy', 'es2015.reflect', 'es2015.symbol', 'es2015.symbol.wellknown', 'es2016.array.include', 'es2016.intl', 'es2017.arraybuffer', 'es2017.date', 'es2017.object', 'es2017.sharedmemory', 'es2017.string', 'es2017.intl', 'es2017.typedarrays', 'es2018.asyncgenerator', 'es2018.asynciterable', 'es2018.intl', 'es2018.promise', 'es2018.regexp', 'es2019.array', 'es2019.object', 'es2019.string', 'es2019.symbol', 'es2019.intl', 'es2020.bigint', 'es2020.date', 'es2020.promise', 'es2020.sharedmemory', 'es2020.string', 'es2020.symbol.wellknown', 'es2020.intl', 'es2020.number', 'es2021.promise', 'es2021.string', 'es2021.weakref', 'es2021.intl', 'es2022.array', 'es2022.error', 'es2022.intl', 'es2022.object', 'es2022.string', 'es2022.regexp', 'es2023.array', 'es2023.collection', 'es2023.intl', 'es2024.arraybuffer', 'es2024.collection', 'es2024.object', 'es2024.promise', 'es2024.regexp', 'es2024.sharedmemory', 'es2024.string', 'esnext.array', 'esnext.collection', 'esnext.symbol', 'esnext.asynciterable', 'esnext.intl', 'esnext.disposable', 'esnext.bigint', 'esnext.string', 'esnext.promise', 'esnext.weakref', 'esnext.decorators', 'esnext.object', 'esnext.regexp', 'esnext.iterator', 'esnext.float16', 'esnext.typedarrays', 'esnext.error', 'esnext.sharedmemory', 'esnext.temporal', 'decorators', 'decorators.legacy'.", + "text": "Argument for '--lib' option must be: 'es5', 'es6', 'es2015', 'es7', 'es2016', 'es2017', 'es2018', 'es2019', 'es2020', 'es2021', 'es2022', 'es2023', 'es2024', 'esnext', 'dom', 'dom.iterable', 'dom.asynciterable', 'webworker', 'webworker.importscripts', 'webworker.iterable', 'webworker.asynciterable', 'scripthost', 'es2015.core', 'es2015.collection', 'es2015.generator', 'es2015.iterable', 'es2015.promise', 'es2015.proxy', 'es2015.reflect', 'es2015.symbol', 'es2015.symbol.wellknown', 'es2016.array.include', 'es2016.intl', 'es2017.arraybuffer', 'es2017.date', 'es2017.object', 'es2017.sharedmemory', 'es2017.string', 'es2017.intl', 'es2017.typedarrays', 'es2018.asyncgenerator', 'es2018.asynciterable', 'es2018.intl', 'es2018.promise', 'es2018.regexp', 'es2019.array', 'es2019.object', 'es2019.string', 'es2019.symbol', 'es2019.intl', 'es2020.bigint', 'es2020.date', 'es2020.promise', 'es2020.sharedmemory', 'es2020.string', 'es2020.symbol.wellknown', 'es2020.intl', 'es2020.number', 'es2021.promise', 'es2021.string', 'es2021.weakref', 'es2021.intl', 'es2022.array', 'es2022.error', 'es2022.intl', 'es2022.object', 'es2022.string', 'es2022.regexp', 'es2023.array', 'es2023.collection', 'es2023.intl', 'es2024.arraybuffer', 'es2024.collection', 'es2024.object', 'es2024.promise', 'es2024.regexp', 'es2024.sharedmemory', 'es2024.string', 'esnext.array', 'esnext.collection', 'esnext.symbol', 'esnext.asynciterable', 'esnext.intl', 'esnext.disposable', 'esnext.bigint', 'esnext.string', 'esnext.promise', 'esnext.weakref', 'esnext.decorators', 'esnext.object', 'esnext.regexp', 'esnext.iterator', 'esnext.float16', 'esnext.typedarrays', 'esnext.error', 'esnext.sharedmemory', 'esnext.temporal', 'esnext.date', 'decorators', 'decorators.legacy'.", "code": 6046, "category": "error", "fileName": "/home/src/projects/project/tsconfig.json" diff --git a/tests/baselines/reference/tsserver/watchEnvironment/recursive-directory-does-not-watch-files-starting-with-dot-in-node_modules.js b/tests/baselines/reference/tsserver/watchEnvironment/recursive-directory-does-not-watch-files-starting-with-dot-in-node_modules.js index 3b3bec8b111f9..3bed5d18c5814 100644 --- a/tests/baselines/reference/tsserver/watchEnvironment/recursive-directory-does-not-watch-files-starting-with-dot-in-node_modules.js +++ b/tests/baselines/reference/tsserver/watchEnvironment/recursive-directory-does-not-watch-files-starting-with-dot-in-node_modules.js @@ -222,30 +222,30 @@ ScriptInfos:: /a/username/workspace/project/tsconfig.json After writing ignored file or folder -//// [/a/username/workspace/project/node_modules/.cache/someFile.d.ts] Inode:: 122 +//// [/a/username/workspace/project/node_modules/.cache/someFile.d.ts] Inode:: 123 After writing ignored file or folder -//// [/a/username/workspace/project/node_modules/.cacheFile.ts] Inode:: 123 +//// [/a/username/workspace/project/node_modules/.cacheFile.ts] Inode:: 124 Info seq [hh:mm:ss:mss] DirectoryWatcher:: Triggered with /a/username/workspace/project/.git :: WatchInfo: /a/username/workspace/project 0 undefined Project: /a/username/workspace/project/tsconfig.json WatchType: Failed Lookup Locations Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/username/workspace/project/.git :: WatchInfo: /a/username/workspace/project 0 undefined Project: /a/username/workspace/project/tsconfig.json WatchType: Failed Lookup Locations After writing ignored file or folder -//// [/a/username/workspace/project/.git/someFile.d.ts] Inode:: 125 +//// [/a/username/workspace/project/.git/someFile.d.ts] Inode:: 126 Info seq [hh:mm:ss:mss] DirectoryWatcher:: Triggered with /a/username/workspace/project/.gitCache.d.ts :: WatchInfo: /a/username/workspace/project 0 undefined Project: /a/username/workspace/project/tsconfig.json WatchType: Failed Lookup Locations Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/username/workspace/project/.gitCache.d.ts :: WatchInfo: /a/username/workspace/project 0 undefined Project: /a/username/workspace/project/tsconfig.json WatchType: Failed Lookup Locations After writing ignored file or folder -//// [/a/username/workspace/project/.gitCache.d.ts] Inode:: 126 +//// [/a/username/workspace/project/.gitCache.d.ts] Inode:: 127 After writing ignored file or folder -//// [/a/username/workspace/project/src/.#field.ts] Inode:: 127 +//// [/a/username/workspace/project/src/.#field.ts] Inode:: 128 diff --git a/tests/baselines/reference/tsserver/watchEnvironment/uses-dynamic-polling-when-file-is-added-to-subfolder.js b/tests/baselines/reference/tsserver/watchEnvironment/uses-dynamic-polling-when-file-is-added-to-subfolder.js index c9c7b949e858e..b347ee3ecc03e 100644 --- a/tests/baselines/reference/tsserver/watchEnvironment/uses-dynamic-polling-when-file-is-added-to-subfolder.js +++ b/tests/baselines/reference/tsserver/watchEnvironment/uses-dynamic-polling-when-file-is-added-to-subfolder.js @@ -242,7 +242,7 @@ After request Before running Timeout callback:: count: 1 1: pollPollingIntervalQueue -//// [/a/username/workspace/project/src/file2.ts] Inode:: 119 +//// [/a/username/workspace/project/src/file2.ts] Inode:: 120 @@ -356,7 +356,7 @@ FsWatches:: /a/username/workspace/project/src/file1.ts: {"inode":7} /a/username/workspace/project/src/file2.ts: *new* - {"inode":119} + {"inode":120} /a/username/workspace/project/tsconfig.json: {"inode":8} /home/src/tslibs/TS/Lib/lib.d.ts: diff --git a/tests/baselines/reference/tsserver/watchEnvironment/uses-non-recursive-watchDirectory-when-file-is-added-to-subfolder.js b/tests/baselines/reference/tsserver/watchEnvironment/uses-non-recursive-watchDirectory-when-file-is-added-to-subfolder.js index 5a3bfe31735bd..a501f2ada0fa0 100644 --- a/tests/baselines/reference/tsserver/watchEnvironment/uses-non-recursive-watchDirectory-when-file-is-added-to-subfolder.js +++ b/tests/baselines/reference/tsserver/watchEnvironment/uses-non-recursive-watchDirectory-when-file-is-added-to-subfolder.js @@ -258,7 +258,7 @@ Before running Timeout callback:: count: 3 1: /a/username/workspace/project/tsconfig.json 2: *ensureProjectForOpenFiles* 3: /a/username/workspace/project/tsconfig.jsonFailedLookupInvalidation -//// [/a/username/workspace/project/src/file2.ts] Inode:: 119 +//// [/a/username/workspace/project/src/file2.ts] Inode:: 120 @@ -342,7 +342,7 @@ FsWatches:: /a/username/workspace/project/src/file1.ts: {"inode":7} /a/username/workspace/project/src/file2.ts: *new* - {"inode":119} + {"inode":120} /a/username/workspace/project/tsconfig.json: {"inode":8} /home/src/tslibs/TS/Lib/lib.d.ts: diff --git a/tests/baselines/reference/tsserver/watchEnvironment/uses-watchFile-when-file-is-added-to-subfolder.js b/tests/baselines/reference/tsserver/watchEnvironment/uses-watchFile-when-file-is-added-to-subfolder.js index 8ac6c761da7e0..f7b2e2ab21d81 100644 --- a/tests/baselines/reference/tsserver/watchEnvironment/uses-watchFile-when-file-is-added-to-subfolder.js +++ b/tests/baselines/reference/tsserver/watchEnvironment/uses-watchFile-when-file-is-added-to-subfolder.js @@ -261,7 +261,7 @@ Before running Timeout callback:: count: 3 3: /a/username/workspace/project/tsconfig.json 4: *ensureProjectForOpenFiles* 5: /a/username/workspace/project/tsconfig.jsonFailedLookupInvalidation -//// [/a/username/workspace/project/src/file2.ts] Inode:: 119 +//// [/a/username/workspace/project/src/file2.ts] Inode:: 120 @@ -332,7 +332,7 @@ FsWatches:: /a/username/workspace/project/src/file1.ts: {"inode":7} /a/username/workspace/project/src/file2.ts: *new* - {"inode":119} + {"inode":120} /a/username/workspace/project/tsconfig.json: {"inode":8} /home/src/tslibs/TS/Lib/lib.d.ts: diff --git a/tests/baselines/reference/tsserver/watchEnvironment/watching-npm-install-in-codespaces-where-workspaces-folder-is-hosted-at-root.js b/tests/baselines/reference/tsserver/watchEnvironment/watching-npm-install-in-codespaces-where-workspaces-folder-is-hosted-at-root.js index a9980b4935b07..d818382ce104a 100644 --- a/tests/baselines/reference/tsserver/watchEnvironment/watching-npm-install-in-codespaces-where-workspaces-folder-is-hosted-at-root.js +++ b/tests/baselines/reference/tsserver/watchEnvironment/watching-npm-install-in-codespaces-where-workspaces-folder-is-hosted-at-root.js @@ -669,7 +669,7 @@ Info seq [hh:mm:ss:mss] DirectoryWatcher:: Triggered with /workspaces/somerepo/ Info seq [hh:mm:ss:mss] Scheduled: /workspaces/somerepo/src/tsconfig.jsonFailedLookupInvalidation, Cancelled earlier one Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Triggered with /workspaces/somerepo/node_modules :: WatchInfo: /workspaces/somerepo 0 undefined Project: /workspaces/somerepo/src/tsconfig.json WatchType: Failed Lookup Locations Before request -//// [/workspaces/somerepo/node_modules/@types/random-seed/index.d.ts] Inode:: 123 +//// [/workspaces/somerepo/node_modules/@types/random-seed/index.d.ts] Inode:: 124 export function randomSeed(): string; @@ -691,9 +691,9 @@ FsWatches:: /workspaces/somerepo: {"inode":2} /workspaces/somerepo/node_modules: *new* - {"inode":120} -/workspaces/somerepo/node_modules/@types: *new* {"inode":121} +/workspaces/somerepo/node_modules/@types: *new* + {"inode":122} /workspaces/somerepo/src: {"inode":3} /workspaces/somerepo/src/tsconfig.json: @@ -790,9 +790,9 @@ FsWatches:: /workspaces/somerepo: {"inode":2} /workspaces/somerepo/node_modules: - {"inode":120} -/workspaces/somerepo/node_modules/@types: {"inode":121} +/workspaces/somerepo/node_modules/@types: + {"inode":122} /workspaces/somerepo/src: {"inode":3} /workspaces/somerepo/src/tsconfig.json: @@ -924,11 +924,11 @@ FsWatches:: /workspaces/somerepo: {"inode":2} /workspaces/somerepo/node_modules: - {"inode":120} -/workspaces/somerepo/node_modules/@types: {"inode":121} -/workspaces/somerepo/node_modules/@types/random-seed: *new* +/workspaces/somerepo/node_modules/@types: {"inode":122} +/workspaces/somerepo/node_modules/@types/random-seed: *new* + {"inode":123} /workspaces/somerepo/src: {"inode":3} /workspaces/somerepo/src/tsconfig.json: diff --git a/tests/cases/compiler/doYouNeedToChangeYourTargetLibraryES2016Plus.ts b/tests/cases/compiler/doYouNeedToChangeYourTargetLibraryES2016Plus.ts index 0c754c740c4a5..218fb916d6806 100644 --- a/tests/cases/compiler/doYouNeedToChangeYourTargetLibraryES2016Plus.ts +++ b/tests/cases/compiler/doYouNeedToChangeYourTargetLibraryES2016Plus.ts @@ -46,3 +46,4 @@ const testPromiseAny = Promise.any([]); const testStringReplaceAll = "".replaceAll(); // esnext +const testDateToTemporalInstant = new Date().toTemporalInstant(); From 56b991f1d1ce4a55c0c372df3c493ff3cedcc82b Mon Sep 17 00:00:00 2001 From: Renegade334 Date: Fri, 6 Feb 2026 22:53:31 +0000 Subject: [PATCH 3/8] small bikesheds --- src/lib/esnext.temporal.d.ts | 33 +++++++++++++++------------------ 1 file changed, 15 insertions(+), 18 deletions(-) diff --git a/src/lib/esnext.temporal.d.ts b/src/lib/esnext.temporal.d.ts index ff0d455f4291a..539538caaf35b 100644 --- a/src/lib/esnext.temporal.d.ts +++ b/src/lib/esnext.temporal.d.ts @@ -63,10 +63,18 @@ declare namespace Temporal { type DateUnit = "year" | "month" | "week" | "day" | "years" | "months" | "weeks" | "days"; type TimeUnit = "hour" | "minute" | "second" | "millisecond" | "microsecond" | "nanosecond" | "hours" | "minutes" | "seconds" | "milliseconds" | "microseconds" | "nanoseconds"; + interface DisambiguationOptions { + disambiguation?: "compatible" | "earlier" | "later" | "reject" | undefined; + } + interface OverflowOptions { overflow?: "constrain" | "reject" | undefined; } + interface TransitionOptions { + direction: "next" | "previous"; + } + interface RoundingOptions { smallestUnit?: Units | undefined; roundingIncrement?: number | undefined; @@ -179,8 +187,6 @@ declare namespace Temporal { interface PlainDateTimeToStringOptions extends PlainDateToStringOptions, PlainTimeToStringOptions {} - interface PlainDateTimeToZonedDateTimeOptions extends Pick {} - interface PlainDateTime { readonly calendarId: string; readonly era: string | undefined; @@ -218,7 +224,7 @@ declare namespace Temporal { toLocaleString(locales?: Intl.LocalesArgument, options?: Intl.DateTimeFormatOptions): string; toJSON(): string; valueOf(): never; - toZonedDateTime(timeZone: TimeZoneLike, options?: PlainDateTimeToZonedDateTimeOptions): ZonedDateTime; + toZonedDateTime(timeZone: TimeZoneLike, options?: DisambiguationOptions): ZonedDateTime; toPlainDate(): PlainDate; toPlainTime(): PlainTime; readonly [Symbol.toStringTag]: "Temporal.PlainDateTime"; @@ -237,15 +243,10 @@ declare namespace Temporal { timeZoneName?: "auto" | "never" | "critical" | undefined; } - interface ZonedDateTimeToZonedDateTimeOptions extends OverflowOptions { - disambiguation?: "compatible" | "earlier" | "later" | "reject" | undefined; + interface ZonedDateTimeFromOptions extends OverflowOptions, DisambiguationOptions { offset?: "use" | "ignore" | "prefer" | "reject" | undefined; } - interface ZonedDateTimeTransitionOptions { - direction: "next" | "previous"; - } - interface ZonedDateTime { readonly calendarId: string; readonly timeZoneId: string; @@ -275,7 +276,7 @@ declare namespace Temporal { readonly inLeapYear: boolean; readonly offsetNanoseconds: number; readonly offset: string; - with(zonedDateTimeLike: PartialTemporalLike, options?: ZonedDateTimeToZonedDateTimeOptions): ZonedDateTime; + with(zonedDateTimeLike: PartialTemporalLike, options?: ZonedDateTimeFromOptions): ZonedDateTime; withPlainTime(plainTime?: PlainTimeLike): ZonedDateTime; withTimeZone(timeZone: TimeZoneLike): ZonedDateTime; withCalendar(calendar: CalendarLike): ZonedDateTime; @@ -292,7 +293,7 @@ declare namespace Temporal { valueOf(): never; startOfDay(): ZonedDateTime; getTimeZoneTransition(direction: "next" | "previous"): ZonedDateTime | null; - getTimeZoneTransition(direction: ZonedDateTimeTransitionOptions): ZonedDateTime | null; + getTimeZoneTransition(direction: TransitionOptions): ZonedDateTime | null; toInstant(): Instant; toPlainDate(): PlainDate; toPlainTime(): PlainTime; @@ -303,7 +304,7 @@ declare namespace Temporal { interface ZonedDateTimeConstructor { new (epochNanoseconds: bigint, timeZone: string, calendar?: string): ZonedDateTime; readonly prototype: ZonedDateTime; - from(item: ZonedDateTimeLike, options?: ZonedDateTimeToZonedDateTimeOptions): ZonedDateTime; + from(item: ZonedDateTimeLike, options?: ZonedDateTimeFromOptions): ZonedDateTime; compare(one: ZonedDateTimeLike, two: ZonedDateTimeLike): number; } var ZonedDateTime: ZonedDateTimeConstructor; @@ -393,8 +394,6 @@ declare namespace Temporal { day: number; } - interface PlainYearMonthToStringOptions extends Pick {} - interface PlainYearMonth { readonly calendarId: string; readonly era: string | undefined; @@ -412,7 +411,7 @@ declare namespace Temporal { until(other: PlainYearMonthLike, options?: RoundingOptionsWithLargestUnit<"year" | "month" | "years" | "months">): Duration; since(other: PlainYearMonthLike, options?: RoundingOptionsWithLargestUnit<"year" | "month" | "years" | "months">): Duration; equals(other: PlainYearMonthLike): boolean; - toString(options?: PlainYearMonthToStringOptions): string; + toString(options?: PlainDateToStringOptions): string; toLocaleString(locales?: Intl.LocalesArgument, options?: Intl.DateTimeFormatOptions): string; toJSON(): string; valueOf(): never; @@ -432,15 +431,13 @@ declare namespace Temporal { year: number; } - interface PlainMonthDayToStringOptions extends Pick {} - interface PlainMonthDay { readonly calendarId: string; readonly monthCode: string; readonly day: number; with(monthDayLike: PartialTemporalLike, options?: OverflowOptions): PlainMonthDay; equals(other: PlainMonthDayLike): boolean; - toString(options?: PlainMonthDayToStringOptions): string; + toString(options?: PlainDateToStringOptions): string; toLocaleString(locales?: Intl.LocalesArgument, options?: Intl.DateTimeFormatOptions): string; toJSON(): string; valueOf(): never; From 933b92176740fcbd71e960a49a9fca99f8178dbc Mon Sep 17 00:00:00 2001 From: Renegade334 Date: Fri, 6 Feb 2026 22:55:38 +0000 Subject: [PATCH 4/8] use new DurationFormat defs --- src/lib/esnext.temporal.d.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/lib/esnext.temporal.d.ts b/src/lib/esnext.temporal.d.ts index 539538caaf35b..137c9e66fcf3d 100644 --- a/src/lib/esnext.temporal.d.ts +++ b/src/lib/esnext.temporal.d.ts @@ -1,5 +1,6 @@ /// /// +/// declare namespace Temporal { type CalendarLike = PlainDate | PlainDateTime | PlainMonthDay | PlainYearMonth | ZonedDateTime | string; @@ -344,7 +345,7 @@ declare namespace Temporal { total(totalOf: "day" | "days" | TimeUnit): number; total(totalOf: DurationTotalOptions): number; toString(options?: DurationToStringOptions): string; - toLocaleString(locales?: Intl.LocalesArgument, options?: Intl.DateTimeFormatOptions): string; + toLocaleString(locales?: Intl.LocalesArgument, options?: Intl.DurationFormatOptions): string; toJSON(): string; valueOf(): never; readonly [Symbol.toStringTag]: "Temporal.Duration"; From 0da9af12c896c56d05c0edae8ab21a305907a519 Mon Sep 17 00:00:00 2001 From: Renegade334 Date: Fri, 6 Feb 2026 22:56:31 +0000 Subject: [PATCH 5/8] correct DateTime.compare return --- src/lib/esnext.temporal.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/esnext.temporal.d.ts b/src/lib/esnext.temporal.d.ts index 137c9e66fcf3d..0c42d571fcddc 100644 --- a/src/lib/esnext.temporal.d.ts +++ b/src/lib/esnext.temporal.d.ts @@ -355,7 +355,7 @@ declare namespace Temporal { new (years?: number, months?: number, weeks?: number, days?: number, hours?: number, minutes?: number, seconds?: number, milliseconds?: number, microseconds?: number, nanoseconds?: number): Duration; readonly prototype: Duration; from(item: DurationLike): Duration; - compare(one: DurationLike, two: DurationLike, options?: DurationRelativeToOptions): Duration; + compare(one: DurationLike, two: DurationLike, options?: DurationRelativeToOptions): number; } var Duration: DurationConstructor; From 0f0cab94bb5352f08e8b6e8d75a2674b7cce3dcb Mon Sep 17 00:00:00 2001 From: Renegade334 Date: Sat, 7 Feb 2026 00:19:15 +0000 Subject: [PATCH 6/8] pm.toPlainDate accepts era/eraYear in lieu of year --- src/lib/esnext.temporal.d.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/lib/esnext.temporal.d.ts b/src/lib/esnext.temporal.d.ts index 0c42d571fcddc..6bbfa071a7dfe 100644 --- a/src/lib/esnext.temporal.d.ts +++ b/src/lib/esnext.temporal.d.ts @@ -429,7 +429,9 @@ declare namespace Temporal { var PlainYearMonth: PlainYearMonthConstructor; interface PlainMonthDayToPlainDateOptions { - year: number; + era?: string | undefined; + eraYear?: number | undefined; + year?: number | undefined; } interface PlainMonthDay { From fdb0bc224020f033f1dbd37ff3427389867e4bdf Mon Sep 17 00:00:00 2001 From: Renegade334 Date: Sat, 7 Feb 2026 00:21:11 +0000 Subject: [PATCH 7/8] test all examples from proposal-temporal docs --- tests/baselines/reference/temporal.errors.txt | 1838 ++ tests/baselines/reference/temporal.js | 3371 ++++ tests/baselines/reference/temporal.symbols | 7026 +++++++ tests/baselines/reference/temporal.types | 15707 ++++++++++++++++ tests/cases/compiler/temporal.ts | 1823 ++ 5 files changed, 29765 insertions(+) create mode 100644 tests/baselines/reference/temporal.errors.txt create mode 100644 tests/baselines/reference/temporal.js create mode 100644 tests/baselines/reference/temporal.symbols create mode 100644 tests/baselines/reference/temporal.types create mode 100644 tests/cases/compiler/temporal.ts diff --git a/tests/baselines/reference/temporal.errors.txt b/tests/baselines/reference/temporal.errors.txt new file mode 100644 index 0000000000000..fcbaab22e4c23 --- /dev/null +++ b/tests/baselines/reference/temporal.errors.txt @@ -0,0 +1,1838 @@ +temporal.ts(25,13): error TS2339: Property 'year' does not exist on type 'Instant'. +temporal.ts(72,54): error TS2345: Argument of type 'Date' is not assignable to parameter of type 'number'. +temporal.ts(1503,8): error TS2339: Property 'month' does not exist on type 'PlainMonthDay'. +temporal.ts(1513,8): error TS2339: Property 'month' does not exist on type 'PlainMonthDay'. +temporal.ts(1519,8): error TS2339: Property 'month' does not exist on type 'PlainMonthDay'. + + +==== temporal.ts (5 errors) ==== + /** + * Test cases derived from documentation at tc39/proposal-temporal, + * under the following license: + * + * Copyright 2017, 2018, 2019, 2020 ECMA International + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH + * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, + * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM + * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR + * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. + */ + + { + const instant = Temporal.Instant.from("2020-01-01T00:00+05:30"); // => 2019-12-31T18:30:00Z + instant.epochNanoseconds; // => 1577817000000000000n + + // `Temporal.Instant` lacks properties that depend on time zone or calendar + instant.year; // => undefined + ~~~~ +!!! error TS2339: Property 'year' does not exist on type 'Instant'. + + const zdtTokyo = instant.toZonedDateTimeISO("Asia/Tokyo"); // => 2020-01-01T03:30:00+09:00[Asia/Tokyo] + zdtTokyo.year; // => 2020 + zdtTokyo.toPlainDate(); // => 2020-01-01 + } + + { + // Convert from `Temporal.Instant` to `Date` (which uses millisecond precision) + const instant = Temporal.Instant.from("2020-01-01T00:00:00.123456789+05:30"); + // => 2019-12-31T18:30:00.123456789Z + const date = new Date(instant.epochMilliseconds); + date.toISOString(); // => 2019-12-31T18:30:00.123Z + + // Convert from `Date` to `Temporal.Instant` + const sameInstant = date.toTemporalInstant(); // => 2019-12-31T18:30:00.123Z + } + + { + const date = new Date(2019, 11, 31, 18, 30); // => Tue Dec 31 2019 18:30:00 GMT-0800 (Pacific Standard Time) + const instant = date.toTemporalInstant(); // => 2020-01-01T02:30:00Z + const zonedDateTime = instant.toZonedDateTimeISO(Temporal.Now.timeZoneId()); + // => 2019-12-31T18:30:00-08:00[America/Los_Angeles] + zonedDateTime.day; // => 31 + const dateOnly = zonedDateTime.toPlainDate(); // => 2019-12-31 + } + + { + const instant = new Temporal.Instant(1553906700000000000n); + // When was the Unix epoch? + const epoch = new Temporal.Instant(0n); // => 1970-01-01T00:00:00Z + // Dates before the Unix epoch are negative + const turnOfTheCentury = new Temporal.Instant(-2208988800000000000n); // => 1900-01-01T00:00:00Z + } + + { + let instant: Temporal.Instant; + instant = Temporal.Instant.from("2019-03-30T01:45:00+01:00[Europe/Berlin]"); + instant = Temporal.Instant.from("2019-03-30T01:45+01:00"); + instant = Temporal.Instant.from("2019-03-30T00:45Z"); + instant === Temporal.Instant.from(instant); // => false + } + + { + const legacyDate = new Date("1995-12-17T03:24Z"); + let instant: Temporal.Instant; + instant = Temporal.Instant.fromEpochMilliseconds(legacyDate.getTime()); // => 1995-12-17T03:24:00Z + instant = Temporal.Instant.fromEpochMilliseconds(legacyDate); // valueOf() called implicitly + ~~~~~~~~~~ +!!! error TS2345: Argument of type 'Date' is not assignable to parameter of type 'number'. + instant = legacyDate.toTemporalInstant(); // recommended + } + + { + const one = Temporal.Instant.fromEpochMilliseconds(1.0e12); + const two = Temporal.Instant.fromEpochMilliseconds(1.1e12); + const three = Temporal.Instant.fromEpochMilliseconds(1.2e12); + const sorted = [three, one, two].sort(Temporal.Instant.compare); + sorted.join(" "); + // => '2001-09-09T01:46:40Z 2004-11-09T11:33:20Z 2008-01-10T21:20:00Z' + } + + { + const instant = Temporal.Instant.from("2019-03-30T00:45Z"); + new Date(instant.epochMilliseconds); // => 2019-03-30T00:45:00.000Z + + // If you need epoch seconds data: + const epochSecs = Math.floor(instant.epochMilliseconds / 1000); // => 1553906700 + + const ns = instant.epochNanoseconds; + const epochMicros = ns / 1000n + ((ns % 1000n) < 0n ? -1n : 0n); + } + + { + // Converting a specific exact time to a calendar date / wall-clock time + let timestamp: Temporal.Instant; + timestamp = Temporal.Instant.fromEpochMilliseconds(1553993100_000); + timestamp.toZonedDateTimeISO("Europe/Berlin"); // => 2019-03-31T01:45:00+01:00[Europe/Berlin] + timestamp.toZonedDateTimeISO("UTC"); // => 2019-03-31T00:45:00+00:00[UTC] + timestamp.toZonedDateTimeISO("-08:00"); // => 2019-03-30T16:45:00-08:00[-08:00] + + // What time was the Unix epoch (timestamp 0) in Bell Labs (Murray Hill, New Jersey, USA) in the Gregorian calendar? + const epoch = Temporal.Instant.fromEpochMilliseconds(0); + epoch.toZonedDateTimeISO("America/New_York").withCalendar("gregory"); + // => 1969-12-31T19:00:00-05:00[America/New_York][u-ca=gregory] + + // What time was the Unix epoch in Tokyo in the Japanese calendar? + const zdt = epoch.toZonedDateTimeISO("Asia/Tokyo").withCalendar("japanese"); + // => 1970-01-01T09:00:00+09:00[Asia/Tokyo][u-ca=japanese] + console.log(zdt.eraYear, zdt.era); + // => '45 showa' + } + + { + // Temporal.Instant representing five hours from now + Temporal.Now.instant().add({ hours: 5 }); + const fiveHours = Temporal.Duration.from({ hours: 5 }); + Temporal.Now.instant().add(fiveHours); + } + + { + // Temporal.Instant representing this time an hour ago + Temporal.Now.instant().subtract({ hours: 1 }); + const oneHour = Temporal.Duration.from({ hours: 1 }); + Temporal.Now.instant().subtract(oneHour); + } + + { + const startOfMoonMission = Temporal.Instant.from("1969-07-16T13:32:00Z"); + const endOfMoonMission = Temporal.Instant.from("1969-07-24T16:50:35Z"); + const missionLength = startOfMoonMission.until(endOfMoonMission, { largestUnit: "hour" }); + // => PT195H18M35S + missionLength.toLocaleString(); + // example output: '195 hours 18 minutes 35 seconds' + + // Rounding, for example if you don't care about the minutes and seconds + const approxMissionLength = startOfMoonMission.until(endOfMoonMission, { + largestUnit: "hour", + smallestUnit: "hour", + }); + // => PT195H + + // A billion (10^9) seconds since the epoch in different units + const epoch = Temporal.Instant.fromEpochMilliseconds(0); + const billion = Temporal.Instant.fromEpochMilliseconds(1e9); + epoch.until(billion); + // => PT1000000000S + epoch.until(billion, { largestUnit: "hour" }); + // => PT277777H46M40S + const ns = epoch.until(billion, { largestUnit: "nanosecond" }); + // => PT1000000000S + ns.add({ nanoseconds: 1 }); + // => PT1000000000S + // (lost precision) + + // Calculate the difference in years, eliminating the ambiguity by + // explicitly using the corresponding calendar date in UTC: + epoch.toZonedDateTimeISO("UTC").until( + billion.toZonedDateTimeISO("UTC"), + { largestUnit: "year" }, + ); + // => P31Y8M8DT1H46M40S + } + + { + const instant = Temporal.Instant.from("2019-03-30T02:45:59.999999999Z"); + + // Round to a particular unit + instant.round({ smallestUnit: "second" }); // => 2019-03-30T02:46:00Z + // Round to an increment of a unit, e.g. an hour: + instant.round({ roundingIncrement: 60, smallestUnit: "minute" }); + // => 2019-03-30T03:00:00Z + // Round to the same increment but round down instead: + instant.round({ roundingIncrement: 60, smallestUnit: "minute", roundingMode: "floor" }); + // => 2019-03-30T02:00:00Z + } + + { + const one = Temporal.Instant.fromEpochMilliseconds(1.0e12); + const two = Temporal.Instant.fromEpochMilliseconds(1.1e12); + one.equals(two); // => false + one.equals(one); // => true + } + + { + const instant = Temporal.Instant.fromEpochMilliseconds(1574074321816); + instant.toString(); // => '2019-11-18T10:52:01.816Z' + instant.toString({ timeZone: "UTC" }); + // => '2019-11-18T10:52:01.816+00:00' + instant.toString({ timeZone: "Asia/Seoul" }); + // => '2019-11-18T19:52:01.816+09:00' + + instant.toString({ smallestUnit: "minute" }); + // => '2019-11-18T10:52Z' + instant.toString({ fractionalSecondDigits: 0 }); + // => '2019-11-18T10:52:01Z' + instant.toString({ fractionalSecondDigits: 4 }); + // => '2019-11-18T10:52:01.8160Z' + instant.toString({ smallestUnit: "second", roundingMode: "halfExpand" }); + // => '2019-11-18T10:52:02Z' + } + + { + const instant = Temporal.Instant.from("2019-11-18T11:00:00.000Z"); + instant.toLocaleString(); // example output: '2019-11-18, 3:00:00 a.m.' + instant.toLocaleString("de-DE"); // example output: '18.11.2019, 03:00:00' + instant.toLocaleString("de-DE", { + timeZone: "Europe/Berlin", + year: "numeric", + month: "numeric", + day: "numeric", + hour: "numeric", + minute: "numeric", + timeZoneName: "long", + }); // => '18.11.2019, 12:00 Mitteleuropäische Normalzeit' + instant.toLocaleString("en-US-u-nu-fullwide-hc-h12", { + timeZone: "Asia/Kolkata", + }); // => '11/18/2019, 4:30:00 PM' + } + + { + // UNIX epoch in California + new Temporal.ZonedDateTime(0n, "America/Los_Angeles", "iso8601"); + // => 1969-12-31T16:00:00-08:00[America/Los_Angeles] + new Temporal.ZonedDateTime(0n, "America/Los_Angeles"); + // => 1969-12-31T16:00:00-08:00[America/Los_Angeles] + // same, but shorter + } + + { + let zdt: Temporal.ZonedDateTime; + + zdt = Temporal.ZonedDateTime.from("1995-12-07T03:24:30+02:00[Africa/Cairo]"); + zdt = Temporal.ZonedDateTime.from("1995-12-07T03:24:30+02:00[Africa/Cairo][u-ca=islamic]"); + zdt = Temporal.ZonedDateTime.from("19951207T032430+0200[Africa/Cairo]"); + + zdt = Temporal.ZonedDateTime.from({ + timeZone: "America/Los_Angeles", + year: 1995, + month: 12, + day: 7, + hour: 3, + minute: 24, + second: 30, + millisecond: 0, + microsecond: 3, + nanosecond: 500, + }); // => 1995-12-07T03:24:30.0000035-08:00[America/Los_Angeles] + + // Different overflow modes + zdt = Temporal.ZonedDateTime.from({ timeZone: "Europe/Paris", year: 2001, month: 13, day: 1 }, { overflow: "constrain" }); + // => 2001-12-01T00:00:00+01:00[Europe/Paris] + zdt = Temporal.ZonedDateTime.from({ timeZone: "Europe/Paris", year: 2001, month: 13, day: 1 }, { overflow: "reject" }); + // => throws RangeError + } + + { + const arr = [ + Temporal.ZonedDateTime.from("2020-02-01T12:30-05:00[America/Toronto]"), + Temporal.ZonedDateTime.from("2020-02-01T12:30-05:00[America/New_York]"), + Temporal.ZonedDateTime.from("2020-02-01T12:30+01:00[Europe/Brussels]"), + Temporal.ZonedDateTime.from("2020-02-01T12:30+00:00[Europe/London]"), + ]; + const sorted = arr.sort(Temporal.ZonedDateTime.compare); + JSON.stringify(sorted, undefined, 2); + // => + // '[ + // "2020-02-01T12:30+01:00[Europe/Brussels]", + // "2020-02-01T12:30+00:00[Europe/London]", + // "2020-02-01T12:30-05:00[America/Toronto]", + // "2020-02-01T12:30-05:00[America/New_York]" + // ]' + } + + { + const dt = Temporal.ZonedDateTime.from("1995-12-07T03:24:30.000003500[Europe/Rome]"); + dt.year; // => 1995 + dt.month; // => 12 + dt.monthCode; // => 'M12' + dt.day; // => 7 + dt.hour; // => 3 + dt.minute; // => 24 + dt.second; // => 30 + dt.millisecond; // => 0 + dt.microsecond; // => 3 + dt.nanosecond; // => 500 + } + + { + const zdt = Temporal.ZonedDateTime.from("2020-02-01T12:30+09:00[Asia/Tokyo]"); + const epochMs = zdt.epochMilliseconds; + // => 1580527800000 + zdt.toInstant().epochMilliseconds; + // => 1580527800000 + const legacyDate = new Date(epochMs); + // => 2020-02-01T03:30:00.000Z + // (if the system time zone is America/Los_Angeles) + const epochNanos = zdt.epochNanoseconds; + // => 1580527800000000000n + + // If you need epoch seconds data: + const epochSecs = Math.floor(zdt.epochMilliseconds / 1000); // => 1553906700 + // => 1580527800 + + // If you need epoch microseconds data: + // (Note the extra check for correct floor rounding with bigints) + const ns = zdt.epochNanoseconds; + const epochMicros = ns / 1000n + ((ns % 1000n) < 0n ? -1n : 0n); + // => 1580527800000000n + } + + { + const zdt = Temporal.ZonedDateTime.from("1995-12-07T03:24-08:00[America/Los_Angeles]"); + `Time zone is: ${zdt.timeZoneId}`; + // => 'Time zone is: America/Los_Angeles' + zdt.withTimeZone("Asia/Kolkata").timeZoneId; + // => Asia/Kolkata + zdt.withTimeZone("Asia/Calcutta").timeZoneId; + // => Asia/Calcutta (does not follow links in the IANA Time Zone Database) + + zdt.withTimeZone("europe/paris").timeZoneId; + // => Europe/Paris (normalized to match IANA Time Zone Database capitalization) + + zdt.withTimeZone("+05:00").timeZoneId; + // => +05:00 + zdt.withTimeZone("+05").timeZoneId; + // => +05:00 (normalized to ±HH:MM) + zdt.withTimeZone("+0500").timeZoneId; + // => +05:00 (normalized to ±HH:MM) + } + + { + const date = Temporal.ZonedDateTime.from("-000015-01-01T12:30[Europe/Rome][u-ca=gregory]"); + date.era; + // => 'bce' + date.eraYear; + // => 16 + date.year; + // => -15 + } + + { + const zdt = Temporal.ZonedDateTime.from("1995-12-07T03:24-08:00[America/Los_Angeles]"); + ["MON", "TUE", "WED", "THU", "FRI", "SAT", "SUN"][zdt.dayOfWeek - 1]; // => 'THU' + } + + { + const zdt = Temporal.ZonedDateTime.from("1995-12-07T03:24-08:00[America/Los_Angeles]"); + // ISO ordinal date + console.log(zdt.year, zdt.dayOfYear); // => '1995 341' + } + + { + const zdt = Temporal.ZonedDateTime.from("2022-01-01T03:24-08:00[America/Los_Angeles]"); + // ISO week date + console.log(zdt.yearOfWeek, zdt.weekOfYear, zdt.dayOfWeek); // => '2021 52 6' + } + + { + const zdt = Temporal.ZonedDateTime.from("1995-12-07T03:24-08:00[America/Los_Angeles]"); + zdt.daysInWeek; // => 7 + } + + { + // Attempt to write some mnemonic poetry + const monthsByDays: Record = {}; + for (let month = 1; month <= 12; month++) { + const zdt = Temporal.Now.zonedDateTimeISO().with({ month }); + monthsByDays[zdt.daysInMonth] = (monthsByDays[zdt.daysInMonth] || []).concat(zdt); + } + + const strings = monthsByDays[30].map(zdt => zdt.toLocaleString("en", { month: "long" })); + // Shuffle to improve poem as determined empirically + strings.unshift(strings.pop()!); + const format = new Intl.ListFormat("en"); + const poem = `Thirty days hath ${format.format(strings)}`; + + console.log(poem); + } + + { + const zdt = Temporal.Now.zonedDateTimeISO(); + const percent = zdt.dayOfYear / zdt.daysInYear; + `The year is ${percent.toLocaleString("en", { style: "percent" })} over!`; + // example output: "The year is 10% over!" + } + + { + const zdt = Temporal.ZonedDateTime.from("1900-01-01T12:00+09:00[Asia/Tokyo]"); + zdt.monthsInYear; // => 12 + } + + { + // Is this year a leap year? + const zdt = Temporal.Now.zonedDateTimeISO(); + zdt.inLeapYear; // example output: true + // Is 2100 a leap year? (no, because it's divisible by 100 and not 400) + zdt.with({ year: 2100 }).inLeapYear; // => false + } + + { + const zdt = Temporal.ZonedDateTime.from("2010-11-07T23:00:00-03:30[America/St_Johns]"); + zdt.hoursInDay; // 25 + } + + { + const zdt = Temporal.ZonedDateTime.from("2020-11-01T01:30-07:00[America/Los_Angeles]"); + zdt.offsetNanoseconds; + // => -25200000000000 + // (-7 * 3600 * 1e9) + } + + { + const zdt = Temporal.ZonedDateTime.from("2020-11-01T01:30-07:00[America/Los_Angeles]"); + zdt.offset; + // => '-07:00' + zdt.withTimeZone("Asia/Kolkata").offset; + // => '+05:30' + + const minus8Hours = "-08:00"; + const daylightTime0130 = Temporal.ZonedDateTime.from("2020-11-01T01:30-07:00[America/Los_Angeles]"); + // => 2020-11-01T01:30:00-07:00[America/Los_Angeles] + // This is Pacific Daylight Time 1:30AM + const repeated0130 = daylightTime0130.with({ offset: minus8Hours }); + // => 2020-11-01T01:30:00-08:00[America/Los_Angeles] + // This is Pacific Standard Time 1:30AM + } + + { + const zdt = Temporal.ZonedDateTime.from("1995-12-07T03:24:00-06:00[America/Chicago]"); + zdt.with({ year: 2015, minute: 31 }); // => 2015-12-07T03:31:00-06:00[America/Chicago] + } + + { + const zdt = Temporal.ZonedDateTime.from("2015-12-07T03:24:30.000003500-08:00[America/Los_Angeles]"); + zdt.withPlainTime({ hour: 10 }); // => 2015-12-07T10:00:00-08:00[America/Los_Angeles] + const time = Temporal.PlainTime.from("11:22"); + zdt.withPlainTime(time); // => 2015-12-07T11:22:00-08:00[America/Los_Angeles] + zdt.withPlainTime("12:34"); // => 2015-12-07T12:34:00-08:00[America/Los_Angeles] + + // easier for chaining + zdt.add({ days: 2, hours: 22 }).withPlainTime("00:00"); // => 2015-12-10T00:00:00-08:00[America/Los_Angeles] + } + + { + const zdt = Temporal.ZonedDateTime.from("1995-12-07T03:24:30+09:00[Asia/Tokyo]"); + zdt.toString(); // => '1995-12-07T03:24:30+09:00[Asia/Tokyo]' + zdt.withTimeZone("Africa/Accra").toString(); // => '1995-12-06T18:24:30+00:00[Africa/Accra]' + } + + { + const zdt = Temporal.ZonedDateTime.from("1995-12-07T03:24:30.000003500+09:00[Asia/Tokyo][u-ca=japanese]"); + `${zdt.era} ${zdt.eraYear}`; // => 'heisei 7' + zdt.withCalendar("gregory").eraYear; // => 1995 + } + + { + const zdt = Temporal.ZonedDateTime.from("2020-03-08T00:00-08:00[America/Los_Angeles]"); + // Add a day to get midnight on the day after DST starts + const laterDay = zdt.add({ days: 1 }); + // => 2020-03-09T00:00:00-07:00[America/Los_Angeles] + // Note that the new offset is different, indicating the result is adjusted for DST. + laterDay.since(zdt, { largestUnit: "hour" }).hours; + // => 23 + // because one clock hour lost to DST + + const laterHours = zdt.add({ hours: 24 }); + // => 2020-03-09T01:00:00-07:00[America/Los_Angeles] + // Adding time units doesn't adjust for DST. Result is 1:00AM: 24 real-world + // hours later because a clock hour was skipped by DST. + laterHours.since(zdt, { largestUnit: "hour" }).hours; // => 24 + } + + { + const zdt = Temporal.ZonedDateTime.from("2020-03-09T00:00-07:00[America/Los_Angeles]"); + // Add a day to get midnight on the day after DST starts + const earlierDay = zdt.subtract({ days: 1 }); + // => 2020-03-08T00:00:00-08:00[America/Los_Angeles] + // Note that the new offset is different, indicating the result is adjusted for DST. + earlierDay.since(zdt, { largestUnit: "hour" }).hours; + // => -23 + // because one clock hour lost to DST + + const earlierHours = zdt.subtract({ hours: 24 }); + // => 2020-03-07T23:00:00-08:00[America/Los_Angeles] + // Subtracting time units doesn't adjust for DST. Result is 11:00PM: 24 real-world + // hours earlier because a clock hour was skipped by DST. + earlierHours.since(zdt, { largestUnit: "hour" }).hours; // => -24 + } + + { + const zdt1 = Temporal.ZonedDateTime.from("1995-12-07T03:24:30.000003500+05:30[Asia/Kolkata]"); + const zdt2 = Temporal.ZonedDateTime.from("2019-01-31T15:30+05:30[Asia/Kolkata]"); + zdt1.until(zdt2); + // => PT202956H5M29.9999965S + zdt1.until(zdt2, { largestUnit: "year" }); + // => P23Y1M24DT12H5M29.9999965S + zdt2.until(zdt1, { largestUnit: "year" }); + // => -P23Y1M24DT12H5M29.9999965S + zdt1.until(zdt2, { largestUnit: "nanosecond" }); + // => PT730641929.999996544S + // (precision lost) + + // Rounding, for example if you don't care about sub-seconds + zdt1.until(zdt2, { smallestUnit: "second" }); + // => PT202956H5M29S + + // Months and years can be different lengths + const [jan1, feb1, mar1] = [1, 2, 3].map(month => Temporal.ZonedDateTime.from({ year: 2020, month, day: 1, timeZone: "Asia/Seoul" })); + jan1.until(feb1, { largestUnit: "day" }); // => P31D + jan1.until(feb1, { largestUnit: "month" }); // => P1M + feb1.until(mar1, { largestUnit: "day" }); // => P29D + feb1.until(mar1, { largestUnit: "month" }); // => P1M + jan1.until(mar1, { largestUnit: "day" }); // => P60D + } + + { + const zdt1 = Temporal.ZonedDateTime.from("1995-12-07T03:24:30.000003500+05:30[Asia/Kolkata]"); + const zdt2 = Temporal.ZonedDateTime.from("2019-01-31T15:30+05:30[Asia/Kolkata]"); + zdt2.since(zdt1); // => PT202956H5M29.9999965S + } + + { + const zdt = Temporal.ZonedDateTime.from("1995-12-07T03:24:30.000003500-08:00[America/Los_Angeles]"); + + // Round to a particular unit + zdt.round({ smallestUnit: "hour" }); + // => 1995-12-07T03:00:00-08:00[America/Los_Angeles] + // Round to an increment of a unit, e.g. half an hour: + zdt.round({ roundingIncrement: 30, smallestUnit: "minute" }); + // => 1995-12-07T03:30:00-08:00[America/Los_Angeles] + // Round to the same increment but round down instead: + zdt.round({ roundingIncrement: 30, smallestUnit: "minute", roundingMode: "floor" }); + // => 1995-12-07T03:00:00-08:00[America/Los_Angeles] + } + + { + const zdt = Temporal.ZonedDateTime.from("2015-10-18T12:00-02:00[America/Sao_Paulo]"); + zdt.startOfDay(); // => 2015-10-18T01:00:00-02:00[America/Sao_Paulo] + } + + { + let duration: Temporal.Duration; + // How long until the next offset change from now, in the current location? + const tz = Temporal.Now.timeZoneId(); + const now = Temporal.Now.zonedDateTimeISO(tz); + const nextTransition = now.getTimeZoneTransition("next"); + duration = nextTransition!.since(now); + duration.toLocaleString(); // output will vary + + // How long until the previous offset change from now, in the current location? + const previousTransition = now.getTimeZoneTransition("previous"); + duration = now.since(previousTransition!); + duration.toLocaleString(); // output will vary + } + + { + const zdt1 = Temporal.ZonedDateTime.from("1995-12-07T03:24:30.000003500+01:00[Europe/Paris]"); + const zdt2 = Temporal.ZonedDateTime.from("1995-12-07T03:24:30.000003500+01:00[Europe/Brussels]"); + zdt1.equals(zdt2); // => false (same offset but different time zones) + zdt1.equals(zdt1); // => true + + // To compare time zone IDs, use withTimeZone() with each ID on the same + // ZonedDateTime instance, and use equals() to compare + const kolkata = zdt1.withTimeZone("Asia/Kolkata"); + kolkata.equals(zdt1.withTimeZone("Asia/Calcutta")); // => true + + // Offset time zones are never equivalent to named time zones + kolkata.equals(zdt1.withTimeZone("+05:30")); // => false + const zeroOffset = zdt1.withTimeZone("+00:00"); + zeroOffset.equals(zdt1.withTimeZone("UTC")); // => false + + // For offset time zones, any valid format is accepted + zeroOffset.equals(zdt1.withTimeZone("+00:00")); // => true + zeroOffset.equals(zdt1.withTimeZone("+0000")); // => true + zeroOffset.equals(zdt1.withTimeZone("+00")); // => true + } + + { + let zdt: Temporal.ZonedDateTime; + zdt = Temporal.ZonedDateTime.from({ year: 2019, month: 12, day: 1, hour: 12, timeZone: "Africa/Lagos" }); + zdt.toString(); // => '2019-12-01T12:00:00+01:00[Africa/Lagos]' + zdt = zdt.withCalendar("japanese"); + zdt.toString(); // => '2019-12-01T12:00:00+01:00[Africa/Lagos][u-ca=japanese]' + } + + { + const zdt = Temporal.ZonedDateTime.from("2019-12-01T12:00+01:00[Europe/Berlin]"); + zdt.toLocaleString(); // example output: 12/1/2019, 12:00:00 PM + zdt.toLocaleString("de-DE"); // => '1.12.2019, 12:00:00 MEZ' + const options = { weekday: "long", year: "numeric", month: "long", day: "numeric" } as const; + zdt.toLocaleString("de-DE", options); // => 'Sonntag, 1. Dezember 2019' + /* WRONG */ zdt.toLocaleString("de-DE", { timeZone: "Pacific/Auckland" }); + // => RangeError: Time zone option Pacific/Auckland does not match actual time zone Europe/Berlin + zdt.withTimeZone("Pacific/Auckland").toLocaleString("de-DE"); // => '2.12.2019, 0:00:00 GMT+13' + zdt.toLocaleString("en-US-u-nu-fullwide-hc-h12"); // => '12/1/2019, 12:00:00 PM GMT+1' + } + + { + const zdt = Temporal.ZonedDateTime.from("1995-12-07T03:24:30+02:00[Africa/Johannesburg]"); + zdt.toInstant(); // => 1995-12-07T01:24:30Z + zdt.toPlainDateTime(); // => 1995-12-07T03:24:30 + zdt.toPlainDate(); // => 1995-12-07 + zdt.toPlainTime(); // => 03:24:30 + zdt.toPlainDate().toPlainYearMonth(); // => 1995-12 + zdt.toPlainDate().toPlainMonthDay(); // => 12-07 + } + + { + // Pi day in 2020 + const date = new Temporal.PlainDate(2020, 3, 14); // => 2020-03-14 + } + + { + let date: Temporal.PlainDate; + + date = Temporal.PlainDate.from("2006-08-24"); // => 2006-08-24 + date = Temporal.PlainDate.from("20060824"); // => 2006-08-24 + date = Temporal.PlainDate.from("2006-08-24T15:43:27"); // => 2006-08-24 + date = Temporal.PlainDate.from("2006-08-24T15:43:27+01:00[Europe/Brussels]"); + // => 2006-08-24 + date === Temporal.PlainDate.from(date); // => false + + date = Temporal.PlainDate.from({ year: 2006, month: 8, day: 24 }); // => 2006-08-24 + date = Temporal.PlainDate.from(Temporal.PlainDateTime.from("2006-08-24T15:43:27")); + // => 2006-08-24 + // same as above; Temporal.PlainDateTime has year, month, and day properties + + date = Temporal.PlainDate.from({ year: 1427, month: 8, day: 1, calendar: "islamic" }); + // => 2006-08-24[u-ca=islamic] + + // Different overflow modes + date = Temporal.PlainDate.from({ year: 2001, month: 13, day: 1 }, { overflow: "constrain" }); + // => 2001-12-01 + date = Temporal.PlainDate.from({ year: 2001, month: 1, day: 32 }, { overflow: "constrain" }); + // => 2001-01-31 + date = Temporal.PlainDate.from({ year: 2001, month: 13, day: 1 }, { overflow: "reject" }); + // => throws + date = Temporal.PlainDate.from({ year: 2001, month: 1, day: 32 }, { overflow: "reject" }); + // => throws + } + + { + const one = Temporal.PlainDate.from("2006-08-24"); + const two = Temporal.PlainDate.from("2015-07-14"); + const three = Temporal.PlainDate.from("1930-02-18"); + const sorted = [one, two, three].sort(Temporal.PlainDate.compare); + sorted.join(" "); // => '1930-02-18 2006-08-24 2015-07-14' + } + + { + let date: Temporal.PlainDate; + + date = Temporal.PlainDate.from("2006-08-24"); + date.year; // => 2006 + date.month; // => 8 + date.monthCode; // => 'M08' + date.day; // => 24 + + date = Temporal.PlainDate.from("2019-02-23[u-ca=hebrew]"); + date.year; // => 5779 + date.month; // => 6 + date.monthCode; // => 'M05L' + date.day; // => 18 + } + + { + const date = Temporal.PlainDate.from("-000015-01-01[u-ca=gregory]"); + date.era; + // => 'bce' + date.eraYear; + // => 16 + date.year; + // => -15 + } + + { + const date = Temporal.PlainDate.from("2006-08-24"); + ["MON", "TUE", "WED", "THU", "FRI", "SAT", "SUN"][date.dayOfWeek - 1]; // => 'THU' + } + + { + const date = Temporal.PlainDate.from("2006-08-24"); + // ISO ordinal date + console.log(date.year, date.dayOfYear); // => '2006 236' + } + + { + const date = Temporal.PlainDate.from("2022-01-01"); + // ISO week date + console.log(date.yearOfWeek, date.weekOfYear, date.dayOfWeek); // => '2021 52 6' + } + + { + const date = Temporal.PlainDate.from("2006-08-24"); + date.daysInWeek; // => 7 + } + + { + // Attempt to write some mnemonic poetry + const monthsByDays: Record = {}; + for (let month = 1; month <= 12; month++) { + const date = Temporal.Now.plainDateISO().with({ month }); + monthsByDays[date.daysInMonth] = (monthsByDays[date.daysInMonth] || []).concat(date); + } + + const strings = monthsByDays[30].map(date => date.toLocaleString("en", { month: "long" })); + // Shuffle to improve poem as determined empirically + strings.unshift(strings.pop()!); + const format = new Intl.ListFormat("en"); + const poem = `Thirty days hath ${format.format(strings)}`; + + console.log(poem); + } + + { + const date = Temporal.Now.plainDateISO(); + const percent = date.dayOfYear / date.daysInYear; + `The year is ${percent.toLocaleString("en", { style: "percent" })} over!`; + // example output: "The year is 10% over!" + } + + { + const date = Temporal.PlainDate.from("1900-01-01"); + date.monthsInYear; // => 12 + } + + { + // Is this year a leap year? + const date = Temporal.Now.plainDateISO(); + date.inLeapYear; // example output: true + // Is 2100 a leap year? (no, because it's divisible by 100 and not 400) + date.with({ year: 2100 }).inLeapYear; // => false + } + + { + const date = Temporal.PlainDate.from("2006-01-24"); + // What's the first day of this month? + date.with({ day: 1 }); // => 2006-01-01 + // What's the last day of the next month? + const nextMonthDate = date.add({ months: 1 }); + nextMonthDate.with({ day: nextMonthDate.daysInMonth }); // => 2006-02-28 + } + + { + const date = Temporal.PlainDate.from("2006-08-24[u-ca=japanese]"); + date.withCalendar("iso8601"); // => 2006-08-24 + } + + { + let date: Temporal.PlainDate; + + date = Temporal.PlainDate.from("2006-08-24"); + date.add({ years: 20, months: 4 }); // => 2026-12-24 + + date = Temporal.PlainDate.from("2019-01-31"); + date.add({ months: 1 }); // => 2019-02-28 + date.add({ months: 1 }, { overflow: "reject" }); // => throws + } + + { + let date: Temporal.PlainDate; + + date = Temporal.PlainDate.from("2006-08-24"); + date.subtract({ years: 20, months: 4 }); // => 1986-04-24 + + date = Temporal.PlainDate.from("2019-03-31"); + date.subtract({ months: 1 }); // => 2019-02-28 + date.subtract({ months: 1 }, { overflow: "reject" }); // => throws + } + + { + const earlier = Temporal.PlainDate.from("2006-08-24"); + const later = Temporal.PlainDate.from("2019-01-31"); + earlier.until(later); // => P4543D + earlier.until(later, { largestUnit: "year" }); // => P12Y5M7D + later.until(earlier, { largestUnit: "year" }); // => -P12Y5M7D + + // If you really need to calculate the difference between two Dates in + // hours, you can eliminate the ambiguity by explicitly choosing the + // point in time from which you want to reckon the difference. For + // example, using noon: + const noon = Temporal.PlainTime.from("12:00"); + earlier.toPlainDateTime(noon).until(later.toPlainDateTime(noon), { largestUnit: "hour" }); + // => PT109032H + + const newyear = Temporal.PlainDate.from("2020-01-01"); + newyear.until("2020-01-15", { smallestUnit: "month", roundingMode: "halfExpand" }); + // => PT0S + newyear.until("2020-01-16", { smallestUnit: "month", roundingMode: "halfExpand" }); + // => PT0S (mid-month dates rounded down to match `Temporal.PlainDateTime` behavior) + newyear.until("2020-01-17", { smallestUnit: "month", roundingMode: "halfExpand" }); + // => PT1M + } + + { + const earlier = Temporal.PlainDate.from("2006-08-24"); + const later = Temporal.PlainDate.from("2019-01-31"); + later.since(earlier); // => P4543D + } + + { + const date = Temporal.PlainDate.from("2006-08-24"); + const other = Temporal.PlainDate.from("2019-01-31"); + date.equals(other); // => false + date.equals(date); // => true + } + + { + const date = Temporal.PlainDate.from("2006-08-24"); + date.toString(); // => '2006-08-24' + } + + { + const date = Temporal.PlainDate.from("2006-08-24"); + date.toLocaleString(); // example output: 8/24/2006 + date.toLocaleString("de-DE"); // example output: '24.8.2006' + date.toLocaleString("de-DE", { weekday: "long" }); // => 'Donnerstag' + date.toLocaleString("en-US-u-nu-fullwide"); // => '8/24/2006' + } + + { + const plainDate = Temporal.PlainDate.from("2006-08-24"); + const plainTime = Temporal.PlainTime.from("15:23:30.003"); + plainDate.toZonedDateTime({ timeZone: "America/Los_Angeles", plainTime }); + // => 2006-08-24T15:23:30.003-07:00[America/Los_Angeles] + plainDate.toZonedDateTime({ timeZone: "America/Los_Angeles" }); + // => 2006-08-24T00:00:00-07:00[America/Los_Angeles] + } + + { + const date = Temporal.PlainDate.from("2006-08-24"); + const time = Temporal.PlainTime.from("15:23:30.003"); + date.toPlainDateTime(time); // => 2006-08-24T15:23:30.003 + date.toPlainDateTime(); // => 2006-08-24T00:00:00 + } + + { + const date = Temporal.PlainDate.from("2006-08-24"); + date.toPlainYearMonth(); // => 2006-08 + date.toPlainMonthDay(); // => 08-24 + } + + { + // Leet hour + const time = new Temporal.PlainTime(13, 37); // => 13:37:00 + } + + { + let time: Temporal.PlainTime; + + time = Temporal.PlainTime.from("03:24:30"); // => 03:24:30 + time = Temporal.PlainTime.from("032430"); // => 03:24:30 + time = Temporal.PlainTime.from("1995-12-07T03:24:30"); // => 03:24:30 + time = Temporal.PlainTime.from("1995-12-07T03:24:30+01:00[Europe/Brussels]"); + // => 03:24:30 + // (same as above; time zone is ignored) + time === Temporal.PlainTime.from(time); // => false + + time = Temporal.PlainTime.from({ + hour: 19, + minute: 39, + second: 9, + millisecond: 68, + microsecond: 346, + nanosecond: 205, + }); // => 19:39:09.068346205 + time = Temporal.PlainTime.from({ hour: 19, minute: 39, second: 9 }); // => 19:39:09 + time = Temporal.PlainTime.from(Temporal.PlainDateTime.from("2020-02-15T19:39:09")); + // => 19:39:09 + // (same as above; Temporal.PlainDateTime has hour, minute, etc. properties) + + // Different overflow modes + time = Temporal.PlainTime.from({ hour: 15, minute: 60 }, { overflow: "constrain" }); + // => 15:59:00 + time = Temporal.PlainTime.from({ hour: 15, minute: -1 }, { overflow: "constrain" }); + // => 15:00:00 + time = Temporal.PlainTime.from({ hour: 15, minute: 60 }, { overflow: "reject" }); + // => throws + time = Temporal.PlainTime.from({ hour: 15, minute: -1 }, { overflow: "reject" }); + // => throws + } + + { + const one = Temporal.PlainTime.from("03:24"); + const two = Temporal.PlainTime.from("01:24"); + const three = Temporal.PlainTime.from("01:24:05"); + const sorted = [one, two, three].sort(Temporal.PlainTime.compare); + sorted.join(" "); // => '01:24:00 01:24:05 03:24:00' + } + + { + // Backward transitions will repeat clock times + const zdtDst = Temporal.ZonedDateTime.from("2020-11-01T01:45-07:00[America/Los_Angeles]"); + const zdtStandard = Temporal.ZonedDateTime.from("2020-11-01T01:30-08:00[America/Los_Angeles]"); + // The "first" 1:45 (in Daylight Time) is earlier than the "second" 1:30 (in Standard Time) + Temporal.ZonedDateTime.compare(zdtDst, zdtStandard); // => -1 + // 1:45 is later than 1:30 when looking at a wall clock + Temporal.PlainTime.compare(zdtDst, zdtStandard); // => 1 + + // Forward transitions will skip clock times. Skipped times will be disambiguated. + const zdtBase = Temporal.ZonedDateTime.from("2020-03-08[America/Los_Angeles]"); + const timeSkipped = Temporal.PlainTime.from("02:30"); + const timeValid = Temporal.PlainTime.from("03:30"); + const zdtSkipped = zdtBase.withPlainTime(timeSkipped); + const zdtValid = zdtBase.withPlainTime(timeValid); + // The skipped time 2:30AM is disambiguated to 3:30AM, so the instants are equal + Temporal.ZonedDateTime.compare(zdtSkipped, zdtValid); // => 0 + // 2:30 is earlier than 3:30 on a wall clock + Temporal.PlainTime.compare(timeSkipped, timeValid); // => -1 + } + + { + const time = Temporal.PlainTime.from("19:39:09.068346205"); + time.hour; // => 19 + time.minute; // => 39 + time.second; // => 9 + time.millisecond; // => 68 + time.microsecond; // => 346 + time.nanosecond; // => 205 + } + + { + const time = Temporal.PlainTime.from("19:39:09.068346205"); + // What's the top of the next hour? + time.add({ hours: 1 }).with({ + minute: 0, + second: 0, + millisecond: 0, + microsecond: 0, + nanosecond: 0, + }); // => 20:00:00 + } + + { + const time = Temporal.PlainTime.from("19:39:09.068346205"); + time.add({ minutes: 5, nanoseconds: 800 }); // => 19:44:09.068347005 + } + + { + const time = Temporal.PlainTime.from("19:39:09.068346205"); + time.subtract({ minutes: 5, nanoseconds: 800 }); // => 19:34:09.068345405 + } + + { + const time = Temporal.PlainTime.from("20:13:20.971398099"); + time.until(Temporal.PlainTime.from("22:39:09.068346205")); // => PT2H25M48.096948106S + time.until(Temporal.PlainTime.from("19:39:09.068346205")); // => -PT34M11.903051894S + + // Rounding, for example if you don't care about sub-seconds + time.until(Temporal.PlainTime.from("22:39:09.068346205"), { smallestUnit: "second" }); + // => PT2H25M48S + } + + { + const time = Temporal.PlainTime.from("20:13:20.971398099"); + time.since(Temporal.PlainTime.from("19:39:09.068346205")); // => PT34M11.903051894S + time.since(Temporal.PlainTime.from("22:39:09.068346205")); // => -PT2H25M48.096948106S + } + + { + const time = Temporal.PlainTime.from("19:39:09.068346205"); + + // Round to a particular unit + time.round({ smallestUnit: "hour" }); // => 20:00:00 + // Round to an increment of a unit, e.g. half an hour: + time.round({ roundingIncrement: 30, smallestUnit: "minute" }); + // => 19:30:00 + // Round to the same increment but round up instead: + time.round({ roundingIncrement: 30, smallestUnit: "minute", roundingMode: "ceil" }); + // => 20:00:00 + } + + { + const time = Temporal.PlainTime.from("19:39:09.068346205"); + const other = Temporal.PlainTime.from("20:13:20.971398099"); + time.equals(other); // => false + time.equals(time); // => true + } + + { + const time = Temporal.PlainTime.from("19:39:09.068346205"); + time.toString(); // => '19:39:09.068346205' + + time.toString({ smallestUnit: "minute" }); // => '19:39' + time.toString({ fractionalSecondDigits: 0 }); // => '19:39:09' + time.toString({ fractionalSecondDigits: 4 }); // => '19:39:09.0683' + time.toString({ fractionalSecondDigits: 5, roundingMode: "halfExpand" }); + // => '19:39:09.06835' + } + + { + const time = Temporal.PlainTime.from("19:39:09.068346205"); + time.toLocaleString(); // example output: '7:39:09 PM' + time.toLocaleString("de-DE"); // example output: '19:39:09' + time.toLocaleString("de-DE", { timeZone: "Europe/Berlin" }); // => '19:39:09' + time.toLocaleString("en-US-u-nu-fullwide-hc-h24"); // => '19:39:09' + } + + { + // Leet hour on pi day in 2020 + const datetime = new Temporal.PlainDateTime(2020, 3, 14, 13, 37); // => 2020-03-14T13:37:00 + } + + { + let dt: Temporal.PlainDateTime; + + dt = Temporal.PlainDateTime.from("1995-12-07T03:24:30"); + dt = Temporal.PlainDateTime.from("19951207T032430"); + dt = Temporal.PlainDateTime.from("1995-12-07T03:24:30+01:00[Europe/Brussels]"); + // => 1995-12-07T03:24:30 + // same as above; time zone is ignored + dt === Temporal.PlainDateTime.from(dt); // => false + + dt = Temporal.PlainDateTime.from({ + year: 1995, + month: 12, + day: 7, + hour: 3, + minute: 24, + second: 30, + millisecond: 0, + microsecond: 3, + nanosecond: 500, + }); // => 1995-12-07T03:24:30.0000035 + dt = Temporal.PlainDateTime.from({ year: 1995, month: 12, day: 7 }); // => 1995-12-07T00:00:00 + dt = Temporal.PlainDateTime.from(Temporal.PlainDate.from("1995-12-07T03:24:30")); + // => 1995-12-07T00:00:00 + // same as above; Temporal.PlainDate has year, month, and day properties + + dt = Temporal.PlainDateTime.from({ year: 5756, month: 3, day: 14, hour: 3, minute: 24, second: 30, calendar: "hebrew" }); + // => 1995-12-07T03:24:30[u-ca=hebrew] + + // Different overflow modes + dt = Temporal.PlainDateTime.from({ year: 2001, month: 13, day: 1 }, { overflow: "constrain" }); + // => 2001-12-01T00:00:00 + dt = Temporal.PlainDateTime.from({ year: 2001, month: 1, day: 32 }, { overflow: "constrain" }); + // => 2001-01-31T00:00:00 + dt = Temporal.PlainDateTime.from({ year: 2001, month: 1, day: 1, hour: 25 }, { overflow: "constrain" }); + // => 2001-01-01T23:00:00 + dt = Temporal.PlainDateTime.from({ year: 2001, month: 1, day: 1, minute: 60 }, { overflow: "constrain" }); + // => 2001-01-01T00:59:00 + dt = Temporal.PlainDateTime.from({ year: 2001, month: 13, day: 1 }, { overflow: "reject" }); + // => throws + dt = Temporal.PlainDateTime.from({ year: 2001, month: 1, day: 32 }, { overflow: "reject" }); + // => throws + dt = Temporal.PlainDateTime.from({ year: 2001, month: 1, day: 1, hour: 25 }, { overflow: "reject" }); + // => throws + dt = Temporal.PlainDateTime.from({ year: 2001, month: 1, day: 1, minute: 60 }, { overflow: "reject" }); + // => throws + } + + { + const one = Temporal.PlainDateTime.from("1995-12-07T03:24"); + const two = Temporal.PlainDateTime.from("1995-12-07T01:24"); + const three = Temporal.PlainDateTime.from("2015-12-07T01:24"); + const sorted = [one, two, three].sort(Temporal.PlainDateTime.compare); + sorted.join(" "); + // => '1995-12-07T01:24:00 1995-12-07T03:24:00 2015-12-07T01:24:00' + } + + { + let dt: Temporal.PlainDateTime; + + dt = Temporal.PlainDateTime.from("1995-12-07T03:24:30.000003500"); + dt.year; // => 1995 + dt.month; // => 12 + dt.monthCode; // => 'M12' + dt.day; // => 7 + dt.hour; // => 3 + dt.minute; // => 24 + dt.second; // => 30 + dt.millisecond; // => 0 + dt.microsecond; // => 3 + dt.nanosecond; // => 500 + + dt = Temporal.PlainDateTime.from("2019-02-23T03:24:30.000003500[u-ca=hebrew]"); + dt.year; // => 5779 + dt.month; // => 6 + dt.monthCode; // => 'M05L' + dt.day; // => 18 + dt.hour; // => 3 + dt.minute; // => 24 + dt.second; // => 30 + dt.millisecond; // => 0 + dt.microsecond; // => 3 + dt.nanosecond; // => 500 + } + + { + const date = Temporal.PlainDateTime.from("-000015-01-01T12:30[u-ca=gregory]"); + date.era; + // => 'bce' + date.eraYear; + // => 16 + date.year; + // => -15 + } + + { + const dt = Temporal.PlainDateTime.from("1995-12-07T03:24:30.000003500"); + ["MON", "TUE", "WED", "THU", "FRI", "SAT", "SUN"][dt.dayOfWeek - 1]; // => 'THU' + } + + { + const dt = Temporal.PlainDateTime.from("1995-12-07T03:24:30.000003500"); + // ISO ordinal date + console.log(dt.year, dt.dayOfYear); // => '1995 341' + } + + { + const dt = Temporal.PlainDateTime.from("2022-01-01T03:24:30.000003500"); + // ISO week date + console.log(dt.yearOfWeek, dt.weekOfYear, dt.dayOfWeek); // => '2021 52 6' + } + + { + const dt = Temporal.PlainDateTime.from("1995-12-07T03:24:30.000003500"); + dt.daysInWeek; // => 7 + } + + { + // Attempt to write some mnemonic poetry + const monthsByDays: Record = {}; + for (let month = 1; month <= 12; month++) { + const dt = Temporal.Now.plainDateTimeISO().with({ month }); + monthsByDays[dt.daysInMonth] = (monthsByDays[dt.daysInMonth] || []).concat(dt); + } + + const strings = monthsByDays[30].map(dt => dt.toLocaleString("en", { month: "long" })); + // Shuffle to improve poem as determined empirically + strings.unshift(strings.pop()!); + const format = new Intl.ListFormat("en"); + const poem = `Thirty days hath ${format.format(strings)}`; + + console.log(poem); + } + + { + const dt = Temporal.Now.plainDateTimeISO(); + const percent = dt.dayOfYear / dt.daysInYear; + `The year is ${percent.toLocaleString("en", { style: "percent" })} over!`; + // example output: "The year is 10% over!" + } + + { + const dt = Temporal.PlainDate.from("1900-01-01T12:00"); + dt.monthsInYear; // => 12 + } + + { + // Is this year a leap year? + const dt = Temporal.Now.plainDateTimeISO(); + dt.inLeapYear; // example output: true + // Is 2100 a leap year? (no, because it's divisible by 100 and not 400) + dt.with({ year: 2100 }).inLeapYear; // => false + } + + { + const dt = Temporal.PlainDateTime.from("1995-12-07T03:24:30.000003500"); + dt.with({ year: 2015, second: 31 }); // => 2015-12-07T03:24:31.0000035 + } + + { + const dt = Temporal.PlainDateTime.from("2015-12-07T03:24:30.000003500"); + dt.withPlainTime({ hour: 10 }); // => 2015-12-07T10:00:00 + const time = Temporal.PlainTime.from("11:22"); + dt.withPlainTime(time); // => 2015-12-07T11:22:00 + dt.withPlainTime("12:34"); // => 2015-12-07T12:34:00 + + // easier for chaining + dt.add({ days: 2, hours: 22 }).withPlainTime("00:00"); // => 2015-12-10T00:00:00 + } + + { + const dt = Temporal.PlainDateTime.from("1995-12-07T03:24:30.000003500[u-ca=japanese]"); + dt.withCalendar("iso8601"); // => 1995-12-07T03:24:30.0000035 + } + + { + let dt: Temporal.PlainDateTime; + + dt = Temporal.PlainDateTime.from("1995-12-07T03:24:30.000003500"); + dt.add({ years: 20, months: 4, nanoseconds: 500 }); // => 2016-04-07T03:24:30.000004 + + dt = Temporal.PlainDateTime.from("2019-01-31T15:30"); + dt.add({ months: 1 }); // => 2019-02-28T15:30:00 + dt.add({ months: 1 }, { overflow: "reject" }); // => throws + } + + { + let dt: Temporal.PlainDateTime; + + dt = Temporal.PlainDateTime.from("1995-12-07T03:24:30.000003500"); + dt.subtract({ years: 20, months: 4, nanoseconds: 500 }); // => 1975-08-07T03:24:30.000003 + + dt = Temporal.PlainDateTime.from("2019-03-31T15:30"); + dt.subtract({ months: 1 }); // => 2019-02-28T15:30:00 + dt.subtract({ months: 1 }, { overflow: "reject" }); // => throws + } + + { + const dt1 = Temporal.PlainDateTime.from("1995-12-07T03:24:30.000003500"); + const dt2 = Temporal.PlainDateTime.from("2019-01-31T15:30"); + dt1.until(dt2); + // => P8456DT12H5M29.9999965S + dt1.until(dt2, { largestUnit: "year" }); + // => P23Y1M24DT12H5M29.9999965S + dt2.until(dt1, { largestUnit: "year" }); + // => -P23Y1M24DT12H5M29.9999965S + dt1.until(dt2, { largestUnit: "nanosecond" }); + // => PT730641929.999996544S + // (precision lost) + + // Rounding, for example if you don't care about sub-seconds + dt1.until(dt2, { smallestUnit: "second" }); + // => P8456DT12H5M29S + + // Months and years can be different lengths + const [jan1, feb1, mar1] = [1, 2, 3].map(month => Temporal.PlainDateTime.from({ year: 2020, month, day: 1 })); + jan1.until(feb1); // => P31D + jan1.until(feb1, { largestUnit: "month" }); // => P1M + feb1.until(mar1); // => P29D + feb1.until(mar1, { largestUnit: "month" }); // => P1M + jan1.until(mar1); // => P60D + } + + { + const dt1 = Temporal.PlainDateTime.from("1995-12-07T03:24:30.000003500"); + const dt2 = Temporal.PlainDateTime.from("2019-01-31T15:30"); + dt2.since(dt1); // => P8456DT12H5M29.9999965S + } + + { + const dt = Temporal.PlainDateTime.from("1995-12-07T03:24:30.000003500"); + + // Round to a particular unit + dt.round({ smallestUnit: "hour" }); // => 1995-12-07T03:00:00 + // Round to an increment of a unit, e.g. half an hour: + dt.round({ roundingIncrement: 30, smallestUnit: "minute" }); + // => 1995-12-07T03:30:00 + // Round to the same increment but round down instead: + dt.round({ roundingIncrement: 30, smallestUnit: "minute", roundingMode: "floor" }); + // => 1995-12-07T03:00:00 + } + + { + const dt1 = Temporal.PlainDateTime.from("1995-12-07T03:24:30.000003500"); + const dt2 = Temporal.PlainDateTime.from("2019-01-31T15:30"); + dt1.equals(dt2); // => false + dt1.equals(dt1); // => true + } + + { + const dt = Temporal.PlainDateTime.from({ + year: 1999, + month: 12, + day: 31, + hour: 23, + minute: 59, + second: 59, + millisecond: 999, + microsecond: 999, + nanosecond: 999, + }); + dt.toString(); // => '1999-12-31T23:59:59.999999999' + + dt.toString({ smallestUnit: "minute" }); // => '1999-12-31T23:59' + dt.toString({ fractionalSecondDigits: 0 }); // => '1999-12-31T23:59:59' + dt.toString({ fractionalSecondDigits: 4 }); // => '1999-12-31T23:59:59.9999' + dt.toString({ fractionalSecondDigits: 8, roundingMode: "halfExpand" }); + // => '2000-01-01T00:00:00.00000000' + } + + { + const dt = Temporal.PlainDateTime.from("1995-12-07T03:24:30.000003500"); + dt.toLocaleString(); // example output: 1995-12-07, 3:24:30 a.m. + dt.toLocaleString("de-DE"); // example output: 7.12.1995, 03:24:30 + dt.toLocaleString("de-DE", { timeZone: "Europe/Berlin", weekday: "long" }); // => 'Donnerstag' + dt.toLocaleString("en-US-u-nu-fullwide-hc-h12"); // => '12/7/1995, 3:24:30 AM' + } + + { + const dt = Temporal.PlainDateTime.from("1995-12-07T03:24:30.000003500"); + dt.toPlainDate(); // => 1995-12-07 + dt.toPlainTime(); // => 03:24:30.0000035 + dt.toPlainDate().toPlainYearMonth(); // => 1995-12 + dt.toPlainDate().toPlainMonthDay(); // => 12-07 + } + + { + // The June 2019 meeting + const ym = new Temporal.PlainYearMonth(2019, 6); + // => 2019-06 + } + + { + let ym: Temporal.PlainYearMonth; + + ym = Temporal.PlainYearMonth.from("2019-06"); // => 2019-06 + ym = Temporal.PlainYearMonth.from("2019-06-24"); // => 2019-06 + ym = Temporal.PlainYearMonth.from("2019-06-24T15:43:27"); // => 2019-06 + ym = Temporal.PlainYearMonth.from("2019-06-24T15:43:27+01:00[Europe/Brussels]"); + // => 2019-06 + ym === Temporal.PlainYearMonth.from(ym); // => false + + ym = Temporal.PlainYearMonth.from({ year: 2019, month: 6 }); // => 2019-06 + ym = Temporal.PlainYearMonth.from(Temporal.PlainDate.from("2019-06-24")); + // => 2019-06 + // (same as above; Temporal.PlainDate has year and month properties) + + // Different overflow modes + ym = Temporal.PlainYearMonth.from({ year: 2001, month: 13 }, { overflow: "constrain" }); + // => 2001-12 + ym = Temporal.PlainYearMonth.from({ year: 2001, month: 13 }, { overflow: "reject" }); + // => throws + } + + { + const one = Temporal.PlainYearMonth.from("2006-08"); + const two = Temporal.PlainYearMonth.from("2015-07"); + const three = Temporal.PlainYearMonth.from("1930-02"); + const sorted = [one, two, three].sort(Temporal.PlainYearMonth.compare); + sorted.join(" "); // => '1930-02 2006-08 2015-07' + } + + { + let ym: Temporal.PlainYearMonth; + + ym = Temporal.PlainYearMonth.from("2019-06"); + ym.year; // => 2019 + ym.month; // => 6 + ym.monthCode; // => 'M06' + + ym = Temporal.PlainYearMonth.from("2019-02-23[u-ca=hebrew]"); + ym.year; // => 5779 + ym.month; // => 6 + ym.monthCode; // => 'M05L' + } + + { + const ym = Temporal.PlainYearMonth.from("-000015-01-01[u-ca=gregory]"); + ym.era; + // => 'bce' + ym.eraYear; + // => 16 + ym.year; + // => -15 + } + + { + // Attempt to write some mnemonic poetry + const monthsByDays: Record = {}; + for (let month = 1; month <= 12; month++) { + const ym = Temporal.PlainYearMonth.from({ year: 2020, calendar: "iso8601", month }); + monthsByDays[ym.daysInMonth] = (monthsByDays[ym.daysInMonth] || []).concat(ym); + } + + const strings = monthsByDays[30].map(ym => ym.toLocaleString("en", { month: "long", calendar: "iso8601" })); + // Shuffle to improve poem as determined empirically + strings.unshift(strings.pop()!); + const format = new Intl.ListFormat("en"); + const poem = `Thirty days hath ${format.format(strings)}`; + + console.log(poem); + } + + { + const ym = Temporal.PlainYearMonth.from({ year: 2019, month: 6, calendar: "iso8601" }); + const percent = ym.daysInMonth / ym.daysInYear; + `${ym.toLocaleString("en", { month: "long", year: "numeric", calendar: "iso8601" })} was ${percent.toLocaleString("en", { style: "percent" })} of the year!`; + // => 'June 2019 was 8% of the year!' + } + + { + const ym = Temporal.PlainYearMonth.from("1900-01"); + ym.monthsInYear; // => 12 + } + + { + // Was June 2019 in a leap year? + const ym = Temporal.PlainYearMonth.from("2019-06"); + ym.inLeapYear; // => false + // Is 2100 a leap year? (no, because it's divisible by 100 and not 400) + ym.with({ year: 2100 }).inLeapYear; // => false + } + + { + const ym = Temporal.PlainYearMonth.from("2019-06"); + // Get December of that year + ym.with({ month: 12 }); // => 2019-12 + } + + { + const ym = Temporal.PlainYearMonth.from("2019-06"); + ym.add({ years: 20, months: 4 }); // => 2039-10 + } + + { + const ym = Temporal.PlainYearMonth.from("2019-06"); + ym.subtract({ years: 20, months: 4 }); // => 1999-02 + } + + { + const ym = Temporal.PlainYearMonth.from("2006-08"); + const other = Temporal.PlainYearMonth.from("2019-06"); + ym.until(other); // => P12Y10M + ym.until(other, { largestUnit: "month" }); // => P154M + other.until(ym, { largestUnit: "month" }); // => -P154M + + // If you really need to calculate the difference between two YearMonths + // in days, you can eliminate the ambiguity by explicitly choosing the + // day of the month (and if applicable, the time of that day) from which + // you want to reckon the difference. For example, using the first of + // the month to calculate a number of days: + ym.toPlainDate({ day: 1 }).until(other.toPlainDate({ day: 1 }), { largestUnit: "day" }); // => P4687D + } + + { + const ym = Temporal.PlainYearMonth.from("2019-06"); + const other = Temporal.PlainYearMonth.from("2006-08"); + ym.since(other); // => P12Y10M + } + + { + const ym = Temporal.PlainYearMonth.from("2019-06"); + const other = Temporal.PlainYearMonth.from("2006-08"); + ym.equals(other); // => false + ym.equals(ym); // => true + } + + { + const ym = Temporal.PlainYearMonth.from("2019-06"); + ym.toString(); // => '2019-06' + } + + { + const { calendar } = new Intl.DateTimeFormat().resolvedOptions(); + const ym = Temporal.PlainYearMonth.from({ year: 2019, month: 6, calendar }); + ym.toLocaleString(); // example output: '6/2019' + // Same as above, but explicitly specifying the calendar: + ym.toLocaleString(undefined, { calendar }); + + ym.toLocaleString("de-DE", { calendar }); // example output: '6.2019' + ym.toLocaleString("de-DE", { month: "long", year: "numeric", calendar }); // => 'Juni 2019' + ym.toLocaleString(`en-US-u-nu-fullwide-ca-${calendar}`); // => '6/2019' + } + + { + const ym = Temporal.PlainYearMonth.from("2019-06"); + ym.toPlainDate({ day: 24 }); // => 2019-06-24 + } + + { + let md: Temporal.PlainMonthDay; + + // Pi day + md = new Temporal.PlainMonthDay(3, 14); // => 03-14 + // Leap day + md = new Temporal.PlainMonthDay(2, 29); // => 02-29 + } + + { + let md: Temporal.PlainMonthDay; + + md = Temporal.PlainMonthDay.from("08-24"); // => 08-24 + md = Temporal.PlainMonthDay.from("0824"); // => 08-24 + md = Temporal.PlainMonthDay.from("2006-08-24"); // => 08-24 + md = Temporal.PlainMonthDay.from("2006-08-24T15:43:27"); // => 08-24 + md = Temporal.PlainMonthDay.from("2006-08-24T15:43:27+01:00[Europe/Brussels]"); + // => 08-24 + md === Temporal.PlainMonthDay.from(md); // => false + + md = Temporal.PlainMonthDay.from({ monthCode: "M08", day: 24 }); // => 08-24 + md = Temporal.PlainMonthDay.from(Temporal.PlainDate.from("2006-08-24")); + // => 08-24 + // (same as above; Temporal.PlainDate has month and day properties) + + // Different overflow modes + md = Temporal.PlainMonthDay.from({ month: 13, day: 1, year: 2000 }, { overflow: "constrain" }); + // => 12-01 + md = Temporal.PlainMonthDay.from({ month: 1, day: 32, year: 2000 }, { overflow: "constrain" }); + // => 01-31 + md = Temporal.PlainMonthDay.from({ month: 13, day: 1, year: 2000 }, { overflow: "reject" }); + // => throws + md = Temporal.PlainMonthDay.from({ month: 1, day: 32, year: 2000 }, { overflow: "reject" }); + // => throws + md = Temporal.PlainMonthDay.from({ month: 2, day: 29, year: 2001 }, { overflow: "reject" }); + // => throws (this year is not a leap year in the ISO 8601 calendar) + + // non-ISO calendars + md = Temporal.PlainMonthDay.from({ monthCode: "M05L", day: 15, calendar: "hebrew" }); + // => 1970-02-21[u-ca=hebrew] + md = Temporal.PlainMonthDay.from({ month: 6, day: 15, year: 5779, calendar: "hebrew" }); + // => 1970-02-21[u-ca=hebrew] + /* WRONG */ md = Temporal.PlainMonthDay.from({ month: 6, day: 15, calendar: "hebrew" }); + // => throws (either year or monthCode is required) + md = Temporal.PlainMonthDay.from("2019-02-20[u-ca=hebrew]"); + md.monthCode; // => 'M05L' + md.day; // => 15 + md.month; // undefined + ~~~~~ +!!! error TS2339: Property 'month' does not exist on type 'PlainMonthDay'. + // (month property is not present in this type; use monthCode instead) + } + + { + let md: Temporal.PlainMonthDay; + + md = Temporal.PlainMonthDay.from("08-24"); + md.monthCode; // => 'M08' + md.day; // => 24 + md.month; // => undefined + ~~~~~ +!!! error TS2339: Property 'month' does not exist on type 'PlainMonthDay'. + // (no `month` property; use `monthCode` instead) + + md = Temporal.PlainMonthDay.from("2019-02-20[u-ca=hebrew]"); + md.monthCode; // => 'M05L' + md.day; // => 15 + md.month; // => undefined + ~~~~~ +!!! error TS2339: Property 'month' does not exist on type 'PlainMonthDay'. + // (no `month` property; use `monthCode` instead) + } + + { + const md = Temporal.PlainMonthDay.from("11-15"); + // What's the last day of that month? + md.with({ day: 31 }); // => 11-30 + Temporal.PlainMonthDay.from("02-01").with({ day: 31 }); // => 02-29 + } + + { + const md1 = Temporal.PlainMonthDay.from("02-28"); + const md2 = Temporal.PlainMonthDay.from("02-29"); + md1.equals(md2); // => false + md1.equals("02-29"); // => false + md1.equals({ monthCode: "M02", day: 29 }); // => false + md2.equals(md2); // => true + md2.equals("02-29"); // => true + md2.equals({ monthCode: "M02", day: 29 }); // => true + } + + { + const md = Temporal.PlainMonthDay.from("08-24"); + md.toString(); // => '08-24' + } + + { + const { calendar } = new Intl.DateTimeFormat().resolvedOptions(); + const md = Temporal.PlainMonthDay.from({ monthCode: "M08", day: 24, calendar }); + md.toLocaleString(); // example output: '8/24' + // Same as above, but explicitly specifying the calendar: + md.toLocaleString(undefined, { calendar }); // example output: '8/24' + + md.toLocaleString("de-DE", { calendar }); // => '24.8.' + md.toLocaleString("de-DE", { month: "long", day: "numeric", calendar }); // => '24. August' + md.toLocaleString(`en-US-u-nu-fullwide-ca-${calendar}`); // => '8/24' + } + + { + const md = Temporal.PlainMonthDay.from({ + calendar: "japanese", + monthCode: "M01", + day: 1, + }); + + const date = md.toPlainDate({ era: "reiwa", eraYear: 2 }); // => 2020-01-01[u-ca=japanese] + } + + { + new Temporal.Duration(1, 2, 3, 4, 5, 6, 7, 987, 654, 321); // => P1Y2M3W4DT5H6M7.987654321S + new Temporal.Duration(0, 0, 0, 40); // => P40D + new Temporal.Duration(undefined, undefined, undefined, 40); // => P40D + new Temporal.Duration(); // => PT0S + } + + { + let d: Temporal.Duration; + + d = Temporal.Duration.from({ years: 1, days: 1 }); // => P1Y1D + d = Temporal.Duration.from({ days: -2, hours: -12 }); // => -P2DT12H + + Temporal.Duration.from(d) === d; // => false + + d = Temporal.Duration.from("P1Y1D"); // => P1Y1D + d = Temporal.Duration.from("-P2DT12H"); // => -P2DT12H + d = Temporal.Duration.from("P0D"); // => PT0S + } + + { + const one = Temporal.Duration.from({ hours: 79, minutes: 10 }); + const two = Temporal.Duration.from({ days: 3, hours: 7, seconds: 630 }); + const three = Temporal.Duration.from({ days: 3, hours: 6, minutes: 50 }); + const sorted1 = [one, two, three].sort(Temporal.Duration.compare); + sorted1.join(" "); + // => 'P3DT6H50M PT79H10M P3DT7H630S' + + // Sorting relative to a date, taking DST changes into account: + const relativeTo = Temporal.ZonedDateTime.from("2020-11-01T00:00-07:00[America/Los_Angeles]"); + const sorted2 = [one, two, three].sort((one, two) => Temporal.Duration.compare(one, two, { relativeTo })); + sorted2.join(" "); + // => 'PT79H10M P3DT6H50M P3DT7H630S' + } + + { + const d = Temporal.Duration.from("P1Y2M3W4DT5H6M7.987654321S"); + d.years; // => 1 + d.months; // => 2 + d.weeks; // => 3 + d.days; // => 4 + d.hours; // => 5 + d.minutes; // => 6 + d.seconds; // => 7 + d.milliseconds; // => 987 + d.microseconds; // => 654 + d.nanoseconds; // => 321 + } + + { + let d: Temporal.Duration; + + d = Temporal.Duration.from("PT0S"); + d.blank; // => true + + d = Temporal.Duration.from({ days: 0, hours: 0, minutes: 0 }); + d.blank; // => true + } + + { + let duration: Temporal.Duration; + + duration = Temporal.Duration.from({ months: 50, days: 50, hours: 50, minutes: 100 }); + // Perform a balance operation using additional ISO 8601 calendar rules: + let { years, months } = duration; + years += Math.floor(months / 12); + months %= 12; + duration = duration.with({ years, months }); + // => P4Y2M50DT50H100M + } + + { + const hour = Temporal.Duration.from("PT1H"); + hour.add({ minutes: 30 }); // => PT1H30M + + // Examples of balancing: + const one = Temporal.Duration.from({ hours: 1, minutes: 30 }); + const two = Temporal.Duration.from({ hours: 2, minutes: 45 }); + const result = one.add(two); // => PT4H15M + + // Example of adding calendar units + const oneAndAHalfMonth = Temporal.Duration.from({ months: 1, days: 16 }); + + // To convert units, use arithmetic relative to a start date: + const startDate1 = Temporal.PlainDate.from("2000-12-01"); + startDate1.add(oneAndAHalfMonth).add(oneAndAHalfMonth) + .since(startDate1, { largestUnit: "months" }); // => P3M4D + + const startDate2 = Temporal.PlainDate.from("2001-01-01"); + startDate2.add(oneAndAHalfMonth).add(oneAndAHalfMonth) + .since(startDate2, { largestUnit: "months" }); // => P3M1D + } + + { + const hourAndAHalf = Temporal.Duration.from("PT1H30M"); + hourAndAHalf.subtract({ hours: 1 }); // => PT30M + + const one = Temporal.Duration.from({ minutes: 180 }); + const two = Temporal.Duration.from({ seconds: 30 }); + one.subtract(two); // => PT179M30S + one.subtract(two).round({ largestUnit: "hour" }); // => PT2H59M30S + + // Example of subtracting calendar units; cannot be subtracted using + // subtract() because units need to be converted + const threeMonths = Temporal.Duration.from({ months: 3 }); + const oneAndAHalfMonth = Temporal.Duration.from({ months: 1, days: 15 }); + + // To convert units, use arithmetic relative to a start date: + const startDate1 = Temporal.PlainDate.from("2001-01-01"); + startDate1.add(threeMonths).subtract(oneAndAHalfMonth) + .since(startDate1, { largestUnit: "months" }); // => P1M13D + + const startDate2 = Temporal.PlainDate.from("2001-02-01"); + startDate2.add(threeMonths).subtract(oneAndAHalfMonth) + .since(startDate2, { largestUnit: "months" }); // => P1M16D + } + + { + const d = Temporal.Duration.from("P1Y2M3DT4H5M6.987654321S"); + d.sign; // 1 + d.negated(); // -P1Y2M3DT4H5M6.987654321S + d.negated().sign; // -1 + } + + { + const d = Temporal.Duration.from("-PT8H30M"); + d.abs(); // PT8H30M + } + + { + let d: Temporal.Duration; + + // Balance a duration as far as possible without knowing a starting point + d = Temporal.Duration.from({ minutes: 130 }); + d.round({ largestUnit: "day" }); // => PT2H10M + + // Round to the nearest unit + d = Temporal.Duration.from({ minutes: 10, seconds: 52 }); + d.round({ smallestUnit: "minute" }); // => PT11M + d.round({ smallestUnit: "minute", roundingMode: "trunc" }); // => PT10M + + // How many seconds in a multi-unit duration? + d = Temporal.Duration.from("PT2H34M18S"); + d.round({ largestUnit: "second" }).seconds; // => 9258 + + // Normalize, with and without taking DST into account + d = Temporal.Duration.from({ hours: 2756 }); + d.round({ + relativeTo: "2020-01-01T00:00+01:00[Europe/Rome]", + largestUnit: "year", + }); // => P114DT21H + // (one hour longer because DST skipped an hour) + d.round({ + relativeTo: "2020-01-01", + largestUnit: "year", + }); // => P114DT20H + // (one hour shorter if ignoring DST) + + // Normalize days into months or years + d = Temporal.Duration.from({ days: 190 }); + const refDate = Temporal.PlainDate.from("2020-01-01"); + d.round({ relativeTo: refDate, largestUnit: "year" }); // => P6M8D + + // Same, but in a different calendar system + d.round({ + relativeTo: refDate.withCalendar("hebrew"), + largestUnit: "year", + }); // => P6M13D + + // Round a duration up to the next 5-minute billing period + d = Temporal.Duration.from({ minutes: 6 }); + d.round({ + smallestUnit: "minute", + roundingIncrement: 5, + roundingMode: "ceil", + }); // => PT10M + + // How many full 3-month quarters of this year, are in this duration? + d = Temporal.Duration.from({ months: 10, days: 15 }); + d = d.round({ + smallestUnit: "month", + roundingIncrement: 3, + roundingMode: "trunc", + relativeTo: Temporal.Now.plainDateISO(), + }); + const quarters = d.months / 3; + quarters; // => 3 + } + + { + let d: Temporal.Duration; + + // How many seconds in 130 hours and 20 minutes? + d = Temporal.Duration.from({ hours: 130, minutes: 20 }); + d.total({ unit: "second" }); // => 469200 + + // How many 24-hour days is 123456789 seconds? + d = Temporal.Duration.from("PT123456789S"); + d.total({ unit: "day" }); // 1428.8980208333332 + + // Find totals in months, with and without taking DST into account + d = Temporal.Duration.from({ hours: 2756 }); + d.total({ + relativeTo: "2020-01-01T00:00+01:00[Europe/Rome]", + unit: "month", + }); // => 3.7958333333333334 + d.total({ + unit: "month", + relativeTo: "2020-01-01", + }); // => 3.7944444444444443 + } + + { + let d: Temporal.Duration; + + d = Temporal.Duration.from({ years: 1, days: 1 }); + d.toString(); // => P1Y1D + d = Temporal.Duration.from({ years: -1, days: -1 }); + d.toString(); // => -P1Y1D + d = Temporal.Duration.from({ milliseconds: 1000 }); + d.toString(); // => PT1S + + // The output format always balances units under 1 s, even if the + // underlying Temporal.Duration object doesn't. + const nobal = Temporal.Duration.from({ milliseconds: 3500 }); + console.log(`${nobal}`, nobal.seconds, nobal.milliseconds); // => 'PT3.5S 0 3500' + const bal = nobal.round({ largestUnit: "year" }); // balance through round + console.log(`${bal}`, bal.seconds, bal.milliseconds); // => 'PT3.5S 3 500' + + d = Temporal.Duration.from("PT59.999999999S"); + d.toString({ smallestUnit: "second" }); // => PT59S + d.toString({ fractionalSecondDigits: 0 }); // => PT59S + d.toString({ fractionalSecondDigits: 4 }); // => PT59.9999S + d.toString({ fractionalSecondDigits: 8, roundingMode: "halfExpand" }); + // => PT60.00000000S + } + + { + const d = Temporal.Duration.from("P1DT6H30M"); + d.toLocaleString(); // example output: '1 day 6 hours 30 minutes' + d.toLocaleString("de-DE"); // example output: '1 Tag 6 Stunden 30 Minuten' + d.toLocaleString("en-US", { days: "short", hours: "numeric" }); // example output: '1 day 6 hours' + } + + { + Temporal.Now.instant(); // get the current system exact time + Temporal.Now.timeZoneId(); // get the current system time zone + Temporal.Now.zonedDateTimeISO(); // get the current date and wall-clock time in the system time zone and ISO-8601 calendar + Temporal.Now.plainDateISO(); // get the current date in the system time zone and ISO-8601 calendar + Temporal.Now.plainTimeISO(); // get the current wall-clock time in the system time zone and ISO-8601 calendar + Temporal.Now.plainDateTimeISO(); // same as above, but return the DateTime in the ISO-8601 calendar + } + \ No newline at end of file diff --git a/tests/baselines/reference/temporal.js b/tests/baselines/reference/temporal.js new file mode 100644 index 0000000000000..ba0634e9b8cd2 --- /dev/null +++ b/tests/baselines/reference/temporal.js @@ -0,0 +1,3371 @@ +//// [tests/cases/compiler/temporal.ts] //// + +//// [temporal.ts] +/** + * Test cases derived from documentation at tc39/proposal-temporal, + * under the following license: + * + * Copyright 2017, 2018, 2019, 2020 ECMA International + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH + * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, + * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM + * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR + * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. + */ + +{ + const instant = Temporal.Instant.from("2020-01-01T00:00+05:30"); // => 2019-12-31T18:30:00Z + instant.epochNanoseconds; // => 1577817000000000000n + + // `Temporal.Instant` lacks properties that depend on time zone or calendar + instant.year; // => undefined + + const zdtTokyo = instant.toZonedDateTimeISO("Asia/Tokyo"); // => 2020-01-01T03:30:00+09:00[Asia/Tokyo] + zdtTokyo.year; // => 2020 + zdtTokyo.toPlainDate(); // => 2020-01-01 +} + +{ + // Convert from `Temporal.Instant` to `Date` (which uses millisecond precision) + const instant = Temporal.Instant.from("2020-01-01T00:00:00.123456789+05:30"); + // => 2019-12-31T18:30:00.123456789Z + const date = new Date(instant.epochMilliseconds); + date.toISOString(); // => 2019-12-31T18:30:00.123Z + + // Convert from `Date` to `Temporal.Instant` + const sameInstant = date.toTemporalInstant(); // => 2019-12-31T18:30:00.123Z +} + +{ + const date = new Date(2019, 11, 31, 18, 30); // => Tue Dec 31 2019 18:30:00 GMT-0800 (Pacific Standard Time) + const instant = date.toTemporalInstant(); // => 2020-01-01T02:30:00Z + const zonedDateTime = instant.toZonedDateTimeISO(Temporal.Now.timeZoneId()); + // => 2019-12-31T18:30:00-08:00[America/Los_Angeles] + zonedDateTime.day; // => 31 + const dateOnly = zonedDateTime.toPlainDate(); // => 2019-12-31 +} + +{ + const instant = new Temporal.Instant(1553906700000000000n); + // When was the Unix epoch? + const epoch = new Temporal.Instant(0n); // => 1970-01-01T00:00:00Z + // Dates before the Unix epoch are negative + const turnOfTheCentury = new Temporal.Instant(-2208988800000000000n); // => 1900-01-01T00:00:00Z +} + +{ + let instant: Temporal.Instant; + instant = Temporal.Instant.from("2019-03-30T01:45:00+01:00[Europe/Berlin]"); + instant = Temporal.Instant.from("2019-03-30T01:45+01:00"); + instant = Temporal.Instant.from("2019-03-30T00:45Z"); + instant === Temporal.Instant.from(instant); // => false +} + +{ + const legacyDate = new Date("1995-12-17T03:24Z"); + let instant: Temporal.Instant; + instant = Temporal.Instant.fromEpochMilliseconds(legacyDate.getTime()); // => 1995-12-17T03:24:00Z + instant = Temporal.Instant.fromEpochMilliseconds(legacyDate); // valueOf() called implicitly + instant = legacyDate.toTemporalInstant(); // recommended +} + +{ + const one = Temporal.Instant.fromEpochMilliseconds(1.0e12); + const two = Temporal.Instant.fromEpochMilliseconds(1.1e12); + const three = Temporal.Instant.fromEpochMilliseconds(1.2e12); + const sorted = [three, one, two].sort(Temporal.Instant.compare); + sorted.join(" "); + // => '2001-09-09T01:46:40Z 2004-11-09T11:33:20Z 2008-01-10T21:20:00Z' +} + +{ + const instant = Temporal.Instant.from("2019-03-30T00:45Z"); + new Date(instant.epochMilliseconds); // => 2019-03-30T00:45:00.000Z + + // If you need epoch seconds data: + const epochSecs = Math.floor(instant.epochMilliseconds / 1000); // => 1553906700 + + const ns = instant.epochNanoseconds; + const epochMicros = ns / 1000n + ((ns % 1000n) < 0n ? -1n : 0n); +} + +{ + // Converting a specific exact time to a calendar date / wall-clock time + let timestamp: Temporal.Instant; + timestamp = Temporal.Instant.fromEpochMilliseconds(1553993100_000); + timestamp.toZonedDateTimeISO("Europe/Berlin"); // => 2019-03-31T01:45:00+01:00[Europe/Berlin] + timestamp.toZonedDateTimeISO("UTC"); // => 2019-03-31T00:45:00+00:00[UTC] + timestamp.toZonedDateTimeISO("-08:00"); // => 2019-03-30T16:45:00-08:00[-08:00] + + // What time was the Unix epoch (timestamp 0) in Bell Labs (Murray Hill, New Jersey, USA) in the Gregorian calendar? + const epoch = Temporal.Instant.fromEpochMilliseconds(0); + epoch.toZonedDateTimeISO("America/New_York").withCalendar("gregory"); + // => 1969-12-31T19:00:00-05:00[America/New_York][u-ca=gregory] + + // What time was the Unix epoch in Tokyo in the Japanese calendar? + const zdt = epoch.toZonedDateTimeISO("Asia/Tokyo").withCalendar("japanese"); + // => 1970-01-01T09:00:00+09:00[Asia/Tokyo][u-ca=japanese] + console.log(zdt.eraYear, zdt.era); + // => '45 showa' +} + +{ + // Temporal.Instant representing five hours from now + Temporal.Now.instant().add({ hours: 5 }); + const fiveHours = Temporal.Duration.from({ hours: 5 }); + Temporal.Now.instant().add(fiveHours); +} + +{ + // Temporal.Instant representing this time an hour ago + Temporal.Now.instant().subtract({ hours: 1 }); + const oneHour = Temporal.Duration.from({ hours: 1 }); + Temporal.Now.instant().subtract(oneHour); +} + +{ + const startOfMoonMission = Temporal.Instant.from("1969-07-16T13:32:00Z"); + const endOfMoonMission = Temporal.Instant.from("1969-07-24T16:50:35Z"); + const missionLength = startOfMoonMission.until(endOfMoonMission, { largestUnit: "hour" }); + // => PT195H18M35S + missionLength.toLocaleString(); + // example output: '195 hours 18 minutes 35 seconds' + + // Rounding, for example if you don't care about the minutes and seconds + const approxMissionLength = startOfMoonMission.until(endOfMoonMission, { + largestUnit: "hour", + smallestUnit: "hour", + }); + // => PT195H + + // A billion (10^9) seconds since the epoch in different units + const epoch = Temporal.Instant.fromEpochMilliseconds(0); + const billion = Temporal.Instant.fromEpochMilliseconds(1e9); + epoch.until(billion); + // => PT1000000000S + epoch.until(billion, { largestUnit: "hour" }); + // => PT277777H46M40S + const ns = epoch.until(billion, { largestUnit: "nanosecond" }); + // => PT1000000000S + ns.add({ nanoseconds: 1 }); + // => PT1000000000S + // (lost precision) + + // Calculate the difference in years, eliminating the ambiguity by + // explicitly using the corresponding calendar date in UTC: + epoch.toZonedDateTimeISO("UTC").until( + billion.toZonedDateTimeISO("UTC"), + { largestUnit: "year" }, + ); + // => P31Y8M8DT1H46M40S +} + +{ + const instant = Temporal.Instant.from("2019-03-30T02:45:59.999999999Z"); + + // Round to a particular unit + instant.round({ smallestUnit: "second" }); // => 2019-03-30T02:46:00Z + // Round to an increment of a unit, e.g. an hour: + instant.round({ roundingIncrement: 60, smallestUnit: "minute" }); + // => 2019-03-30T03:00:00Z + // Round to the same increment but round down instead: + instant.round({ roundingIncrement: 60, smallestUnit: "minute", roundingMode: "floor" }); + // => 2019-03-30T02:00:00Z +} + +{ + const one = Temporal.Instant.fromEpochMilliseconds(1.0e12); + const two = Temporal.Instant.fromEpochMilliseconds(1.1e12); + one.equals(two); // => false + one.equals(one); // => true +} + +{ + const instant = Temporal.Instant.fromEpochMilliseconds(1574074321816); + instant.toString(); // => '2019-11-18T10:52:01.816Z' + instant.toString({ timeZone: "UTC" }); + // => '2019-11-18T10:52:01.816+00:00' + instant.toString({ timeZone: "Asia/Seoul" }); + // => '2019-11-18T19:52:01.816+09:00' + + instant.toString({ smallestUnit: "minute" }); + // => '2019-11-18T10:52Z' + instant.toString({ fractionalSecondDigits: 0 }); + // => '2019-11-18T10:52:01Z' + instant.toString({ fractionalSecondDigits: 4 }); + // => '2019-11-18T10:52:01.8160Z' + instant.toString({ smallestUnit: "second", roundingMode: "halfExpand" }); + // => '2019-11-18T10:52:02Z' +} + +{ + const instant = Temporal.Instant.from("2019-11-18T11:00:00.000Z"); + instant.toLocaleString(); // example output: '2019-11-18, 3:00:00 a.m.' + instant.toLocaleString("de-DE"); // example output: '18.11.2019, 03:00:00' + instant.toLocaleString("de-DE", { + timeZone: "Europe/Berlin", + year: "numeric", + month: "numeric", + day: "numeric", + hour: "numeric", + minute: "numeric", + timeZoneName: "long", + }); // => '18.11.2019, 12:00 Mitteleuropäische Normalzeit' + instant.toLocaleString("en-US-u-nu-fullwide-hc-h12", { + timeZone: "Asia/Kolkata", + }); // => '11/18/2019, 4:30:00 PM' +} + +{ + // UNIX epoch in California + new Temporal.ZonedDateTime(0n, "America/Los_Angeles", "iso8601"); + // => 1969-12-31T16:00:00-08:00[America/Los_Angeles] + new Temporal.ZonedDateTime(0n, "America/Los_Angeles"); + // => 1969-12-31T16:00:00-08:00[America/Los_Angeles] + // same, but shorter +} + +{ + let zdt: Temporal.ZonedDateTime; + + zdt = Temporal.ZonedDateTime.from("1995-12-07T03:24:30+02:00[Africa/Cairo]"); + zdt = Temporal.ZonedDateTime.from("1995-12-07T03:24:30+02:00[Africa/Cairo][u-ca=islamic]"); + zdt = Temporal.ZonedDateTime.from("19951207T032430+0200[Africa/Cairo]"); + + zdt = Temporal.ZonedDateTime.from({ + timeZone: "America/Los_Angeles", + year: 1995, + month: 12, + day: 7, + hour: 3, + minute: 24, + second: 30, + millisecond: 0, + microsecond: 3, + nanosecond: 500, + }); // => 1995-12-07T03:24:30.0000035-08:00[America/Los_Angeles] + + // Different overflow modes + zdt = Temporal.ZonedDateTime.from({ timeZone: "Europe/Paris", year: 2001, month: 13, day: 1 }, { overflow: "constrain" }); + // => 2001-12-01T00:00:00+01:00[Europe/Paris] + zdt = Temporal.ZonedDateTime.from({ timeZone: "Europe/Paris", year: 2001, month: 13, day: 1 }, { overflow: "reject" }); + // => throws RangeError +} + +{ + const arr = [ + Temporal.ZonedDateTime.from("2020-02-01T12:30-05:00[America/Toronto]"), + Temporal.ZonedDateTime.from("2020-02-01T12:30-05:00[America/New_York]"), + Temporal.ZonedDateTime.from("2020-02-01T12:30+01:00[Europe/Brussels]"), + Temporal.ZonedDateTime.from("2020-02-01T12:30+00:00[Europe/London]"), + ]; + const sorted = arr.sort(Temporal.ZonedDateTime.compare); + JSON.stringify(sorted, undefined, 2); + // => + // '[ + // "2020-02-01T12:30+01:00[Europe/Brussels]", + // "2020-02-01T12:30+00:00[Europe/London]", + // "2020-02-01T12:30-05:00[America/Toronto]", + // "2020-02-01T12:30-05:00[America/New_York]" + // ]' +} + +{ + const dt = Temporal.ZonedDateTime.from("1995-12-07T03:24:30.000003500[Europe/Rome]"); + dt.year; // => 1995 + dt.month; // => 12 + dt.monthCode; // => 'M12' + dt.day; // => 7 + dt.hour; // => 3 + dt.minute; // => 24 + dt.second; // => 30 + dt.millisecond; // => 0 + dt.microsecond; // => 3 + dt.nanosecond; // => 500 +} + +{ + const zdt = Temporal.ZonedDateTime.from("2020-02-01T12:30+09:00[Asia/Tokyo]"); + const epochMs = zdt.epochMilliseconds; + // => 1580527800000 + zdt.toInstant().epochMilliseconds; + // => 1580527800000 + const legacyDate = new Date(epochMs); + // => 2020-02-01T03:30:00.000Z + // (if the system time zone is America/Los_Angeles) + const epochNanos = zdt.epochNanoseconds; + // => 1580527800000000000n + + // If you need epoch seconds data: + const epochSecs = Math.floor(zdt.epochMilliseconds / 1000); // => 1553906700 + // => 1580527800 + + // If you need epoch microseconds data: + // (Note the extra check for correct floor rounding with bigints) + const ns = zdt.epochNanoseconds; + const epochMicros = ns / 1000n + ((ns % 1000n) < 0n ? -1n : 0n); + // => 1580527800000000n +} + +{ + const zdt = Temporal.ZonedDateTime.from("1995-12-07T03:24-08:00[America/Los_Angeles]"); + `Time zone is: ${zdt.timeZoneId}`; + // => 'Time zone is: America/Los_Angeles' + zdt.withTimeZone("Asia/Kolkata").timeZoneId; + // => Asia/Kolkata + zdt.withTimeZone("Asia/Calcutta").timeZoneId; + // => Asia/Calcutta (does not follow links in the IANA Time Zone Database) + + zdt.withTimeZone("europe/paris").timeZoneId; + // => Europe/Paris (normalized to match IANA Time Zone Database capitalization) + + zdt.withTimeZone("+05:00").timeZoneId; + // => +05:00 + zdt.withTimeZone("+05").timeZoneId; + // => +05:00 (normalized to ±HH:MM) + zdt.withTimeZone("+0500").timeZoneId; + // => +05:00 (normalized to ±HH:MM) +} + +{ + const date = Temporal.ZonedDateTime.from("-000015-01-01T12:30[Europe/Rome][u-ca=gregory]"); + date.era; + // => 'bce' + date.eraYear; + // => 16 + date.year; + // => -15 +} + +{ + const zdt = Temporal.ZonedDateTime.from("1995-12-07T03:24-08:00[America/Los_Angeles]"); + ["MON", "TUE", "WED", "THU", "FRI", "SAT", "SUN"][zdt.dayOfWeek - 1]; // => 'THU' +} + +{ + const zdt = Temporal.ZonedDateTime.from("1995-12-07T03:24-08:00[America/Los_Angeles]"); + // ISO ordinal date + console.log(zdt.year, zdt.dayOfYear); // => '1995 341' +} + +{ + const zdt = Temporal.ZonedDateTime.from("2022-01-01T03:24-08:00[America/Los_Angeles]"); + // ISO week date + console.log(zdt.yearOfWeek, zdt.weekOfYear, zdt.dayOfWeek); // => '2021 52 6' +} + +{ + const zdt = Temporal.ZonedDateTime.from("1995-12-07T03:24-08:00[America/Los_Angeles]"); + zdt.daysInWeek; // => 7 +} + +{ + // Attempt to write some mnemonic poetry + const monthsByDays: Record = {}; + for (let month = 1; month <= 12; month++) { + const zdt = Temporal.Now.zonedDateTimeISO().with({ month }); + monthsByDays[zdt.daysInMonth] = (monthsByDays[zdt.daysInMonth] || []).concat(zdt); + } + + const strings = monthsByDays[30].map(zdt => zdt.toLocaleString("en", { month: "long" })); + // Shuffle to improve poem as determined empirically + strings.unshift(strings.pop()!); + const format = new Intl.ListFormat("en"); + const poem = `Thirty days hath ${format.format(strings)}`; + + console.log(poem); +} + +{ + const zdt = Temporal.Now.zonedDateTimeISO(); + const percent = zdt.dayOfYear / zdt.daysInYear; + `The year is ${percent.toLocaleString("en", { style: "percent" })} over!`; + // example output: "The year is 10% over!" +} + +{ + const zdt = Temporal.ZonedDateTime.from("1900-01-01T12:00+09:00[Asia/Tokyo]"); + zdt.monthsInYear; // => 12 +} + +{ + // Is this year a leap year? + const zdt = Temporal.Now.zonedDateTimeISO(); + zdt.inLeapYear; // example output: true + // Is 2100 a leap year? (no, because it's divisible by 100 and not 400) + zdt.with({ year: 2100 }).inLeapYear; // => false +} + +{ + const zdt = Temporal.ZonedDateTime.from("2010-11-07T23:00:00-03:30[America/St_Johns]"); + zdt.hoursInDay; // 25 +} + +{ + const zdt = Temporal.ZonedDateTime.from("2020-11-01T01:30-07:00[America/Los_Angeles]"); + zdt.offsetNanoseconds; + // => -25200000000000 + // (-7 * 3600 * 1e9) +} + +{ + const zdt = Temporal.ZonedDateTime.from("2020-11-01T01:30-07:00[America/Los_Angeles]"); + zdt.offset; + // => '-07:00' + zdt.withTimeZone("Asia/Kolkata").offset; + // => '+05:30' + + const minus8Hours = "-08:00"; + const daylightTime0130 = Temporal.ZonedDateTime.from("2020-11-01T01:30-07:00[America/Los_Angeles]"); + // => 2020-11-01T01:30:00-07:00[America/Los_Angeles] + // This is Pacific Daylight Time 1:30AM + const repeated0130 = daylightTime0130.with({ offset: minus8Hours }); + // => 2020-11-01T01:30:00-08:00[America/Los_Angeles] + // This is Pacific Standard Time 1:30AM +} + +{ + const zdt = Temporal.ZonedDateTime.from("1995-12-07T03:24:00-06:00[America/Chicago]"); + zdt.with({ year: 2015, minute: 31 }); // => 2015-12-07T03:31:00-06:00[America/Chicago] +} + +{ + const zdt = Temporal.ZonedDateTime.from("2015-12-07T03:24:30.000003500-08:00[America/Los_Angeles]"); + zdt.withPlainTime({ hour: 10 }); // => 2015-12-07T10:00:00-08:00[America/Los_Angeles] + const time = Temporal.PlainTime.from("11:22"); + zdt.withPlainTime(time); // => 2015-12-07T11:22:00-08:00[America/Los_Angeles] + zdt.withPlainTime("12:34"); // => 2015-12-07T12:34:00-08:00[America/Los_Angeles] + + // easier for chaining + zdt.add({ days: 2, hours: 22 }).withPlainTime("00:00"); // => 2015-12-10T00:00:00-08:00[America/Los_Angeles] +} + +{ + const zdt = Temporal.ZonedDateTime.from("1995-12-07T03:24:30+09:00[Asia/Tokyo]"); + zdt.toString(); // => '1995-12-07T03:24:30+09:00[Asia/Tokyo]' + zdt.withTimeZone("Africa/Accra").toString(); // => '1995-12-06T18:24:30+00:00[Africa/Accra]' +} + +{ + const zdt = Temporal.ZonedDateTime.from("1995-12-07T03:24:30.000003500+09:00[Asia/Tokyo][u-ca=japanese]"); + `${zdt.era} ${zdt.eraYear}`; // => 'heisei 7' + zdt.withCalendar("gregory").eraYear; // => 1995 +} + +{ + const zdt = Temporal.ZonedDateTime.from("2020-03-08T00:00-08:00[America/Los_Angeles]"); + // Add a day to get midnight on the day after DST starts + const laterDay = zdt.add({ days: 1 }); + // => 2020-03-09T00:00:00-07:00[America/Los_Angeles] + // Note that the new offset is different, indicating the result is adjusted for DST. + laterDay.since(zdt, { largestUnit: "hour" }).hours; + // => 23 + // because one clock hour lost to DST + + const laterHours = zdt.add({ hours: 24 }); + // => 2020-03-09T01:00:00-07:00[America/Los_Angeles] + // Adding time units doesn't adjust for DST. Result is 1:00AM: 24 real-world + // hours later because a clock hour was skipped by DST. + laterHours.since(zdt, { largestUnit: "hour" }).hours; // => 24 +} + +{ + const zdt = Temporal.ZonedDateTime.from("2020-03-09T00:00-07:00[America/Los_Angeles]"); + // Add a day to get midnight on the day after DST starts + const earlierDay = zdt.subtract({ days: 1 }); + // => 2020-03-08T00:00:00-08:00[America/Los_Angeles] + // Note that the new offset is different, indicating the result is adjusted for DST. + earlierDay.since(zdt, { largestUnit: "hour" }).hours; + // => -23 + // because one clock hour lost to DST + + const earlierHours = zdt.subtract({ hours: 24 }); + // => 2020-03-07T23:00:00-08:00[America/Los_Angeles] + // Subtracting time units doesn't adjust for DST. Result is 11:00PM: 24 real-world + // hours earlier because a clock hour was skipped by DST. + earlierHours.since(zdt, { largestUnit: "hour" }).hours; // => -24 +} + +{ + const zdt1 = Temporal.ZonedDateTime.from("1995-12-07T03:24:30.000003500+05:30[Asia/Kolkata]"); + const zdt2 = Temporal.ZonedDateTime.from("2019-01-31T15:30+05:30[Asia/Kolkata]"); + zdt1.until(zdt2); + // => PT202956H5M29.9999965S + zdt1.until(zdt2, { largestUnit: "year" }); + // => P23Y1M24DT12H5M29.9999965S + zdt2.until(zdt1, { largestUnit: "year" }); + // => -P23Y1M24DT12H5M29.9999965S + zdt1.until(zdt2, { largestUnit: "nanosecond" }); + // => PT730641929.999996544S + // (precision lost) + + // Rounding, for example if you don't care about sub-seconds + zdt1.until(zdt2, { smallestUnit: "second" }); + // => PT202956H5M29S + + // Months and years can be different lengths + const [jan1, feb1, mar1] = [1, 2, 3].map(month => Temporal.ZonedDateTime.from({ year: 2020, month, day: 1, timeZone: "Asia/Seoul" })); + jan1.until(feb1, { largestUnit: "day" }); // => P31D + jan1.until(feb1, { largestUnit: "month" }); // => P1M + feb1.until(mar1, { largestUnit: "day" }); // => P29D + feb1.until(mar1, { largestUnit: "month" }); // => P1M + jan1.until(mar1, { largestUnit: "day" }); // => P60D +} + +{ + const zdt1 = Temporal.ZonedDateTime.from("1995-12-07T03:24:30.000003500+05:30[Asia/Kolkata]"); + const zdt2 = Temporal.ZonedDateTime.from("2019-01-31T15:30+05:30[Asia/Kolkata]"); + zdt2.since(zdt1); // => PT202956H5M29.9999965S +} + +{ + const zdt = Temporal.ZonedDateTime.from("1995-12-07T03:24:30.000003500-08:00[America/Los_Angeles]"); + + // Round to a particular unit + zdt.round({ smallestUnit: "hour" }); + // => 1995-12-07T03:00:00-08:00[America/Los_Angeles] + // Round to an increment of a unit, e.g. half an hour: + zdt.round({ roundingIncrement: 30, smallestUnit: "minute" }); + // => 1995-12-07T03:30:00-08:00[America/Los_Angeles] + // Round to the same increment but round down instead: + zdt.round({ roundingIncrement: 30, smallestUnit: "minute", roundingMode: "floor" }); + // => 1995-12-07T03:00:00-08:00[America/Los_Angeles] +} + +{ + const zdt = Temporal.ZonedDateTime.from("2015-10-18T12:00-02:00[America/Sao_Paulo]"); + zdt.startOfDay(); // => 2015-10-18T01:00:00-02:00[America/Sao_Paulo] +} + +{ + let duration: Temporal.Duration; + // How long until the next offset change from now, in the current location? + const tz = Temporal.Now.timeZoneId(); + const now = Temporal.Now.zonedDateTimeISO(tz); + const nextTransition = now.getTimeZoneTransition("next"); + duration = nextTransition!.since(now); + duration.toLocaleString(); // output will vary + + // How long until the previous offset change from now, in the current location? + const previousTransition = now.getTimeZoneTransition("previous"); + duration = now.since(previousTransition!); + duration.toLocaleString(); // output will vary +} + +{ + const zdt1 = Temporal.ZonedDateTime.from("1995-12-07T03:24:30.000003500+01:00[Europe/Paris]"); + const zdt2 = Temporal.ZonedDateTime.from("1995-12-07T03:24:30.000003500+01:00[Europe/Brussels]"); + zdt1.equals(zdt2); // => false (same offset but different time zones) + zdt1.equals(zdt1); // => true + + // To compare time zone IDs, use withTimeZone() with each ID on the same + // ZonedDateTime instance, and use equals() to compare + const kolkata = zdt1.withTimeZone("Asia/Kolkata"); + kolkata.equals(zdt1.withTimeZone("Asia/Calcutta")); // => true + + // Offset time zones are never equivalent to named time zones + kolkata.equals(zdt1.withTimeZone("+05:30")); // => false + const zeroOffset = zdt1.withTimeZone("+00:00"); + zeroOffset.equals(zdt1.withTimeZone("UTC")); // => false + + // For offset time zones, any valid format is accepted + zeroOffset.equals(zdt1.withTimeZone("+00:00")); // => true + zeroOffset.equals(zdt1.withTimeZone("+0000")); // => true + zeroOffset.equals(zdt1.withTimeZone("+00")); // => true +} + +{ + let zdt: Temporal.ZonedDateTime; + zdt = Temporal.ZonedDateTime.from({ year: 2019, month: 12, day: 1, hour: 12, timeZone: "Africa/Lagos" }); + zdt.toString(); // => '2019-12-01T12:00:00+01:00[Africa/Lagos]' + zdt = zdt.withCalendar("japanese"); + zdt.toString(); // => '2019-12-01T12:00:00+01:00[Africa/Lagos][u-ca=japanese]' +} + +{ + const zdt = Temporal.ZonedDateTime.from("2019-12-01T12:00+01:00[Europe/Berlin]"); + zdt.toLocaleString(); // example output: 12/1/2019, 12:00:00 PM + zdt.toLocaleString("de-DE"); // => '1.12.2019, 12:00:00 MEZ' + const options = { weekday: "long", year: "numeric", month: "long", day: "numeric" } as const; + zdt.toLocaleString("de-DE", options); // => 'Sonntag, 1. Dezember 2019' + /* WRONG */ zdt.toLocaleString("de-DE", { timeZone: "Pacific/Auckland" }); + // => RangeError: Time zone option Pacific/Auckland does not match actual time zone Europe/Berlin + zdt.withTimeZone("Pacific/Auckland").toLocaleString("de-DE"); // => '2.12.2019, 0:00:00 GMT+13' + zdt.toLocaleString("en-US-u-nu-fullwide-hc-h12"); // => '12/1/2019, 12:00:00 PM GMT+1' +} + +{ + const zdt = Temporal.ZonedDateTime.from("1995-12-07T03:24:30+02:00[Africa/Johannesburg]"); + zdt.toInstant(); // => 1995-12-07T01:24:30Z + zdt.toPlainDateTime(); // => 1995-12-07T03:24:30 + zdt.toPlainDate(); // => 1995-12-07 + zdt.toPlainTime(); // => 03:24:30 + zdt.toPlainDate().toPlainYearMonth(); // => 1995-12 + zdt.toPlainDate().toPlainMonthDay(); // => 12-07 +} + +{ + // Pi day in 2020 + const date = new Temporal.PlainDate(2020, 3, 14); // => 2020-03-14 +} + +{ + let date: Temporal.PlainDate; + + date = Temporal.PlainDate.from("2006-08-24"); // => 2006-08-24 + date = Temporal.PlainDate.from("20060824"); // => 2006-08-24 + date = Temporal.PlainDate.from("2006-08-24T15:43:27"); // => 2006-08-24 + date = Temporal.PlainDate.from("2006-08-24T15:43:27+01:00[Europe/Brussels]"); + // => 2006-08-24 + date === Temporal.PlainDate.from(date); // => false + + date = Temporal.PlainDate.from({ year: 2006, month: 8, day: 24 }); // => 2006-08-24 + date = Temporal.PlainDate.from(Temporal.PlainDateTime.from("2006-08-24T15:43:27")); + // => 2006-08-24 + // same as above; Temporal.PlainDateTime has year, month, and day properties + + date = Temporal.PlainDate.from({ year: 1427, month: 8, day: 1, calendar: "islamic" }); + // => 2006-08-24[u-ca=islamic] + + // Different overflow modes + date = Temporal.PlainDate.from({ year: 2001, month: 13, day: 1 }, { overflow: "constrain" }); + // => 2001-12-01 + date = Temporal.PlainDate.from({ year: 2001, month: 1, day: 32 }, { overflow: "constrain" }); + // => 2001-01-31 + date = Temporal.PlainDate.from({ year: 2001, month: 13, day: 1 }, { overflow: "reject" }); + // => throws + date = Temporal.PlainDate.from({ year: 2001, month: 1, day: 32 }, { overflow: "reject" }); + // => throws +} + +{ + const one = Temporal.PlainDate.from("2006-08-24"); + const two = Temporal.PlainDate.from("2015-07-14"); + const three = Temporal.PlainDate.from("1930-02-18"); + const sorted = [one, two, three].sort(Temporal.PlainDate.compare); + sorted.join(" "); // => '1930-02-18 2006-08-24 2015-07-14' +} + +{ + let date: Temporal.PlainDate; + + date = Temporal.PlainDate.from("2006-08-24"); + date.year; // => 2006 + date.month; // => 8 + date.monthCode; // => 'M08' + date.day; // => 24 + + date = Temporal.PlainDate.from("2019-02-23[u-ca=hebrew]"); + date.year; // => 5779 + date.month; // => 6 + date.monthCode; // => 'M05L' + date.day; // => 18 +} + +{ + const date = Temporal.PlainDate.from("-000015-01-01[u-ca=gregory]"); + date.era; + // => 'bce' + date.eraYear; + // => 16 + date.year; + // => -15 +} + +{ + const date = Temporal.PlainDate.from("2006-08-24"); + ["MON", "TUE", "WED", "THU", "FRI", "SAT", "SUN"][date.dayOfWeek - 1]; // => 'THU' +} + +{ + const date = Temporal.PlainDate.from("2006-08-24"); + // ISO ordinal date + console.log(date.year, date.dayOfYear); // => '2006 236' +} + +{ + const date = Temporal.PlainDate.from("2022-01-01"); + // ISO week date + console.log(date.yearOfWeek, date.weekOfYear, date.dayOfWeek); // => '2021 52 6' +} + +{ + const date = Temporal.PlainDate.from("2006-08-24"); + date.daysInWeek; // => 7 +} + +{ + // Attempt to write some mnemonic poetry + const monthsByDays: Record = {}; + for (let month = 1; month <= 12; month++) { + const date = Temporal.Now.plainDateISO().with({ month }); + monthsByDays[date.daysInMonth] = (monthsByDays[date.daysInMonth] || []).concat(date); + } + + const strings = monthsByDays[30].map(date => date.toLocaleString("en", { month: "long" })); + // Shuffle to improve poem as determined empirically + strings.unshift(strings.pop()!); + const format = new Intl.ListFormat("en"); + const poem = `Thirty days hath ${format.format(strings)}`; + + console.log(poem); +} + +{ + const date = Temporal.Now.plainDateISO(); + const percent = date.dayOfYear / date.daysInYear; + `The year is ${percent.toLocaleString("en", { style: "percent" })} over!`; + // example output: "The year is 10% over!" +} + +{ + const date = Temporal.PlainDate.from("1900-01-01"); + date.monthsInYear; // => 12 +} + +{ + // Is this year a leap year? + const date = Temporal.Now.plainDateISO(); + date.inLeapYear; // example output: true + // Is 2100 a leap year? (no, because it's divisible by 100 and not 400) + date.with({ year: 2100 }).inLeapYear; // => false +} + +{ + const date = Temporal.PlainDate.from("2006-01-24"); + // What's the first day of this month? + date.with({ day: 1 }); // => 2006-01-01 + // What's the last day of the next month? + const nextMonthDate = date.add({ months: 1 }); + nextMonthDate.with({ day: nextMonthDate.daysInMonth }); // => 2006-02-28 +} + +{ + const date = Temporal.PlainDate.from("2006-08-24[u-ca=japanese]"); + date.withCalendar("iso8601"); // => 2006-08-24 +} + +{ + let date: Temporal.PlainDate; + + date = Temporal.PlainDate.from("2006-08-24"); + date.add({ years: 20, months: 4 }); // => 2026-12-24 + + date = Temporal.PlainDate.from("2019-01-31"); + date.add({ months: 1 }); // => 2019-02-28 + date.add({ months: 1 }, { overflow: "reject" }); // => throws +} + +{ + let date: Temporal.PlainDate; + + date = Temporal.PlainDate.from("2006-08-24"); + date.subtract({ years: 20, months: 4 }); // => 1986-04-24 + + date = Temporal.PlainDate.from("2019-03-31"); + date.subtract({ months: 1 }); // => 2019-02-28 + date.subtract({ months: 1 }, { overflow: "reject" }); // => throws +} + +{ + const earlier = Temporal.PlainDate.from("2006-08-24"); + const later = Temporal.PlainDate.from("2019-01-31"); + earlier.until(later); // => P4543D + earlier.until(later, { largestUnit: "year" }); // => P12Y5M7D + later.until(earlier, { largestUnit: "year" }); // => -P12Y5M7D + + // If you really need to calculate the difference between two Dates in + // hours, you can eliminate the ambiguity by explicitly choosing the + // point in time from which you want to reckon the difference. For + // example, using noon: + const noon = Temporal.PlainTime.from("12:00"); + earlier.toPlainDateTime(noon).until(later.toPlainDateTime(noon), { largestUnit: "hour" }); + // => PT109032H + + const newyear = Temporal.PlainDate.from("2020-01-01"); + newyear.until("2020-01-15", { smallestUnit: "month", roundingMode: "halfExpand" }); + // => PT0S + newyear.until("2020-01-16", { smallestUnit: "month", roundingMode: "halfExpand" }); + // => PT0S (mid-month dates rounded down to match `Temporal.PlainDateTime` behavior) + newyear.until("2020-01-17", { smallestUnit: "month", roundingMode: "halfExpand" }); + // => PT1M +} + +{ + const earlier = Temporal.PlainDate.from("2006-08-24"); + const later = Temporal.PlainDate.from("2019-01-31"); + later.since(earlier); // => P4543D +} + +{ + const date = Temporal.PlainDate.from("2006-08-24"); + const other = Temporal.PlainDate.from("2019-01-31"); + date.equals(other); // => false + date.equals(date); // => true +} + +{ + const date = Temporal.PlainDate.from("2006-08-24"); + date.toString(); // => '2006-08-24' +} + +{ + const date = Temporal.PlainDate.from("2006-08-24"); + date.toLocaleString(); // example output: 8/24/2006 + date.toLocaleString("de-DE"); // example output: '24.8.2006' + date.toLocaleString("de-DE", { weekday: "long" }); // => 'Donnerstag' + date.toLocaleString("en-US-u-nu-fullwide"); // => '8/24/2006' +} + +{ + const plainDate = Temporal.PlainDate.from("2006-08-24"); + const plainTime = Temporal.PlainTime.from("15:23:30.003"); + plainDate.toZonedDateTime({ timeZone: "America/Los_Angeles", plainTime }); + // => 2006-08-24T15:23:30.003-07:00[America/Los_Angeles] + plainDate.toZonedDateTime({ timeZone: "America/Los_Angeles" }); + // => 2006-08-24T00:00:00-07:00[America/Los_Angeles] +} + +{ + const date = Temporal.PlainDate.from("2006-08-24"); + const time = Temporal.PlainTime.from("15:23:30.003"); + date.toPlainDateTime(time); // => 2006-08-24T15:23:30.003 + date.toPlainDateTime(); // => 2006-08-24T00:00:00 +} + +{ + const date = Temporal.PlainDate.from("2006-08-24"); + date.toPlainYearMonth(); // => 2006-08 + date.toPlainMonthDay(); // => 08-24 +} + +{ + // Leet hour + const time = new Temporal.PlainTime(13, 37); // => 13:37:00 +} + +{ + let time: Temporal.PlainTime; + + time = Temporal.PlainTime.from("03:24:30"); // => 03:24:30 + time = Temporal.PlainTime.from("032430"); // => 03:24:30 + time = Temporal.PlainTime.from("1995-12-07T03:24:30"); // => 03:24:30 + time = Temporal.PlainTime.from("1995-12-07T03:24:30+01:00[Europe/Brussels]"); + // => 03:24:30 + // (same as above; time zone is ignored) + time === Temporal.PlainTime.from(time); // => false + + time = Temporal.PlainTime.from({ + hour: 19, + minute: 39, + second: 9, + millisecond: 68, + microsecond: 346, + nanosecond: 205, + }); // => 19:39:09.068346205 + time = Temporal.PlainTime.from({ hour: 19, minute: 39, second: 9 }); // => 19:39:09 + time = Temporal.PlainTime.from(Temporal.PlainDateTime.from("2020-02-15T19:39:09")); + // => 19:39:09 + // (same as above; Temporal.PlainDateTime has hour, minute, etc. properties) + + // Different overflow modes + time = Temporal.PlainTime.from({ hour: 15, minute: 60 }, { overflow: "constrain" }); + // => 15:59:00 + time = Temporal.PlainTime.from({ hour: 15, minute: -1 }, { overflow: "constrain" }); + // => 15:00:00 + time = Temporal.PlainTime.from({ hour: 15, minute: 60 }, { overflow: "reject" }); + // => throws + time = Temporal.PlainTime.from({ hour: 15, minute: -1 }, { overflow: "reject" }); + // => throws +} + +{ + const one = Temporal.PlainTime.from("03:24"); + const two = Temporal.PlainTime.from("01:24"); + const three = Temporal.PlainTime.from("01:24:05"); + const sorted = [one, two, three].sort(Temporal.PlainTime.compare); + sorted.join(" "); // => '01:24:00 01:24:05 03:24:00' +} + +{ + // Backward transitions will repeat clock times + const zdtDst = Temporal.ZonedDateTime.from("2020-11-01T01:45-07:00[America/Los_Angeles]"); + const zdtStandard = Temporal.ZonedDateTime.from("2020-11-01T01:30-08:00[America/Los_Angeles]"); + // The "first" 1:45 (in Daylight Time) is earlier than the "second" 1:30 (in Standard Time) + Temporal.ZonedDateTime.compare(zdtDst, zdtStandard); // => -1 + // 1:45 is later than 1:30 when looking at a wall clock + Temporal.PlainTime.compare(zdtDst, zdtStandard); // => 1 + + // Forward transitions will skip clock times. Skipped times will be disambiguated. + const zdtBase = Temporal.ZonedDateTime.from("2020-03-08[America/Los_Angeles]"); + const timeSkipped = Temporal.PlainTime.from("02:30"); + const timeValid = Temporal.PlainTime.from("03:30"); + const zdtSkipped = zdtBase.withPlainTime(timeSkipped); + const zdtValid = zdtBase.withPlainTime(timeValid); + // The skipped time 2:30AM is disambiguated to 3:30AM, so the instants are equal + Temporal.ZonedDateTime.compare(zdtSkipped, zdtValid); // => 0 + // 2:30 is earlier than 3:30 on a wall clock + Temporal.PlainTime.compare(timeSkipped, timeValid); // => -1 +} + +{ + const time = Temporal.PlainTime.from("19:39:09.068346205"); + time.hour; // => 19 + time.minute; // => 39 + time.second; // => 9 + time.millisecond; // => 68 + time.microsecond; // => 346 + time.nanosecond; // => 205 +} + +{ + const time = Temporal.PlainTime.from("19:39:09.068346205"); + // What's the top of the next hour? + time.add({ hours: 1 }).with({ + minute: 0, + second: 0, + millisecond: 0, + microsecond: 0, + nanosecond: 0, + }); // => 20:00:00 +} + +{ + const time = Temporal.PlainTime.from("19:39:09.068346205"); + time.add({ minutes: 5, nanoseconds: 800 }); // => 19:44:09.068347005 +} + +{ + const time = Temporal.PlainTime.from("19:39:09.068346205"); + time.subtract({ minutes: 5, nanoseconds: 800 }); // => 19:34:09.068345405 +} + +{ + const time = Temporal.PlainTime.from("20:13:20.971398099"); + time.until(Temporal.PlainTime.from("22:39:09.068346205")); // => PT2H25M48.096948106S + time.until(Temporal.PlainTime.from("19:39:09.068346205")); // => -PT34M11.903051894S + + // Rounding, for example if you don't care about sub-seconds + time.until(Temporal.PlainTime.from("22:39:09.068346205"), { smallestUnit: "second" }); + // => PT2H25M48S +} + +{ + const time = Temporal.PlainTime.from("20:13:20.971398099"); + time.since(Temporal.PlainTime.from("19:39:09.068346205")); // => PT34M11.903051894S + time.since(Temporal.PlainTime.from("22:39:09.068346205")); // => -PT2H25M48.096948106S +} + +{ + const time = Temporal.PlainTime.from("19:39:09.068346205"); + + // Round to a particular unit + time.round({ smallestUnit: "hour" }); // => 20:00:00 + // Round to an increment of a unit, e.g. half an hour: + time.round({ roundingIncrement: 30, smallestUnit: "minute" }); + // => 19:30:00 + // Round to the same increment but round up instead: + time.round({ roundingIncrement: 30, smallestUnit: "minute", roundingMode: "ceil" }); + // => 20:00:00 +} + +{ + const time = Temporal.PlainTime.from("19:39:09.068346205"); + const other = Temporal.PlainTime.from("20:13:20.971398099"); + time.equals(other); // => false + time.equals(time); // => true +} + +{ + const time = Temporal.PlainTime.from("19:39:09.068346205"); + time.toString(); // => '19:39:09.068346205' + + time.toString({ smallestUnit: "minute" }); // => '19:39' + time.toString({ fractionalSecondDigits: 0 }); // => '19:39:09' + time.toString({ fractionalSecondDigits: 4 }); // => '19:39:09.0683' + time.toString({ fractionalSecondDigits: 5, roundingMode: "halfExpand" }); + // => '19:39:09.06835' +} + +{ + const time = Temporal.PlainTime.from("19:39:09.068346205"); + time.toLocaleString(); // example output: '7:39:09 PM' + time.toLocaleString("de-DE"); // example output: '19:39:09' + time.toLocaleString("de-DE", { timeZone: "Europe/Berlin" }); // => '19:39:09' + time.toLocaleString("en-US-u-nu-fullwide-hc-h24"); // => '19:39:09' +} + +{ + // Leet hour on pi day in 2020 + const datetime = new Temporal.PlainDateTime(2020, 3, 14, 13, 37); // => 2020-03-14T13:37:00 +} + +{ + let dt: Temporal.PlainDateTime; + + dt = Temporal.PlainDateTime.from("1995-12-07T03:24:30"); + dt = Temporal.PlainDateTime.from("19951207T032430"); + dt = Temporal.PlainDateTime.from("1995-12-07T03:24:30+01:00[Europe/Brussels]"); + // => 1995-12-07T03:24:30 + // same as above; time zone is ignored + dt === Temporal.PlainDateTime.from(dt); // => false + + dt = Temporal.PlainDateTime.from({ + year: 1995, + month: 12, + day: 7, + hour: 3, + minute: 24, + second: 30, + millisecond: 0, + microsecond: 3, + nanosecond: 500, + }); // => 1995-12-07T03:24:30.0000035 + dt = Temporal.PlainDateTime.from({ year: 1995, month: 12, day: 7 }); // => 1995-12-07T00:00:00 + dt = Temporal.PlainDateTime.from(Temporal.PlainDate.from("1995-12-07T03:24:30")); + // => 1995-12-07T00:00:00 + // same as above; Temporal.PlainDate has year, month, and day properties + + dt = Temporal.PlainDateTime.from({ year: 5756, month: 3, day: 14, hour: 3, minute: 24, second: 30, calendar: "hebrew" }); + // => 1995-12-07T03:24:30[u-ca=hebrew] + + // Different overflow modes + dt = Temporal.PlainDateTime.from({ year: 2001, month: 13, day: 1 }, { overflow: "constrain" }); + // => 2001-12-01T00:00:00 + dt = Temporal.PlainDateTime.from({ year: 2001, month: 1, day: 32 }, { overflow: "constrain" }); + // => 2001-01-31T00:00:00 + dt = Temporal.PlainDateTime.from({ year: 2001, month: 1, day: 1, hour: 25 }, { overflow: "constrain" }); + // => 2001-01-01T23:00:00 + dt = Temporal.PlainDateTime.from({ year: 2001, month: 1, day: 1, minute: 60 }, { overflow: "constrain" }); + // => 2001-01-01T00:59:00 + dt = Temporal.PlainDateTime.from({ year: 2001, month: 13, day: 1 }, { overflow: "reject" }); + // => throws + dt = Temporal.PlainDateTime.from({ year: 2001, month: 1, day: 32 }, { overflow: "reject" }); + // => throws + dt = Temporal.PlainDateTime.from({ year: 2001, month: 1, day: 1, hour: 25 }, { overflow: "reject" }); + // => throws + dt = Temporal.PlainDateTime.from({ year: 2001, month: 1, day: 1, minute: 60 }, { overflow: "reject" }); + // => throws +} + +{ + const one = Temporal.PlainDateTime.from("1995-12-07T03:24"); + const two = Temporal.PlainDateTime.from("1995-12-07T01:24"); + const three = Temporal.PlainDateTime.from("2015-12-07T01:24"); + const sorted = [one, two, three].sort(Temporal.PlainDateTime.compare); + sorted.join(" "); + // => '1995-12-07T01:24:00 1995-12-07T03:24:00 2015-12-07T01:24:00' +} + +{ + let dt: Temporal.PlainDateTime; + + dt = Temporal.PlainDateTime.from("1995-12-07T03:24:30.000003500"); + dt.year; // => 1995 + dt.month; // => 12 + dt.monthCode; // => 'M12' + dt.day; // => 7 + dt.hour; // => 3 + dt.minute; // => 24 + dt.second; // => 30 + dt.millisecond; // => 0 + dt.microsecond; // => 3 + dt.nanosecond; // => 500 + + dt = Temporal.PlainDateTime.from("2019-02-23T03:24:30.000003500[u-ca=hebrew]"); + dt.year; // => 5779 + dt.month; // => 6 + dt.monthCode; // => 'M05L' + dt.day; // => 18 + dt.hour; // => 3 + dt.minute; // => 24 + dt.second; // => 30 + dt.millisecond; // => 0 + dt.microsecond; // => 3 + dt.nanosecond; // => 500 +} + +{ + const date = Temporal.PlainDateTime.from("-000015-01-01T12:30[u-ca=gregory]"); + date.era; + // => 'bce' + date.eraYear; + // => 16 + date.year; + // => -15 +} + +{ + const dt = Temporal.PlainDateTime.from("1995-12-07T03:24:30.000003500"); + ["MON", "TUE", "WED", "THU", "FRI", "SAT", "SUN"][dt.dayOfWeek - 1]; // => 'THU' +} + +{ + const dt = Temporal.PlainDateTime.from("1995-12-07T03:24:30.000003500"); + // ISO ordinal date + console.log(dt.year, dt.dayOfYear); // => '1995 341' +} + +{ + const dt = Temporal.PlainDateTime.from("2022-01-01T03:24:30.000003500"); + // ISO week date + console.log(dt.yearOfWeek, dt.weekOfYear, dt.dayOfWeek); // => '2021 52 6' +} + +{ + const dt = Temporal.PlainDateTime.from("1995-12-07T03:24:30.000003500"); + dt.daysInWeek; // => 7 +} + +{ + // Attempt to write some mnemonic poetry + const monthsByDays: Record = {}; + for (let month = 1; month <= 12; month++) { + const dt = Temporal.Now.plainDateTimeISO().with({ month }); + monthsByDays[dt.daysInMonth] = (monthsByDays[dt.daysInMonth] || []).concat(dt); + } + + const strings = monthsByDays[30].map(dt => dt.toLocaleString("en", { month: "long" })); + // Shuffle to improve poem as determined empirically + strings.unshift(strings.pop()!); + const format = new Intl.ListFormat("en"); + const poem = `Thirty days hath ${format.format(strings)}`; + + console.log(poem); +} + +{ + const dt = Temporal.Now.plainDateTimeISO(); + const percent = dt.dayOfYear / dt.daysInYear; + `The year is ${percent.toLocaleString("en", { style: "percent" })} over!`; + // example output: "The year is 10% over!" +} + +{ + const dt = Temporal.PlainDate.from("1900-01-01T12:00"); + dt.monthsInYear; // => 12 +} + +{ + // Is this year a leap year? + const dt = Temporal.Now.plainDateTimeISO(); + dt.inLeapYear; // example output: true + // Is 2100 a leap year? (no, because it's divisible by 100 and not 400) + dt.with({ year: 2100 }).inLeapYear; // => false +} + +{ + const dt = Temporal.PlainDateTime.from("1995-12-07T03:24:30.000003500"); + dt.with({ year: 2015, second: 31 }); // => 2015-12-07T03:24:31.0000035 +} + +{ + const dt = Temporal.PlainDateTime.from("2015-12-07T03:24:30.000003500"); + dt.withPlainTime({ hour: 10 }); // => 2015-12-07T10:00:00 + const time = Temporal.PlainTime.from("11:22"); + dt.withPlainTime(time); // => 2015-12-07T11:22:00 + dt.withPlainTime("12:34"); // => 2015-12-07T12:34:00 + + // easier for chaining + dt.add({ days: 2, hours: 22 }).withPlainTime("00:00"); // => 2015-12-10T00:00:00 +} + +{ + const dt = Temporal.PlainDateTime.from("1995-12-07T03:24:30.000003500[u-ca=japanese]"); + dt.withCalendar("iso8601"); // => 1995-12-07T03:24:30.0000035 +} + +{ + let dt: Temporal.PlainDateTime; + + dt = Temporal.PlainDateTime.from("1995-12-07T03:24:30.000003500"); + dt.add({ years: 20, months: 4, nanoseconds: 500 }); // => 2016-04-07T03:24:30.000004 + + dt = Temporal.PlainDateTime.from("2019-01-31T15:30"); + dt.add({ months: 1 }); // => 2019-02-28T15:30:00 + dt.add({ months: 1 }, { overflow: "reject" }); // => throws +} + +{ + let dt: Temporal.PlainDateTime; + + dt = Temporal.PlainDateTime.from("1995-12-07T03:24:30.000003500"); + dt.subtract({ years: 20, months: 4, nanoseconds: 500 }); // => 1975-08-07T03:24:30.000003 + + dt = Temporal.PlainDateTime.from("2019-03-31T15:30"); + dt.subtract({ months: 1 }); // => 2019-02-28T15:30:00 + dt.subtract({ months: 1 }, { overflow: "reject" }); // => throws +} + +{ + const dt1 = Temporal.PlainDateTime.from("1995-12-07T03:24:30.000003500"); + const dt2 = Temporal.PlainDateTime.from("2019-01-31T15:30"); + dt1.until(dt2); + // => P8456DT12H5M29.9999965S + dt1.until(dt2, { largestUnit: "year" }); + // => P23Y1M24DT12H5M29.9999965S + dt2.until(dt1, { largestUnit: "year" }); + // => -P23Y1M24DT12H5M29.9999965S + dt1.until(dt2, { largestUnit: "nanosecond" }); + // => PT730641929.999996544S + // (precision lost) + + // Rounding, for example if you don't care about sub-seconds + dt1.until(dt2, { smallestUnit: "second" }); + // => P8456DT12H5M29S + + // Months and years can be different lengths + const [jan1, feb1, mar1] = [1, 2, 3].map(month => Temporal.PlainDateTime.from({ year: 2020, month, day: 1 })); + jan1.until(feb1); // => P31D + jan1.until(feb1, { largestUnit: "month" }); // => P1M + feb1.until(mar1); // => P29D + feb1.until(mar1, { largestUnit: "month" }); // => P1M + jan1.until(mar1); // => P60D +} + +{ + const dt1 = Temporal.PlainDateTime.from("1995-12-07T03:24:30.000003500"); + const dt2 = Temporal.PlainDateTime.from("2019-01-31T15:30"); + dt2.since(dt1); // => P8456DT12H5M29.9999965S +} + +{ + const dt = Temporal.PlainDateTime.from("1995-12-07T03:24:30.000003500"); + + // Round to a particular unit + dt.round({ smallestUnit: "hour" }); // => 1995-12-07T03:00:00 + // Round to an increment of a unit, e.g. half an hour: + dt.round({ roundingIncrement: 30, smallestUnit: "minute" }); + // => 1995-12-07T03:30:00 + // Round to the same increment but round down instead: + dt.round({ roundingIncrement: 30, smallestUnit: "minute", roundingMode: "floor" }); + // => 1995-12-07T03:00:00 +} + +{ + const dt1 = Temporal.PlainDateTime.from("1995-12-07T03:24:30.000003500"); + const dt2 = Temporal.PlainDateTime.from("2019-01-31T15:30"); + dt1.equals(dt2); // => false + dt1.equals(dt1); // => true +} + +{ + const dt = Temporal.PlainDateTime.from({ + year: 1999, + month: 12, + day: 31, + hour: 23, + minute: 59, + second: 59, + millisecond: 999, + microsecond: 999, + nanosecond: 999, + }); + dt.toString(); // => '1999-12-31T23:59:59.999999999' + + dt.toString({ smallestUnit: "minute" }); // => '1999-12-31T23:59' + dt.toString({ fractionalSecondDigits: 0 }); // => '1999-12-31T23:59:59' + dt.toString({ fractionalSecondDigits: 4 }); // => '1999-12-31T23:59:59.9999' + dt.toString({ fractionalSecondDigits: 8, roundingMode: "halfExpand" }); + // => '2000-01-01T00:00:00.00000000' +} + +{ + const dt = Temporal.PlainDateTime.from("1995-12-07T03:24:30.000003500"); + dt.toLocaleString(); // example output: 1995-12-07, 3:24:30 a.m. + dt.toLocaleString("de-DE"); // example output: 7.12.1995, 03:24:30 + dt.toLocaleString("de-DE", { timeZone: "Europe/Berlin", weekday: "long" }); // => 'Donnerstag' + dt.toLocaleString("en-US-u-nu-fullwide-hc-h12"); // => '12/7/1995, 3:24:30 AM' +} + +{ + const dt = Temporal.PlainDateTime.from("1995-12-07T03:24:30.000003500"); + dt.toPlainDate(); // => 1995-12-07 + dt.toPlainTime(); // => 03:24:30.0000035 + dt.toPlainDate().toPlainYearMonth(); // => 1995-12 + dt.toPlainDate().toPlainMonthDay(); // => 12-07 +} + +{ + // The June 2019 meeting + const ym = new Temporal.PlainYearMonth(2019, 6); + // => 2019-06 +} + +{ + let ym: Temporal.PlainYearMonth; + + ym = Temporal.PlainYearMonth.from("2019-06"); // => 2019-06 + ym = Temporal.PlainYearMonth.from("2019-06-24"); // => 2019-06 + ym = Temporal.PlainYearMonth.from("2019-06-24T15:43:27"); // => 2019-06 + ym = Temporal.PlainYearMonth.from("2019-06-24T15:43:27+01:00[Europe/Brussels]"); + // => 2019-06 + ym === Temporal.PlainYearMonth.from(ym); // => false + + ym = Temporal.PlainYearMonth.from({ year: 2019, month: 6 }); // => 2019-06 + ym = Temporal.PlainYearMonth.from(Temporal.PlainDate.from("2019-06-24")); + // => 2019-06 + // (same as above; Temporal.PlainDate has year and month properties) + + // Different overflow modes + ym = Temporal.PlainYearMonth.from({ year: 2001, month: 13 }, { overflow: "constrain" }); + // => 2001-12 + ym = Temporal.PlainYearMonth.from({ year: 2001, month: 13 }, { overflow: "reject" }); + // => throws +} + +{ + const one = Temporal.PlainYearMonth.from("2006-08"); + const two = Temporal.PlainYearMonth.from("2015-07"); + const three = Temporal.PlainYearMonth.from("1930-02"); + const sorted = [one, two, three].sort(Temporal.PlainYearMonth.compare); + sorted.join(" "); // => '1930-02 2006-08 2015-07' +} + +{ + let ym: Temporal.PlainYearMonth; + + ym = Temporal.PlainYearMonth.from("2019-06"); + ym.year; // => 2019 + ym.month; // => 6 + ym.monthCode; // => 'M06' + + ym = Temporal.PlainYearMonth.from("2019-02-23[u-ca=hebrew]"); + ym.year; // => 5779 + ym.month; // => 6 + ym.monthCode; // => 'M05L' +} + +{ + const ym = Temporal.PlainYearMonth.from("-000015-01-01[u-ca=gregory]"); + ym.era; + // => 'bce' + ym.eraYear; + // => 16 + ym.year; + // => -15 +} + +{ + // Attempt to write some mnemonic poetry + const monthsByDays: Record = {}; + for (let month = 1; month <= 12; month++) { + const ym = Temporal.PlainYearMonth.from({ year: 2020, calendar: "iso8601", month }); + monthsByDays[ym.daysInMonth] = (monthsByDays[ym.daysInMonth] || []).concat(ym); + } + + const strings = monthsByDays[30].map(ym => ym.toLocaleString("en", { month: "long", calendar: "iso8601" })); + // Shuffle to improve poem as determined empirically + strings.unshift(strings.pop()!); + const format = new Intl.ListFormat("en"); + const poem = `Thirty days hath ${format.format(strings)}`; + + console.log(poem); +} + +{ + const ym = Temporal.PlainYearMonth.from({ year: 2019, month: 6, calendar: "iso8601" }); + const percent = ym.daysInMonth / ym.daysInYear; + `${ym.toLocaleString("en", { month: "long", year: "numeric", calendar: "iso8601" })} was ${percent.toLocaleString("en", { style: "percent" })} of the year!`; + // => 'June 2019 was 8% of the year!' +} + +{ + const ym = Temporal.PlainYearMonth.from("1900-01"); + ym.monthsInYear; // => 12 +} + +{ + // Was June 2019 in a leap year? + const ym = Temporal.PlainYearMonth.from("2019-06"); + ym.inLeapYear; // => false + // Is 2100 a leap year? (no, because it's divisible by 100 and not 400) + ym.with({ year: 2100 }).inLeapYear; // => false +} + +{ + const ym = Temporal.PlainYearMonth.from("2019-06"); + // Get December of that year + ym.with({ month: 12 }); // => 2019-12 +} + +{ + const ym = Temporal.PlainYearMonth.from("2019-06"); + ym.add({ years: 20, months: 4 }); // => 2039-10 +} + +{ + const ym = Temporal.PlainYearMonth.from("2019-06"); + ym.subtract({ years: 20, months: 4 }); // => 1999-02 +} + +{ + const ym = Temporal.PlainYearMonth.from("2006-08"); + const other = Temporal.PlainYearMonth.from("2019-06"); + ym.until(other); // => P12Y10M + ym.until(other, { largestUnit: "month" }); // => P154M + other.until(ym, { largestUnit: "month" }); // => -P154M + + // If you really need to calculate the difference between two YearMonths + // in days, you can eliminate the ambiguity by explicitly choosing the + // day of the month (and if applicable, the time of that day) from which + // you want to reckon the difference. For example, using the first of + // the month to calculate a number of days: + ym.toPlainDate({ day: 1 }).until(other.toPlainDate({ day: 1 }), { largestUnit: "day" }); // => P4687D +} + +{ + const ym = Temporal.PlainYearMonth.from("2019-06"); + const other = Temporal.PlainYearMonth.from("2006-08"); + ym.since(other); // => P12Y10M +} + +{ + const ym = Temporal.PlainYearMonth.from("2019-06"); + const other = Temporal.PlainYearMonth.from("2006-08"); + ym.equals(other); // => false + ym.equals(ym); // => true +} + +{ + const ym = Temporal.PlainYearMonth.from("2019-06"); + ym.toString(); // => '2019-06' +} + +{ + const { calendar } = new Intl.DateTimeFormat().resolvedOptions(); + const ym = Temporal.PlainYearMonth.from({ year: 2019, month: 6, calendar }); + ym.toLocaleString(); // example output: '6/2019' + // Same as above, but explicitly specifying the calendar: + ym.toLocaleString(undefined, { calendar }); + + ym.toLocaleString("de-DE", { calendar }); // example output: '6.2019' + ym.toLocaleString("de-DE", { month: "long", year: "numeric", calendar }); // => 'Juni 2019' + ym.toLocaleString(`en-US-u-nu-fullwide-ca-${calendar}`); // => '6/2019' +} + +{ + const ym = Temporal.PlainYearMonth.from("2019-06"); + ym.toPlainDate({ day: 24 }); // => 2019-06-24 +} + +{ + let md: Temporal.PlainMonthDay; + + // Pi day + md = new Temporal.PlainMonthDay(3, 14); // => 03-14 + // Leap day + md = new Temporal.PlainMonthDay(2, 29); // => 02-29 +} + +{ + let md: Temporal.PlainMonthDay; + + md = Temporal.PlainMonthDay.from("08-24"); // => 08-24 + md = Temporal.PlainMonthDay.from("0824"); // => 08-24 + md = Temporal.PlainMonthDay.from("2006-08-24"); // => 08-24 + md = Temporal.PlainMonthDay.from("2006-08-24T15:43:27"); // => 08-24 + md = Temporal.PlainMonthDay.from("2006-08-24T15:43:27+01:00[Europe/Brussels]"); + // => 08-24 + md === Temporal.PlainMonthDay.from(md); // => false + + md = Temporal.PlainMonthDay.from({ monthCode: "M08", day: 24 }); // => 08-24 + md = Temporal.PlainMonthDay.from(Temporal.PlainDate.from("2006-08-24")); + // => 08-24 + // (same as above; Temporal.PlainDate has month and day properties) + + // Different overflow modes + md = Temporal.PlainMonthDay.from({ month: 13, day: 1, year: 2000 }, { overflow: "constrain" }); + // => 12-01 + md = Temporal.PlainMonthDay.from({ month: 1, day: 32, year: 2000 }, { overflow: "constrain" }); + // => 01-31 + md = Temporal.PlainMonthDay.from({ month: 13, day: 1, year: 2000 }, { overflow: "reject" }); + // => throws + md = Temporal.PlainMonthDay.from({ month: 1, day: 32, year: 2000 }, { overflow: "reject" }); + // => throws + md = Temporal.PlainMonthDay.from({ month: 2, day: 29, year: 2001 }, { overflow: "reject" }); + // => throws (this year is not a leap year in the ISO 8601 calendar) + + // non-ISO calendars + md = Temporal.PlainMonthDay.from({ monthCode: "M05L", day: 15, calendar: "hebrew" }); + // => 1970-02-21[u-ca=hebrew] + md = Temporal.PlainMonthDay.from({ month: 6, day: 15, year: 5779, calendar: "hebrew" }); + // => 1970-02-21[u-ca=hebrew] + /* WRONG */ md = Temporal.PlainMonthDay.from({ month: 6, day: 15, calendar: "hebrew" }); + // => throws (either year or monthCode is required) + md = Temporal.PlainMonthDay.from("2019-02-20[u-ca=hebrew]"); + md.monthCode; // => 'M05L' + md.day; // => 15 + md.month; // undefined + // (month property is not present in this type; use monthCode instead) +} + +{ + let md: Temporal.PlainMonthDay; + + md = Temporal.PlainMonthDay.from("08-24"); + md.monthCode; // => 'M08' + md.day; // => 24 + md.month; // => undefined + // (no `month` property; use `monthCode` instead) + + md = Temporal.PlainMonthDay.from("2019-02-20[u-ca=hebrew]"); + md.monthCode; // => 'M05L' + md.day; // => 15 + md.month; // => undefined + // (no `month` property; use `monthCode` instead) +} + +{ + const md = Temporal.PlainMonthDay.from("11-15"); + // What's the last day of that month? + md.with({ day: 31 }); // => 11-30 + Temporal.PlainMonthDay.from("02-01").with({ day: 31 }); // => 02-29 +} + +{ + const md1 = Temporal.PlainMonthDay.from("02-28"); + const md2 = Temporal.PlainMonthDay.from("02-29"); + md1.equals(md2); // => false + md1.equals("02-29"); // => false + md1.equals({ monthCode: "M02", day: 29 }); // => false + md2.equals(md2); // => true + md2.equals("02-29"); // => true + md2.equals({ monthCode: "M02", day: 29 }); // => true +} + +{ + const md = Temporal.PlainMonthDay.from("08-24"); + md.toString(); // => '08-24' +} + +{ + const { calendar } = new Intl.DateTimeFormat().resolvedOptions(); + const md = Temporal.PlainMonthDay.from({ monthCode: "M08", day: 24, calendar }); + md.toLocaleString(); // example output: '8/24' + // Same as above, but explicitly specifying the calendar: + md.toLocaleString(undefined, { calendar }); // example output: '8/24' + + md.toLocaleString("de-DE", { calendar }); // => '24.8.' + md.toLocaleString("de-DE", { month: "long", day: "numeric", calendar }); // => '24. August' + md.toLocaleString(`en-US-u-nu-fullwide-ca-${calendar}`); // => '8/24' +} + +{ + const md = Temporal.PlainMonthDay.from({ + calendar: "japanese", + monthCode: "M01", + day: 1, + }); + + const date = md.toPlainDate({ era: "reiwa", eraYear: 2 }); // => 2020-01-01[u-ca=japanese] +} + +{ + new Temporal.Duration(1, 2, 3, 4, 5, 6, 7, 987, 654, 321); // => P1Y2M3W4DT5H6M7.987654321S + new Temporal.Duration(0, 0, 0, 40); // => P40D + new Temporal.Duration(undefined, undefined, undefined, 40); // => P40D + new Temporal.Duration(); // => PT0S +} + +{ + let d: Temporal.Duration; + + d = Temporal.Duration.from({ years: 1, days: 1 }); // => P1Y1D + d = Temporal.Duration.from({ days: -2, hours: -12 }); // => -P2DT12H + + Temporal.Duration.from(d) === d; // => false + + d = Temporal.Duration.from("P1Y1D"); // => P1Y1D + d = Temporal.Duration.from("-P2DT12H"); // => -P2DT12H + d = Temporal.Duration.from("P0D"); // => PT0S +} + +{ + const one = Temporal.Duration.from({ hours: 79, minutes: 10 }); + const two = Temporal.Duration.from({ days: 3, hours: 7, seconds: 630 }); + const three = Temporal.Duration.from({ days: 3, hours: 6, minutes: 50 }); + const sorted1 = [one, two, three].sort(Temporal.Duration.compare); + sorted1.join(" "); + // => 'P3DT6H50M PT79H10M P3DT7H630S' + + // Sorting relative to a date, taking DST changes into account: + const relativeTo = Temporal.ZonedDateTime.from("2020-11-01T00:00-07:00[America/Los_Angeles]"); + const sorted2 = [one, two, three].sort((one, two) => Temporal.Duration.compare(one, two, { relativeTo })); + sorted2.join(" "); + // => 'PT79H10M P3DT6H50M P3DT7H630S' +} + +{ + const d = Temporal.Duration.from("P1Y2M3W4DT5H6M7.987654321S"); + d.years; // => 1 + d.months; // => 2 + d.weeks; // => 3 + d.days; // => 4 + d.hours; // => 5 + d.minutes; // => 6 + d.seconds; // => 7 + d.milliseconds; // => 987 + d.microseconds; // => 654 + d.nanoseconds; // => 321 +} + +{ + let d: Temporal.Duration; + + d = Temporal.Duration.from("PT0S"); + d.blank; // => true + + d = Temporal.Duration.from({ days: 0, hours: 0, minutes: 0 }); + d.blank; // => true +} + +{ + let duration: Temporal.Duration; + + duration = Temporal.Duration.from({ months: 50, days: 50, hours: 50, minutes: 100 }); + // Perform a balance operation using additional ISO 8601 calendar rules: + let { years, months } = duration; + years += Math.floor(months / 12); + months %= 12; + duration = duration.with({ years, months }); + // => P4Y2M50DT50H100M +} + +{ + const hour = Temporal.Duration.from("PT1H"); + hour.add({ minutes: 30 }); // => PT1H30M + + // Examples of balancing: + const one = Temporal.Duration.from({ hours: 1, minutes: 30 }); + const two = Temporal.Duration.from({ hours: 2, minutes: 45 }); + const result = one.add(two); // => PT4H15M + + // Example of adding calendar units + const oneAndAHalfMonth = Temporal.Duration.from({ months: 1, days: 16 }); + + // To convert units, use arithmetic relative to a start date: + const startDate1 = Temporal.PlainDate.from("2000-12-01"); + startDate1.add(oneAndAHalfMonth).add(oneAndAHalfMonth) + .since(startDate1, { largestUnit: "months" }); // => P3M4D + + const startDate2 = Temporal.PlainDate.from("2001-01-01"); + startDate2.add(oneAndAHalfMonth).add(oneAndAHalfMonth) + .since(startDate2, { largestUnit: "months" }); // => P3M1D +} + +{ + const hourAndAHalf = Temporal.Duration.from("PT1H30M"); + hourAndAHalf.subtract({ hours: 1 }); // => PT30M + + const one = Temporal.Duration.from({ minutes: 180 }); + const two = Temporal.Duration.from({ seconds: 30 }); + one.subtract(two); // => PT179M30S + one.subtract(two).round({ largestUnit: "hour" }); // => PT2H59M30S + + // Example of subtracting calendar units; cannot be subtracted using + // subtract() because units need to be converted + const threeMonths = Temporal.Duration.from({ months: 3 }); + const oneAndAHalfMonth = Temporal.Duration.from({ months: 1, days: 15 }); + + // To convert units, use arithmetic relative to a start date: + const startDate1 = Temporal.PlainDate.from("2001-01-01"); + startDate1.add(threeMonths).subtract(oneAndAHalfMonth) + .since(startDate1, { largestUnit: "months" }); // => P1M13D + + const startDate2 = Temporal.PlainDate.from("2001-02-01"); + startDate2.add(threeMonths).subtract(oneAndAHalfMonth) + .since(startDate2, { largestUnit: "months" }); // => P1M16D +} + +{ + const d = Temporal.Duration.from("P1Y2M3DT4H5M6.987654321S"); + d.sign; // 1 + d.negated(); // -P1Y2M3DT4H5M6.987654321S + d.negated().sign; // -1 +} + +{ + const d = Temporal.Duration.from("-PT8H30M"); + d.abs(); // PT8H30M +} + +{ + let d: Temporal.Duration; + + // Balance a duration as far as possible without knowing a starting point + d = Temporal.Duration.from({ minutes: 130 }); + d.round({ largestUnit: "day" }); // => PT2H10M + + // Round to the nearest unit + d = Temporal.Duration.from({ minutes: 10, seconds: 52 }); + d.round({ smallestUnit: "minute" }); // => PT11M + d.round({ smallestUnit: "minute", roundingMode: "trunc" }); // => PT10M + + // How many seconds in a multi-unit duration? + d = Temporal.Duration.from("PT2H34M18S"); + d.round({ largestUnit: "second" }).seconds; // => 9258 + + // Normalize, with and without taking DST into account + d = Temporal.Duration.from({ hours: 2756 }); + d.round({ + relativeTo: "2020-01-01T00:00+01:00[Europe/Rome]", + largestUnit: "year", + }); // => P114DT21H + // (one hour longer because DST skipped an hour) + d.round({ + relativeTo: "2020-01-01", + largestUnit: "year", + }); // => P114DT20H + // (one hour shorter if ignoring DST) + + // Normalize days into months or years + d = Temporal.Duration.from({ days: 190 }); + const refDate = Temporal.PlainDate.from("2020-01-01"); + d.round({ relativeTo: refDate, largestUnit: "year" }); // => P6M8D + + // Same, but in a different calendar system + d.round({ + relativeTo: refDate.withCalendar("hebrew"), + largestUnit: "year", + }); // => P6M13D + + // Round a duration up to the next 5-minute billing period + d = Temporal.Duration.from({ minutes: 6 }); + d.round({ + smallestUnit: "minute", + roundingIncrement: 5, + roundingMode: "ceil", + }); // => PT10M + + // How many full 3-month quarters of this year, are in this duration? + d = Temporal.Duration.from({ months: 10, days: 15 }); + d = d.round({ + smallestUnit: "month", + roundingIncrement: 3, + roundingMode: "trunc", + relativeTo: Temporal.Now.plainDateISO(), + }); + const quarters = d.months / 3; + quarters; // => 3 +} + +{ + let d: Temporal.Duration; + + // How many seconds in 130 hours and 20 minutes? + d = Temporal.Duration.from({ hours: 130, minutes: 20 }); + d.total({ unit: "second" }); // => 469200 + + // How many 24-hour days is 123456789 seconds? + d = Temporal.Duration.from("PT123456789S"); + d.total({ unit: "day" }); // 1428.8980208333332 + + // Find totals in months, with and without taking DST into account + d = Temporal.Duration.from({ hours: 2756 }); + d.total({ + relativeTo: "2020-01-01T00:00+01:00[Europe/Rome]", + unit: "month", + }); // => 3.7958333333333334 + d.total({ + unit: "month", + relativeTo: "2020-01-01", + }); // => 3.7944444444444443 +} + +{ + let d: Temporal.Duration; + + d = Temporal.Duration.from({ years: 1, days: 1 }); + d.toString(); // => P1Y1D + d = Temporal.Duration.from({ years: -1, days: -1 }); + d.toString(); // => -P1Y1D + d = Temporal.Duration.from({ milliseconds: 1000 }); + d.toString(); // => PT1S + + // The output format always balances units under 1 s, even if the + // underlying Temporal.Duration object doesn't. + const nobal = Temporal.Duration.from({ milliseconds: 3500 }); + console.log(`${nobal}`, nobal.seconds, nobal.milliseconds); // => 'PT3.5S 0 3500' + const bal = nobal.round({ largestUnit: "year" }); // balance through round + console.log(`${bal}`, bal.seconds, bal.milliseconds); // => 'PT3.5S 3 500' + + d = Temporal.Duration.from("PT59.999999999S"); + d.toString({ smallestUnit: "second" }); // => PT59S + d.toString({ fractionalSecondDigits: 0 }); // => PT59S + d.toString({ fractionalSecondDigits: 4 }); // => PT59.9999S + d.toString({ fractionalSecondDigits: 8, roundingMode: "halfExpand" }); + // => PT60.00000000S +} + +{ + const d = Temporal.Duration.from("P1DT6H30M"); + d.toLocaleString(); // example output: '1 day 6 hours 30 minutes' + d.toLocaleString("de-DE"); // example output: '1 Tag 6 Stunden 30 Minuten' + d.toLocaleString("en-US", { days: "short", hours: "numeric" }); // example output: '1 day 6 hours' +} + +{ + Temporal.Now.instant(); // get the current system exact time + Temporal.Now.timeZoneId(); // get the current system time zone + Temporal.Now.zonedDateTimeISO(); // get the current date and wall-clock time in the system time zone and ISO-8601 calendar + Temporal.Now.plainDateISO(); // get the current date in the system time zone and ISO-8601 calendar + Temporal.Now.plainTimeISO(); // get the current wall-clock time in the system time zone and ISO-8601 calendar + Temporal.Now.plainDateTimeISO(); // same as above, but return the DateTime in the ISO-8601 calendar +} + + +//// [temporal.js] +"use strict"; +/** + * Test cases derived from documentation at tc39/proposal-temporal, + * under the following license: + * + * Copyright 2017, 2018, 2019, 2020 ECMA International + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH + * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, + * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM + * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR + * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. + */ +{ + const instant = Temporal.Instant.from("2020-01-01T00:00+05:30"); // => 2019-12-31T18:30:00Z + instant.epochNanoseconds; // => 1577817000000000000n + // `Temporal.Instant` lacks properties that depend on time zone or calendar + instant.year; // => undefined + const zdtTokyo = instant.toZonedDateTimeISO("Asia/Tokyo"); // => 2020-01-01T03:30:00+09:00[Asia/Tokyo] + zdtTokyo.year; // => 2020 + zdtTokyo.toPlainDate(); // => 2020-01-01 +} +{ + // Convert from `Temporal.Instant` to `Date` (which uses millisecond precision) + const instant = Temporal.Instant.from("2020-01-01T00:00:00.123456789+05:30"); + // => 2019-12-31T18:30:00.123456789Z + const date = new Date(instant.epochMilliseconds); + date.toISOString(); // => 2019-12-31T18:30:00.123Z + // Convert from `Date` to `Temporal.Instant` + const sameInstant = date.toTemporalInstant(); // => 2019-12-31T18:30:00.123Z +} +{ + const date = new Date(2019, 11, 31, 18, 30); // => Tue Dec 31 2019 18:30:00 GMT-0800 (Pacific Standard Time) + const instant = date.toTemporalInstant(); // => 2020-01-01T02:30:00Z + const zonedDateTime = instant.toZonedDateTimeISO(Temporal.Now.timeZoneId()); + // => 2019-12-31T18:30:00-08:00[America/Los_Angeles] + zonedDateTime.day; // => 31 + const dateOnly = zonedDateTime.toPlainDate(); // => 2019-12-31 +} +{ + const instant = new Temporal.Instant(1553906700000000000n); + // When was the Unix epoch? + const epoch = new Temporal.Instant(0n); // => 1970-01-01T00:00:00Z + // Dates before the Unix epoch are negative + const turnOfTheCentury = new Temporal.Instant(-2208988800000000000n); // => 1900-01-01T00:00:00Z +} +{ + let instant; + instant = Temporal.Instant.from("2019-03-30T01:45:00+01:00[Europe/Berlin]"); + instant = Temporal.Instant.from("2019-03-30T01:45+01:00"); + instant = Temporal.Instant.from("2019-03-30T00:45Z"); + instant === Temporal.Instant.from(instant); // => false +} +{ + const legacyDate = new Date("1995-12-17T03:24Z"); + let instant; + instant = Temporal.Instant.fromEpochMilliseconds(legacyDate.getTime()); // => 1995-12-17T03:24:00Z + instant = Temporal.Instant.fromEpochMilliseconds(legacyDate); // valueOf() called implicitly + instant = legacyDate.toTemporalInstant(); // recommended +} +{ + const one = Temporal.Instant.fromEpochMilliseconds(1.0e12); + const two = Temporal.Instant.fromEpochMilliseconds(1.1e12); + const three = Temporal.Instant.fromEpochMilliseconds(1.2e12); + const sorted = [three, one, two].sort(Temporal.Instant.compare); + sorted.join(" "); + // => '2001-09-09T01:46:40Z 2004-11-09T11:33:20Z 2008-01-10T21:20:00Z' +} +{ + const instant = Temporal.Instant.from("2019-03-30T00:45Z"); + new Date(instant.epochMilliseconds); // => 2019-03-30T00:45:00.000Z + // If you need epoch seconds data: + const epochSecs = Math.floor(instant.epochMilliseconds / 1000); // => 1553906700 + const ns = instant.epochNanoseconds; + const epochMicros = ns / 1000n + ((ns % 1000n) < 0n ? -1n : 0n); +} +{ + // Converting a specific exact time to a calendar date / wall-clock time + let timestamp; + timestamp = Temporal.Instant.fromEpochMilliseconds(1553993100000); + timestamp.toZonedDateTimeISO("Europe/Berlin"); // => 2019-03-31T01:45:00+01:00[Europe/Berlin] + timestamp.toZonedDateTimeISO("UTC"); // => 2019-03-31T00:45:00+00:00[UTC] + timestamp.toZonedDateTimeISO("-08:00"); // => 2019-03-30T16:45:00-08:00[-08:00] + // What time was the Unix epoch (timestamp 0) in Bell Labs (Murray Hill, New Jersey, USA) in the Gregorian calendar? + const epoch = Temporal.Instant.fromEpochMilliseconds(0); + epoch.toZonedDateTimeISO("America/New_York").withCalendar("gregory"); + // => 1969-12-31T19:00:00-05:00[America/New_York][u-ca=gregory] + // What time was the Unix epoch in Tokyo in the Japanese calendar? + const zdt = epoch.toZonedDateTimeISO("Asia/Tokyo").withCalendar("japanese"); + // => 1970-01-01T09:00:00+09:00[Asia/Tokyo][u-ca=japanese] + console.log(zdt.eraYear, zdt.era); + // => '45 showa' +} +{ + // Temporal.Instant representing five hours from now + Temporal.Now.instant().add({ hours: 5 }); + const fiveHours = Temporal.Duration.from({ hours: 5 }); + Temporal.Now.instant().add(fiveHours); +} +{ + // Temporal.Instant representing this time an hour ago + Temporal.Now.instant().subtract({ hours: 1 }); + const oneHour = Temporal.Duration.from({ hours: 1 }); + Temporal.Now.instant().subtract(oneHour); +} +{ + const startOfMoonMission = Temporal.Instant.from("1969-07-16T13:32:00Z"); + const endOfMoonMission = Temporal.Instant.from("1969-07-24T16:50:35Z"); + const missionLength = startOfMoonMission.until(endOfMoonMission, { largestUnit: "hour" }); + // => PT195H18M35S + missionLength.toLocaleString(); + // example output: '195 hours 18 minutes 35 seconds' + // Rounding, for example if you don't care about the minutes and seconds + const approxMissionLength = startOfMoonMission.until(endOfMoonMission, { + largestUnit: "hour", + smallestUnit: "hour", + }); + // => PT195H + // A billion (10^9) seconds since the epoch in different units + const epoch = Temporal.Instant.fromEpochMilliseconds(0); + const billion = Temporal.Instant.fromEpochMilliseconds(1e9); + epoch.until(billion); + // => PT1000000000S + epoch.until(billion, { largestUnit: "hour" }); + // => PT277777H46M40S + const ns = epoch.until(billion, { largestUnit: "nanosecond" }); + // => PT1000000000S + ns.add({ nanoseconds: 1 }); + // => PT1000000000S + // (lost precision) + // Calculate the difference in years, eliminating the ambiguity by + // explicitly using the corresponding calendar date in UTC: + epoch.toZonedDateTimeISO("UTC").until(billion.toZonedDateTimeISO("UTC"), { largestUnit: "year" }); + // => P31Y8M8DT1H46M40S +} +{ + const instant = Temporal.Instant.from("2019-03-30T02:45:59.999999999Z"); + // Round to a particular unit + instant.round({ smallestUnit: "second" }); // => 2019-03-30T02:46:00Z + // Round to an increment of a unit, e.g. an hour: + instant.round({ roundingIncrement: 60, smallestUnit: "minute" }); + // => 2019-03-30T03:00:00Z + // Round to the same increment but round down instead: + instant.round({ roundingIncrement: 60, smallestUnit: "minute", roundingMode: "floor" }); + // => 2019-03-30T02:00:00Z +} +{ + const one = Temporal.Instant.fromEpochMilliseconds(1.0e12); + const two = Temporal.Instant.fromEpochMilliseconds(1.1e12); + one.equals(two); // => false + one.equals(one); // => true +} +{ + const instant = Temporal.Instant.fromEpochMilliseconds(1574074321816); + instant.toString(); // => '2019-11-18T10:52:01.816Z' + instant.toString({ timeZone: "UTC" }); + // => '2019-11-18T10:52:01.816+00:00' + instant.toString({ timeZone: "Asia/Seoul" }); + // => '2019-11-18T19:52:01.816+09:00' + instant.toString({ smallestUnit: "minute" }); + // => '2019-11-18T10:52Z' + instant.toString({ fractionalSecondDigits: 0 }); + // => '2019-11-18T10:52:01Z' + instant.toString({ fractionalSecondDigits: 4 }); + // => '2019-11-18T10:52:01.8160Z' + instant.toString({ smallestUnit: "second", roundingMode: "halfExpand" }); + // => '2019-11-18T10:52:02Z' +} +{ + const instant = Temporal.Instant.from("2019-11-18T11:00:00.000Z"); + instant.toLocaleString(); // example output: '2019-11-18, 3:00:00 a.m.' + instant.toLocaleString("de-DE"); // example output: '18.11.2019, 03:00:00' + instant.toLocaleString("de-DE", { + timeZone: "Europe/Berlin", + year: "numeric", + month: "numeric", + day: "numeric", + hour: "numeric", + minute: "numeric", + timeZoneName: "long", + }); // => '18.11.2019, 12:00 Mitteleuropäische Normalzeit' + instant.toLocaleString("en-US-u-nu-fullwide-hc-h12", { + timeZone: "Asia/Kolkata", + }); // => '11/18/2019, 4:30:00 PM' +} +{ + // UNIX epoch in California + new Temporal.ZonedDateTime(0n, "America/Los_Angeles", "iso8601"); + // => 1969-12-31T16:00:00-08:00[America/Los_Angeles] + new Temporal.ZonedDateTime(0n, "America/Los_Angeles"); + // => 1969-12-31T16:00:00-08:00[America/Los_Angeles] + // same, but shorter +} +{ + let zdt; + zdt = Temporal.ZonedDateTime.from("1995-12-07T03:24:30+02:00[Africa/Cairo]"); + zdt = Temporal.ZonedDateTime.from("1995-12-07T03:24:30+02:00[Africa/Cairo][u-ca=islamic]"); + zdt = Temporal.ZonedDateTime.from("19951207T032430+0200[Africa/Cairo]"); + zdt = Temporal.ZonedDateTime.from({ + timeZone: "America/Los_Angeles", + year: 1995, + month: 12, + day: 7, + hour: 3, + minute: 24, + second: 30, + millisecond: 0, + microsecond: 3, + nanosecond: 500, + }); // => 1995-12-07T03:24:30.0000035-08:00[America/Los_Angeles] + // Different overflow modes + zdt = Temporal.ZonedDateTime.from({ timeZone: "Europe/Paris", year: 2001, month: 13, day: 1 }, { overflow: "constrain" }); + // => 2001-12-01T00:00:00+01:00[Europe/Paris] + zdt = Temporal.ZonedDateTime.from({ timeZone: "Europe/Paris", year: 2001, month: 13, day: 1 }, { overflow: "reject" }); + // => throws RangeError +} +{ + const arr = [ + Temporal.ZonedDateTime.from("2020-02-01T12:30-05:00[America/Toronto]"), + Temporal.ZonedDateTime.from("2020-02-01T12:30-05:00[America/New_York]"), + Temporal.ZonedDateTime.from("2020-02-01T12:30+01:00[Europe/Brussels]"), + Temporal.ZonedDateTime.from("2020-02-01T12:30+00:00[Europe/London]"), + ]; + const sorted = arr.sort(Temporal.ZonedDateTime.compare); + JSON.stringify(sorted, undefined, 2); + // => + // '[ + // "2020-02-01T12:30+01:00[Europe/Brussels]", + // "2020-02-01T12:30+00:00[Europe/London]", + // "2020-02-01T12:30-05:00[America/Toronto]", + // "2020-02-01T12:30-05:00[America/New_York]" + // ]' +} +{ + const dt = Temporal.ZonedDateTime.from("1995-12-07T03:24:30.000003500[Europe/Rome]"); + dt.year; // => 1995 + dt.month; // => 12 + dt.monthCode; // => 'M12' + dt.day; // => 7 + dt.hour; // => 3 + dt.minute; // => 24 + dt.second; // => 30 + dt.millisecond; // => 0 + dt.microsecond; // => 3 + dt.nanosecond; // => 500 +} +{ + const zdt = Temporal.ZonedDateTime.from("2020-02-01T12:30+09:00[Asia/Tokyo]"); + const epochMs = zdt.epochMilliseconds; + // => 1580527800000 + zdt.toInstant().epochMilliseconds; + // => 1580527800000 + const legacyDate = new Date(epochMs); + // => 2020-02-01T03:30:00.000Z + // (if the system time zone is America/Los_Angeles) + const epochNanos = zdt.epochNanoseconds; + // => 1580527800000000000n + // If you need epoch seconds data: + const epochSecs = Math.floor(zdt.epochMilliseconds / 1000); // => 1553906700 + // => 1580527800 + // If you need epoch microseconds data: + // (Note the extra check for correct floor rounding with bigints) + const ns = zdt.epochNanoseconds; + const epochMicros = ns / 1000n + ((ns % 1000n) < 0n ? -1n : 0n); + // => 1580527800000000n +} +{ + const zdt = Temporal.ZonedDateTime.from("1995-12-07T03:24-08:00[America/Los_Angeles]"); + `Time zone is: ${zdt.timeZoneId}`; + // => 'Time zone is: America/Los_Angeles' + zdt.withTimeZone("Asia/Kolkata").timeZoneId; + // => Asia/Kolkata + zdt.withTimeZone("Asia/Calcutta").timeZoneId; + // => Asia/Calcutta (does not follow links in the IANA Time Zone Database) + zdt.withTimeZone("europe/paris").timeZoneId; + // => Europe/Paris (normalized to match IANA Time Zone Database capitalization) + zdt.withTimeZone("+05:00").timeZoneId; + // => +05:00 + zdt.withTimeZone("+05").timeZoneId; + // => +05:00 (normalized to ±HH:MM) + zdt.withTimeZone("+0500").timeZoneId; + // => +05:00 (normalized to ±HH:MM) +} +{ + const date = Temporal.ZonedDateTime.from("-000015-01-01T12:30[Europe/Rome][u-ca=gregory]"); + date.era; + // => 'bce' + date.eraYear; + // => 16 + date.year; + // => -15 +} +{ + const zdt = Temporal.ZonedDateTime.from("1995-12-07T03:24-08:00[America/Los_Angeles]"); + ["MON", "TUE", "WED", "THU", "FRI", "SAT", "SUN"][zdt.dayOfWeek - 1]; // => 'THU' +} +{ + const zdt = Temporal.ZonedDateTime.from("1995-12-07T03:24-08:00[America/Los_Angeles]"); + // ISO ordinal date + console.log(zdt.year, zdt.dayOfYear); // => '1995 341' +} +{ + const zdt = Temporal.ZonedDateTime.from("2022-01-01T03:24-08:00[America/Los_Angeles]"); + // ISO week date + console.log(zdt.yearOfWeek, zdt.weekOfYear, zdt.dayOfWeek); // => '2021 52 6' +} +{ + const zdt = Temporal.ZonedDateTime.from("1995-12-07T03:24-08:00[America/Los_Angeles]"); + zdt.daysInWeek; // => 7 +} +{ + // Attempt to write some mnemonic poetry + const monthsByDays = {}; + for (let month = 1; month <= 12; month++) { + const zdt = Temporal.Now.zonedDateTimeISO().with({ month }); + monthsByDays[zdt.daysInMonth] = (monthsByDays[zdt.daysInMonth] || []).concat(zdt); + } + const strings = monthsByDays[30].map(zdt => zdt.toLocaleString("en", { month: "long" })); + // Shuffle to improve poem as determined empirically + strings.unshift(strings.pop()); + const format = new Intl.ListFormat("en"); + const poem = `Thirty days hath ${format.format(strings)}`; + console.log(poem); +} +{ + const zdt = Temporal.Now.zonedDateTimeISO(); + const percent = zdt.dayOfYear / zdt.daysInYear; + `The year is ${percent.toLocaleString("en", { style: "percent" })} over!`; + // example output: "The year is 10% over!" +} +{ + const zdt = Temporal.ZonedDateTime.from("1900-01-01T12:00+09:00[Asia/Tokyo]"); + zdt.monthsInYear; // => 12 +} +{ + // Is this year a leap year? + const zdt = Temporal.Now.zonedDateTimeISO(); + zdt.inLeapYear; // example output: true + // Is 2100 a leap year? (no, because it's divisible by 100 and not 400) + zdt.with({ year: 2100 }).inLeapYear; // => false +} +{ + const zdt = Temporal.ZonedDateTime.from("2010-11-07T23:00:00-03:30[America/St_Johns]"); + zdt.hoursInDay; // 25 +} +{ + const zdt = Temporal.ZonedDateTime.from("2020-11-01T01:30-07:00[America/Los_Angeles]"); + zdt.offsetNanoseconds; + // => -25200000000000 + // (-7 * 3600 * 1e9) +} +{ + const zdt = Temporal.ZonedDateTime.from("2020-11-01T01:30-07:00[America/Los_Angeles]"); + zdt.offset; + // => '-07:00' + zdt.withTimeZone("Asia/Kolkata").offset; + // => '+05:30' + const minus8Hours = "-08:00"; + const daylightTime0130 = Temporal.ZonedDateTime.from("2020-11-01T01:30-07:00[America/Los_Angeles]"); + // => 2020-11-01T01:30:00-07:00[America/Los_Angeles] + // This is Pacific Daylight Time 1:30AM + const repeated0130 = daylightTime0130.with({ offset: minus8Hours }); + // => 2020-11-01T01:30:00-08:00[America/Los_Angeles] + // This is Pacific Standard Time 1:30AM +} +{ + const zdt = Temporal.ZonedDateTime.from("1995-12-07T03:24:00-06:00[America/Chicago]"); + zdt.with({ year: 2015, minute: 31 }); // => 2015-12-07T03:31:00-06:00[America/Chicago] +} +{ + const zdt = Temporal.ZonedDateTime.from("2015-12-07T03:24:30.000003500-08:00[America/Los_Angeles]"); + zdt.withPlainTime({ hour: 10 }); // => 2015-12-07T10:00:00-08:00[America/Los_Angeles] + const time = Temporal.PlainTime.from("11:22"); + zdt.withPlainTime(time); // => 2015-12-07T11:22:00-08:00[America/Los_Angeles] + zdt.withPlainTime("12:34"); // => 2015-12-07T12:34:00-08:00[America/Los_Angeles] + // easier for chaining + zdt.add({ days: 2, hours: 22 }).withPlainTime("00:00"); // => 2015-12-10T00:00:00-08:00[America/Los_Angeles] +} +{ + const zdt = Temporal.ZonedDateTime.from("1995-12-07T03:24:30+09:00[Asia/Tokyo]"); + zdt.toString(); // => '1995-12-07T03:24:30+09:00[Asia/Tokyo]' + zdt.withTimeZone("Africa/Accra").toString(); // => '1995-12-06T18:24:30+00:00[Africa/Accra]' +} +{ + const zdt = Temporal.ZonedDateTime.from("1995-12-07T03:24:30.000003500+09:00[Asia/Tokyo][u-ca=japanese]"); + `${zdt.era} ${zdt.eraYear}`; // => 'heisei 7' + zdt.withCalendar("gregory").eraYear; // => 1995 +} +{ + const zdt = Temporal.ZonedDateTime.from("2020-03-08T00:00-08:00[America/Los_Angeles]"); + // Add a day to get midnight on the day after DST starts + const laterDay = zdt.add({ days: 1 }); + // => 2020-03-09T00:00:00-07:00[America/Los_Angeles] + // Note that the new offset is different, indicating the result is adjusted for DST. + laterDay.since(zdt, { largestUnit: "hour" }).hours; + // => 23 + // because one clock hour lost to DST + const laterHours = zdt.add({ hours: 24 }); + // => 2020-03-09T01:00:00-07:00[America/Los_Angeles] + // Adding time units doesn't adjust for DST. Result is 1:00AM: 24 real-world + // hours later because a clock hour was skipped by DST. + laterHours.since(zdt, { largestUnit: "hour" }).hours; // => 24 +} +{ + const zdt = Temporal.ZonedDateTime.from("2020-03-09T00:00-07:00[America/Los_Angeles]"); + // Add a day to get midnight on the day after DST starts + const earlierDay = zdt.subtract({ days: 1 }); + // => 2020-03-08T00:00:00-08:00[America/Los_Angeles] + // Note that the new offset is different, indicating the result is adjusted for DST. + earlierDay.since(zdt, { largestUnit: "hour" }).hours; + // => -23 + // because one clock hour lost to DST + const earlierHours = zdt.subtract({ hours: 24 }); + // => 2020-03-07T23:00:00-08:00[America/Los_Angeles] + // Subtracting time units doesn't adjust for DST. Result is 11:00PM: 24 real-world + // hours earlier because a clock hour was skipped by DST. + earlierHours.since(zdt, { largestUnit: "hour" }).hours; // => -24 +} +{ + const zdt1 = Temporal.ZonedDateTime.from("1995-12-07T03:24:30.000003500+05:30[Asia/Kolkata]"); + const zdt2 = Temporal.ZonedDateTime.from("2019-01-31T15:30+05:30[Asia/Kolkata]"); + zdt1.until(zdt2); + // => PT202956H5M29.9999965S + zdt1.until(zdt2, { largestUnit: "year" }); + // => P23Y1M24DT12H5M29.9999965S + zdt2.until(zdt1, { largestUnit: "year" }); + // => -P23Y1M24DT12H5M29.9999965S + zdt1.until(zdt2, { largestUnit: "nanosecond" }); + // => PT730641929.999996544S + // (precision lost) + // Rounding, for example if you don't care about sub-seconds + zdt1.until(zdt2, { smallestUnit: "second" }); + // => PT202956H5M29S + // Months and years can be different lengths + const [jan1, feb1, mar1] = [1, 2, 3].map(month => Temporal.ZonedDateTime.from({ year: 2020, month, day: 1, timeZone: "Asia/Seoul" })); + jan1.until(feb1, { largestUnit: "day" }); // => P31D + jan1.until(feb1, { largestUnit: "month" }); // => P1M + feb1.until(mar1, { largestUnit: "day" }); // => P29D + feb1.until(mar1, { largestUnit: "month" }); // => P1M + jan1.until(mar1, { largestUnit: "day" }); // => P60D +} +{ + const zdt1 = Temporal.ZonedDateTime.from("1995-12-07T03:24:30.000003500+05:30[Asia/Kolkata]"); + const zdt2 = Temporal.ZonedDateTime.from("2019-01-31T15:30+05:30[Asia/Kolkata]"); + zdt2.since(zdt1); // => PT202956H5M29.9999965S +} +{ + const zdt = Temporal.ZonedDateTime.from("1995-12-07T03:24:30.000003500-08:00[America/Los_Angeles]"); + // Round to a particular unit + zdt.round({ smallestUnit: "hour" }); + // => 1995-12-07T03:00:00-08:00[America/Los_Angeles] + // Round to an increment of a unit, e.g. half an hour: + zdt.round({ roundingIncrement: 30, smallestUnit: "minute" }); + // => 1995-12-07T03:30:00-08:00[America/Los_Angeles] + // Round to the same increment but round down instead: + zdt.round({ roundingIncrement: 30, smallestUnit: "minute", roundingMode: "floor" }); + // => 1995-12-07T03:00:00-08:00[America/Los_Angeles] +} +{ + const zdt = Temporal.ZonedDateTime.from("2015-10-18T12:00-02:00[America/Sao_Paulo]"); + zdt.startOfDay(); // => 2015-10-18T01:00:00-02:00[America/Sao_Paulo] +} +{ + let duration; + // How long until the next offset change from now, in the current location? + const tz = Temporal.Now.timeZoneId(); + const now = Temporal.Now.zonedDateTimeISO(tz); + const nextTransition = now.getTimeZoneTransition("next"); + duration = nextTransition.since(now); + duration.toLocaleString(); // output will vary + // How long until the previous offset change from now, in the current location? + const previousTransition = now.getTimeZoneTransition("previous"); + duration = now.since(previousTransition); + duration.toLocaleString(); // output will vary +} +{ + const zdt1 = Temporal.ZonedDateTime.from("1995-12-07T03:24:30.000003500+01:00[Europe/Paris]"); + const zdt2 = Temporal.ZonedDateTime.from("1995-12-07T03:24:30.000003500+01:00[Europe/Brussels]"); + zdt1.equals(zdt2); // => false (same offset but different time zones) + zdt1.equals(zdt1); // => true + // To compare time zone IDs, use withTimeZone() with each ID on the same + // ZonedDateTime instance, and use equals() to compare + const kolkata = zdt1.withTimeZone("Asia/Kolkata"); + kolkata.equals(zdt1.withTimeZone("Asia/Calcutta")); // => true + // Offset time zones are never equivalent to named time zones + kolkata.equals(zdt1.withTimeZone("+05:30")); // => false + const zeroOffset = zdt1.withTimeZone("+00:00"); + zeroOffset.equals(zdt1.withTimeZone("UTC")); // => false + // For offset time zones, any valid format is accepted + zeroOffset.equals(zdt1.withTimeZone("+00:00")); // => true + zeroOffset.equals(zdt1.withTimeZone("+0000")); // => true + zeroOffset.equals(zdt1.withTimeZone("+00")); // => true +} +{ + let zdt; + zdt = Temporal.ZonedDateTime.from({ year: 2019, month: 12, day: 1, hour: 12, timeZone: "Africa/Lagos" }); + zdt.toString(); // => '2019-12-01T12:00:00+01:00[Africa/Lagos]' + zdt = zdt.withCalendar("japanese"); + zdt.toString(); // => '2019-12-01T12:00:00+01:00[Africa/Lagos][u-ca=japanese]' +} +{ + const zdt = Temporal.ZonedDateTime.from("2019-12-01T12:00+01:00[Europe/Berlin]"); + zdt.toLocaleString(); // example output: 12/1/2019, 12:00:00 PM + zdt.toLocaleString("de-DE"); // => '1.12.2019, 12:00:00 MEZ' + const options = { weekday: "long", year: "numeric", month: "long", day: "numeric" }; + zdt.toLocaleString("de-DE", options); // => 'Sonntag, 1. Dezember 2019' + /* WRONG */ zdt.toLocaleString("de-DE", { timeZone: "Pacific/Auckland" }); + // => RangeError: Time zone option Pacific/Auckland does not match actual time zone Europe/Berlin + zdt.withTimeZone("Pacific/Auckland").toLocaleString("de-DE"); // => '2.12.2019, 0:00:00 GMT+13' + zdt.toLocaleString("en-US-u-nu-fullwide-hc-h12"); // => '12/1/2019, 12:00:00 PM GMT+1' +} +{ + const zdt = Temporal.ZonedDateTime.from("1995-12-07T03:24:30+02:00[Africa/Johannesburg]"); + zdt.toInstant(); // => 1995-12-07T01:24:30Z + zdt.toPlainDateTime(); // => 1995-12-07T03:24:30 + zdt.toPlainDate(); // => 1995-12-07 + zdt.toPlainTime(); // => 03:24:30 + zdt.toPlainDate().toPlainYearMonth(); // => 1995-12 + zdt.toPlainDate().toPlainMonthDay(); // => 12-07 +} +{ + // Pi day in 2020 + const date = new Temporal.PlainDate(2020, 3, 14); // => 2020-03-14 +} +{ + let date; + date = Temporal.PlainDate.from("2006-08-24"); // => 2006-08-24 + date = Temporal.PlainDate.from("20060824"); // => 2006-08-24 + date = Temporal.PlainDate.from("2006-08-24T15:43:27"); // => 2006-08-24 + date = Temporal.PlainDate.from("2006-08-24T15:43:27+01:00[Europe/Brussels]"); + // => 2006-08-24 + date === Temporal.PlainDate.from(date); // => false + date = Temporal.PlainDate.from({ year: 2006, month: 8, day: 24 }); // => 2006-08-24 + date = Temporal.PlainDate.from(Temporal.PlainDateTime.from("2006-08-24T15:43:27")); + // => 2006-08-24 + // same as above; Temporal.PlainDateTime has year, month, and day properties + date = Temporal.PlainDate.from({ year: 1427, month: 8, day: 1, calendar: "islamic" }); + // => 2006-08-24[u-ca=islamic] + // Different overflow modes + date = Temporal.PlainDate.from({ year: 2001, month: 13, day: 1 }, { overflow: "constrain" }); + // => 2001-12-01 + date = Temporal.PlainDate.from({ year: 2001, month: 1, day: 32 }, { overflow: "constrain" }); + // => 2001-01-31 + date = Temporal.PlainDate.from({ year: 2001, month: 13, day: 1 }, { overflow: "reject" }); + // => throws + date = Temporal.PlainDate.from({ year: 2001, month: 1, day: 32 }, { overflow: "reject" }); + // => throws +} +{ + const one = Temporal.PlainDate.from("2006-08-24"); + const two = Temporal.PlainDate.from("2015-07-14"); + const three = Temporal.PlainDate.from("1930-02-18"); + const sorted = [one, two, three].sort(Temporal.PlainDate.compare); + sorted.join(" "); // => '1930-02-18 2006-08-24 2015-07-14' +} +{ + let date; + date = Temporal.PlainDate.from("2006-08-24"); + date.year; // => 2006 + date.month; // => 8 + date.monthCode; // => 'M08' + date.day; // => 24 + date = Temporal.PlainDate.from("2019-02-23[u-ca=hebrew]"); + date.year; // => 5779 + date.month; // => 6 + date.monthCode; // => 'M05L' + date.day; // => 18 +} +{ + const date = Temporal.PlainDate.from("-000015-01-01[u-ca=gregory]"); + date.era; + // => 'bce' + date.eraYear; + // => 16 + date.year; + // => -15 +} +{ + const date = Temporal.PlainDate.from("2006-08-24"); + ["MON", "TUE", "WED", "THU", "FRI", "SAT", "SUN"][date.dayOfWeek - 1]; // => 'THU' +} +{ + const date = Temporal.PlainDate.from("2006-08-24"); + // ISO ordinal date + console.log(date.year, date.dayOfYear); // => '2006 236' +} +{ + const date = Temporal.PlainDate.from("2022-01-01"); + // ISO week date + console.log(date.yearOfWeek, date.weekOfYear, date.dayOfWeek); // => '2021 52 6' +} +{ + const date = Temporal.PlainDate.from("2006-08-24"); + date.daysInWeek; // => 7 +} +{ + // Attempt to write some mnemonic poetry + const monthsByDays = {}; + for (let month = 1; month <= 12; month++) { + const date = Temporal.Now.plainDateISO().with({ month }); + monthsByDays[date.daysInMonth] = (monthsByDays[date.daysInMonth] || []).concat(date); + } + const strings = monthsByDays[30].map(date => date.toLocaleString("en", { month: "long" })); + // Shuffle to improve poem as determined empirically + strings.unshift(strings.pop()); + const format = new Intl.ListFormat("en"); + const poem = `Thirty days hath ${format.format(strings)}`; + console.log(poem); +} +{ + const date = Temporal.Now.plainDateISO(); + const percent = date.dayOfYear / date.daysInYear; + `The year is ${percent.toLocaleString("en", { style: "percent" })} over!`; + // example output: "The year is 10% over!" +} +{ + const date = Temporal.PlainDate.from("1900-01-01"); + date.monthsInYear; // => 12 +} +{ + // Is this year a leap year? + const date = Temporal.Now.plainDateISO(); + date.inLeapYear; // example output: true + // Is 2100 a leap year? (no, because it's divisible by 100 and not 400) + date.with({ year: 2100 }).inLeapYear; // => false +} +{ + const date = Temporal.PlainDate.from("2006-01-24"); + // What's the first day of this month? + date.with({ day: 1 }); // => 2006-01-01 + // What's the last day of the next month? + const nextMonthDate = date.add({ months: 1 }); + nextMonthDate.with({ day: nextMonthDate.daysInMonth }); // => 2006-02-28 +} +{ + const date = Temporal.PlainDate.from("2006-08-24[u-ca=japanese]"); + date.withCalendar("iso8601"); // => 2006-08-24 +} +{ + let date; + date = Temporal.PlainDate.from("2006-08-24"); + date.add({ years: 20, months: 4 }); // => 2026-12-24 + date = Temporal.PlainDate.from("2019-01-31"); + date.add({ months: 1 }); // => 2019-02-28 + date.add({ months: 1 }, { overflow: "reject" }); // => throws +} +{ + let date; + date = Temporal.PlainDate.from("2006-08-24"); + date.subtract({ years: 20, months: 4 }); // => 1986-04-24 + date = Temporal.PlainDate.from("2019-03-31"); + date.subtract({ months: 1 }); // => 2019-02-28 + date.subtract({ months: 1 }, { overflow: "reject" }); // => throws +} +{ + const earlier = Temporal.PlainDate.from("2006-08-24"); + const later = Temporal.PlainDate.from("2019-01-31"); + earlier.until(later); // => P4543D + earlier.until(later, { largestUnit: "year" }); // => P12Y5M7D + later.until(earlier, { largestUnit: "year" }); // => -P12Y5M7D + // If you really need to calculate the difference between two Dates in + // hours, you can eliminate the ambiguity by explicitly choosing the + // point in time from which you want to reckon the difference. For + // example, using noon: + const noon = Temporal.PlainTime.from("12:00"); + earlier.toPlainDateTime(noon).until(later.toPlainDateTime(noon), { largestUnit: "hour" }); + // => PT109032H + const newyear = Temporal.PlainDate.from("2020-01-01"); + newyear.until("2020-01-15", { smallestUnit: "month", roundingMode: "halfExpand" }); + // => PT0S + newyear.until("2020-01-16", { smallestUnit: "month", roundingMode: "halfExpand" }); + // => PT0S (mid-month dates rounded down to match `Temporal.PlainDateTime` behavior) + newyear.until("2020-01-17", { smallestUnit: "month", roundingMode: "halfExpand" }); + // => PT1M +} +{ + const earlier = Temporal.PlainDate.from("2006-08-24"); + const later = Temporal.PlainDate.from("2019-01-31"); + later.since(earlier); // => P4543D +} +{ + const date = Temporal.PlainDate.from("2006-08-24"); + const other = Temporal.PlainDate.from("2019-01-31"); + date.equals(other); // => false + date.equals(date); // => true +} +{ + const date = Temporal.PlainDate.from("2006-08-24"); + date.toString(); // => '2006-08-24' +} +{ + const date = Temporal.PlainDate.from("2006-08-24"); + date.toLocaleString(); // example output: 8/24/2006 + date.toLocaleString("de-DE"); // example output: '24.8.2006' + date.toLocaleString("de-DE", { weekday: "long" }); // => 'Donnerstag' + date.toLocaleString("en-US-u-nu-fullwide"); // => '8/24/2006' +} +{ + const plainDate = Temporal.PlainDate.from("2006-08-24"); + const plainTime = Temporal.PlainTime.from("15:23:30.003"); + plainDate.toZonedDateTime({ timeZone: "America/Los_Angeles", plainTime }); + // => 2006-08-24T15:23:30.003-07:00[America/Los_Angeles] + plainDate.toZonedDateTime({ timeZone: "America/Los_Angeles" }); + // => 2006-08-24T00:00:00-07:00[America/Los_Angeles] +} +{ + const date = Temporal.PlainDate.from("2006-08-24"); + const time = Temporal.PlainTime.from("15:23:30.003"); + date.toPlainDateTime(time); // => 2006-08-24T15:23:30.003 + date.toPlainDateTime(); // => 2006-08-24T00:00:00 +} +{ + const date = Temporal.PlainDate.from("2006-08-24"); + date.toPlainYearMonth(); // => 2006-08 + date.toPlainMonthDay(); // => 08-24 +} +{ + // Leet hour + const time = new Temporal.PlainTime(13, 37); // => 13:37:00 +} +{ + let time; + time = Temporal.PlainTime.from("03:24:30"); // => 03:24:30 + time = Temporal.PlainTime.from("032430"); // => 03:24:30 + time = Temporal.PlainTime.from("1995-12-07T03:24:30"); // => 03:24:30 + time = Temporal.PlainTime.from("1995-12-07T03:24:30+01:00[Europe/Brussels]"); + // => 03:24:30 + // (same as above; time zone is ignored) + time === Temporal.PlainTime.from(time); // => false + time = Temporal.PlainTime.from({ + hour: 19, + minute: 39, + second: 9, + millisecond: 68, + microsecond: 346, + nanosecond: 205, + }); // => 19:39:09.068346205 + time = Temporal.PlainTime.from({ hour: 19, minute: 39, second: 9 }); // => 19:39:09 + time = Temporal.PlainTime.from(Temporal.PlainDateTime.from("2020-02-15T19:39:09")); + // => 19:39:09 + // (same as above; Temporal.PlainDateTime has hour, minute, etc. properties) + // Different overflow modes + time = Temporal.PlainTime.from({ hour: 15, minute: 60 }, { overflow: "constrain" }); + // => 15:59:00 + time = Temporal.PlainTime.from({ hour: 15, minute: -1 }, { overflow: "constrain" }); + // => 15:00:00 + time = Temporal.PlainTime.from({ hour: 15, minute: 60 }, { overflow: "reject" }); + // => throws + time = Temporal.PlainTime.from({ hour: 15, minute: -1 }, { overflow: "reject" }); + // => throws +} +{ + const one = Temporal.PlainTime.from("03:24"); + const two = Temporal.PlainTime.from("01:24"); + const three = Temporal.PlainTime.from("01:24:05"); + const sorted = [one, two, three].sort(Temporal.PlainTime.compare); + sorted.join(" "); // => '01:24:00 01:24:05 03:24:00' +} +{ + // Backward transitions will repeat clock times + const zdtDst = Temporal.ZonedDateTime.from("2020-11-01T01:45-07:00[America/Los_Angeles]"); + const zdtStandard = Temporal.ZonedDateTime.from("2020-11-01T01:30-08:00[America/Los_Angeles]"); + // The "first" 1:45 (in Daylight Time) is earlier than the "second" 1:30 (in Standard Time) + Temporal.ZonedDateTime.compare(zdtDst, zdtStandard); // => -1 + // 1:45 is later than 1:30 when looking at a wall clock + Temporal.PlainTime.compare(zdtDst, zdtStandard); // => 1 + // Forward transitions will skip clock times. Skipped times will be disambiguated. + const zdtBase = Temporal.ZonedDateTime.from("2020-03-08[America/Los_Angeles]"); + const timeSkipped = Temporal.PlainTime.from("02:30"); + const timeValid = Temporal.PlainTime.from("03:30"); + const zdtSkipped = zdtBase.withPlainTime(timeSkipped); + const zdtValid = zdtBase.withPlainTime(timeValid); + // The skipped time 2:30AM is disambiguated to 3:30AM, so the instants are equal + Temporal.ZonedDateTime.compare(zdtSkipped, zdtValid); // => 0 + // 2:30 is earlier than 3:30 on a wall clock + Temporal.PlainTime.compare(timeSkipped, timeValid); // => -1 +} +{ + const time = Temporal.PlainTime.from("19:39:09.068346205"); + time.hour; // => 19 + time.minute; // => 39 + time.second; // => 9 + time.millisecond; // => 68 + time.microsecond; // => 346 + time.nanosecond; // => 205 +} +{ + const time = Temporal.PlainTime.from("19:39:09.068346205"); + // What's the top of the next hour? + time.add({ hours: 1 }).with({ + minute: 0, + second: 0, + millisecond: 0, + microsecond: 0, + nanosecond: 0, + }); // => 20:00:00 +} +{ + const time = Temporal.PlainTime.from("19:39:09.068346205"); + time.add({ minutes: 5, nanoseconds: 800 }); // => 19:44:09.068347005 +} +{ + const time = Temporal.PlainTime.from("19:39:09.068346205"); + time.subtract({ minutes: 5, nanoseconds: 800 }); // => 19:34:09.068345405 +} +{ + const time = Temporal.PlainTime.from("20:13:20.971398099"); + time.until(Temporal.PlainTime.from("22:39:09.068346205")); // => PT2H25M48.096948106S + time.until(Temporal.PlainTime.from("19:39:09.068346205")); // => -PT34M11.903051894S + // Rounding, for example if you don't care about sub-seconds + time.until(Temporal.PlainTime.from("22:39:09.068346205"), { smallestUnit: "second" }); + // => PT2H25M48S +} +{ + const time = Temporal.PlainTime.from("20:13:20.971398099"); + time.since(Temporal.PlainTime.from("19:39:09.068346205")); // => PT34M11.903051894S + time.since(Temporal.PlainTime.from("22:39:09.068346205")); // => -PT2H25M48.096948106S +} +{ + const time = Temporal.PlainTime.from("19:39:09.068346205"); + // Round to a particular unit + time.round({ smallestUnit: "hour" }); // => 20:00:00 + // Round to an increment of a unit, e.g. half an hour: + time.round({ roundingIncrement: 30, smallestUnit: "minute" }); + // => 19:30:00 + // Round to the same increment but round up instead: + time.round({ roundingIncrement: 30, smallestUnit: "minute", roundingMode: "ceil" }); + // => 20:00:00 +} +{ + const time = Temporal.PlainTime.from("19:39:09.068346205"); + const other = Temporal.PlainTime.from("20:13:20.971398099"); + time.equals(other); // => false + time.equals(time); // => true +} +{ + const time = Temporal.PlainTime.from("19:39:09.068346205"); + time.toString(); // => '19:39:09.068346205' + time.toString({ smallestUnit: "minute" }); // => '19:39' + time.toString({ fractionalSecondDigits: 0 }); // => '19:39:09' + time.toString({ fractionalSecondDigits: 4 }); // => '19:39:09.0683' + time.toString({ fractionalSecondDigits: 5, roundingMode: "halfExpand" }); + // => '19:39:09.06835' +} +{ + const time = Temporal.PlainTime.from("19:39:09.068346205"); + time.toLocaleString(); // example output: '7:39:09 PM' + time.toLocaleString("de-DE"); // example output: '19:39:09' + time.toLocaleString("de-DE", { timeZone: "Europe/Berlin" }); // => '19:39:09' + time.toLocaleString("en-US-u-nu-fullwide-hc-h24"); // => '19:39:09' +} +{ + // Leet hour on pi day in 2020 + const datetime = new Temporal.PlainDateTime(2020, 3, 14, 13, 37); // => 2020-03-14T13:37:00 +} +{ + let dt; + dt = Temporal.PlainDateTime.from("1995-12-07T03:24:30"); + dt = Temporal.PlainDateTime.from("19951207T032430"); + dt = Temporal.PlainDateTime.from("1995-12-07T03:24:30+01:00[Europe/Brussels]"); + // => 1995-12-07T03:24:30 + // same as above; time zone is ignored + dt === Temporal.PlainDateTime.from(dt); // => false + dt = Temporal.PlainDateTime.from({ + year: 1995, + month: 12, + day: 7, + hour: 3, + minute: 24, + second: 30, + millisecond: 0, + microsecond: 3, + nanosecond: 500, + }); // => 1995-12-07T03:24:30.0000035 + dt = Temporal.PlainDateTime.from({ year: 1995, month: 12, day: 7 }); // => 1995-12-07T00:00:00 + dt = Temporal.PlainDateTime.from(Temporal.PlainDate.from("1995-12-07T03:24:30")); + // => 1995-12-07T00:00:00 + // same as above; Temporal.PlainDate has year, month, and day properties + dt = Temporal.PlainDateTime.from({ year: 5756, month: 3, day: 14, hour: 3, minute: 24, second: 30, calendar: "hebrew" }); + // => 1995-12-07T03:24:30[u-ca=hebrew] + // Different overflow modes + dt = Temporal.PlainDateTime.from({ year: 2001, month: 13, day: 1 }, { overflow: "constrain" }); + // => 2001-12-01T00:00:00 + dt = Temporal.PlainDateTime.from({ year: 2001, month: 1, day: 32 }, { overflow: "constrain" }); + // => 2001-01-31T00:00:00 + dt = Temporal.PlainDateTime.from({ year: 2001, month: 1, day: 1, hour: 25 }, { overflow: "constrain" }); + // => 2001-01-01T23:00:00 + dt = Temporal.PlainDateTime.from({ year: 2001, month: 1, day: 1, minute: 60 }, { overflow: "constrain" }); + // => 2001-01-01T00:59:00 + dt = Temporal.PlainDateTime.from({ year: 2001, month: 13, day: 1 }, { overflow: "reject" }); + // => throws + dt = Temporal.PlainDateTime.from({ year: 2001, month: 1, day: 32 }, { overflow: "reject" }); + // => throws + dt = Temporal.PlainDateTime.from({ year: 2001, month: 1, day: 1, hour: 25 }, { overflow: "reject" }); + // => throws + dt = Temporal.PlainDateTime.from({ year: 2001, month: 1, day: 1, minute: 60 }, { overflow: "reject" }); + // => throws +} +{ + const one = Temporal.PlainDateTime.from("1995-12-07T03:24"); + const two = Temporal.PlainDateTime.from("1995-12-07T01:24"); + const three = Temporal.PlainDateTime.from("2015-12-07T01:24"); + const sorted = [one, two, three].sort(Temporal.PlainDateTime.compare); + sorted.join(" "); + // => '1995-12-07T01:24:00 1995-12-07T03:24:00 2015-12-07T01:24:00' +} +{ + let dt; + dt = Temporal.PlainDateTime.from("1995-12-07T03:24:30.000003500"); + dt.year; // => 1995 + dt.month; // => 12 + dt.monthCode; // => 'M12' + dt.day; // => 7 + dt.hour; // => 3 + dt.minute; // => 24 + dt.second; // => 30 + dt.millisecond; // => 0 + dt.microsecond; // => 3 + dt.nanosecond; // => 500 + dt = Temporal.PlainDateTime.from("2019-02-23T03:24:30.000003500[u-ca=hebrew]"); + dt.year; // => 5779 + dt.month; // => 6 + dt.monthCode; // => 'M05L' + dt.day; // => 18 + dt.hour; // => 3 + dt.minute; // => 24 + dt.second; // => 30 + dt.millisecond; // => 0 + dt.microsecond; // => 3 + dt.nanosecond; // => 500 +} +{ + const date = Temporal.PlainDateTime.from("-000015-01-01T12:30[u-ca=gregory]"); + date.era; + // => 'bce' + date.eraYear; + // => 16 + date.year; + // => -15 +} +{ + const dt = Temporal.PlainDateTime.from("1995-12-07T03:24:30.000003500"); + ["MON", "TUE", "WED", "THU", "FRI", "SAT", "SUN"][dt.dayOfWeek - 1]; // => 'THU' +} +{ + const dt = Temporal.PlainDateTime.from("1995-12-07T03:24:30.000003500"); + // ISO ordinal date + console.log(dt.year, dt.dayOfYear); // => '1995 341' +} +{ + const dt = Temporal.PlainDateTime.from("2022-01-01T03:24:30.000003500"); + // ISO week date + console.log(dt.yearOfWeek, dt.weekOfYear, dt.dayOfWeek); // => '2021 52 6' +} +{ + const dt = Temporal.PlainDateTime.from("1995-12-07T03:24:30.000003500"); + dt.daysInWeek; // => 7 +} +{ + // Attempt to write some mnemonic poetry + const monthsByDays = {}; + for (let month = 1; month <= 12; month++) { + const dt = Temporal.Now.plainDateTimeISO().with({ month }); + monthsByDays[dt.daysInMonth] = (monthsByDays[dt.daysInMonth] || []).concat(dt); + } + const strings = monthsByDays[30].map(dt => dt.toLocaleString("en", { month: "long" })); + // Shuffle to improve poem as determined empirically + strings.unshift(strings.pop()); + const format = new Intl.ListFormat("en"); + const poem = `Thirty days hath ${format.format(strings)}`; + console.log(poem); +} +{ + const dt = Temporal.Now.plainDateTimeISO(); + const percent = dt.dayOfYear / dt.daysInYear; + `The year is ${percent.toLocaleString("en", { style: "percent" })} over!`; + // example output: "The year is 10% over!" +} +{ + const dt = Temporal.PlainDate.from("1900-01-01T12:00"); + dt.monthsInYear; // => 12 +} +{ + // Is this year a leap year? + const dt = Temporal.Now.plainDateTimeISO(); + dt.inLeapYear; // example output: true + // Is 2100 a leap year? (no, because it's divisible by 100 and not 400) + dt.with({ year: 2100 }).inLeapYear; // => false +} +{ + const dt = Temporal.PlainDateTime.from("1995-12-07T03:24:30.000003500"); + dt.with({ year: 2015, second: 31 }); // => 2015-12-07T03:24:31.0000035 +} +{ + const dt = Temporal.PlainDateTime.from("2015-12-07T03:24:30.000003500"); + dt.withPlainTime({ hour: 10 }); // => 2015-12-07T10:00:00 + const time = Temporal.PlainTime.from("11:22"); + dt.withPlainTime(time); // => 2015-12-07T11:22:00 + dt.withPlainTime("12:34"); // => 2015-12-07T12:34:00 + // easier for chaining + dt.add({ days: 2, hours: 22 }).withPlainTime("00:00"); // => 2015-12-10T00:00:00 +} +{ + const dt = Temporal.PlainDateTime.from("1995-12-07T03:24:30.000003500[u-ca=japanese]"); + dt.withCalendar("iso8601"); // => 1995-12-07T03:24:30.0000035 +} +{ + let dt; + dt = Temporal.PlainDateTime.from("1995-12-07T03:24:30.000003500"); + dt.add({ years: 20, months: 4, nanoseconds: 500 }); // => 2016-04-07T03:24:30.000004 + dt = Temporal.PlainDateTime.from("2019-01-31T15:30"); + dt.add({ months: 1 }); // => 2019-02-28T15:30:00 + dt.add({ months: 1 }, { overflow: "reject" }); // => throws +} +{ + let dt; + dt = Temporal.PlainDateTime.from("1995-12-07T03:24:30.000003500"); + dt.subtract({ years: 20, months: 4, nanoseconds: 500 }); // => 1975-08-07T03:24:30.000003 + dt = Temporal.PlainDateTime.from("2019-03-31T15:30"); + dt.subtract({ months: 1 }); // => 2019-02-28T15:30:00 + dt.subtract({ months: 1 }, { overflow: "reject" }); // => throws +} +{ + const dt1 = Temporal.PlainDateTime.from("1995-12-07T03:24:30.000003500"); + const dt2 = Temporal.PlainDateTime.from("2019-01-31T15:30"); + dt1.until(dt2); + // => P8456DT12H5M29.9999965S + dt1.until(dt2, { largestUnit: "year" }); + // => P23Y1M24DT12H5M29.9999965S + dt2.until(dt1, { largestUnit: "year" }); + // => -P23Y1M24DT12H5M29.9999965S + dt1.until(dt2, { largestUnit: "nanosecond" }); + // => PT730641929.999996544S + // (precision lost) + // Rounding, for example if you don't care about sub-seconds + dt1.until(dt2, { smallestUnit: "second" }); + // => P8456DT12H5M29S + // Months and years can be different lengths + const [jan1, feb1, mar1] = [1, 2, 3].map(month => Temporal.PlainDateTime.from({ year: 2020, month, day: 1 })); + jan1.until(feb1); // => P31D + jan1.until(feb1, { largestUnit: "month" }); // => P1M + feb1.until(mar1); // => P29D + feb1.until(mar1, { largestUnit: "month" }); // => P1M + jan1.until(mar1); // => P60D +} +{ + const dt1 = Temporal.PlainDateTime.from("1995-12-07T03:24:30.000003500"); + const dt2 = Temporal.PlainDateTime.from("2019-01-31T15:30"); + dt2.since(dt1); // => P8456DT12H5M29.9999965S +} +{ + const dt = Temporal.PlainDateTime.from("1995-12-07T03:24:30.000003500"); + // Round to a particular unit + dt.round({ smallestUnit: "hour" }); // => 1995-12-07T03:00:00 + // Round to an increment of a unit, e.g. half an hour: + dt.round({ roundingIncrement: 30, smallestUnit: "minute" }); + // => 1995-12-07T03:30:00 + // Round to the same increment but round down instead: + dt.round({ roundingIncrement: 30, smallestUnit: "minute", roundingMode: "floor" }); + // => 1995-12-07T03:00:00 +} +{ + const dt1 = Temporal.PlainDateTime.from("1995-12-07T03:24:30.000003500"); + const dt2 = Temporal.PlainDateTime.from("2019-01-31T15:30"); + dt1.equals(dt2); // => false + dt1.equals(dt1); // => true +} +{ + const dt = Temporal.PlainDateTime.from({ + year: 1999, + month: 12, + day: 31, + hour: 23, + minute: 59, + second: 59, + millisecond: 999, + microsecond: 999, + nanosecond: 999, + }); + dt.toString(); // => '1999-12-31T23:59:59.999999999' + dt.toString({ smallestUnit: "minute" }); // => '1999-12-31T23:59' + dt.toString({ fractionalSecondDigits: 0 }); // => '1999-12-31T23:59:59' + dt.toString({ fractionalSecondDigits: 4 }); // => '1999-12-31T23:59:59.9999' + dt.toString({ fractionalSecondDigits: 8, roundingMode: "halfExpand" }); + // => '2000-01-01T00:00:00.00000000' +} +{ + const dt = Temporal.PlainDateTime.from("1995-12-07T03:24:30.000003500"); + dt.toLocaleString(); // example output: 1995-12-07, 3:24:30 a.m. + dt.toLocaleString("de-DE"); // example output: 7.12.1995, 03:24:30 + dt.toLocaleString("de-DE", { timeZone: "Europe/Berlin", weekday: "long" }); // => 'Donnerstag' + dt.toLocaleString("en-US-u-nu-fullwide-hc-h12"); // => '12/7/1995, 3:24:30 AM' +} +{ + const dt = Temporal.PlainDateTime.from("1995-12-07T03:24:30.000003500"); + dt.toPlainDate(); // => 1995-12-07 + dt.toPlainTime(); // => 03:24:30.0000035 + dt.toPlainDate().toPlainYearMonth(); // => 1995-12 + dt.toPlainDate().toPlainMonthDay(); // => 12-07 +} +{ + // The June 2019 meeting + const ym = new Temporal.PlainYearMonth(2019, 6); + // => 2019-06 +} +{ + let ym; + ym = Temporal.PlainYearMonth.from("2019-06"); // => 2019-06 + ym = Temporal.PlainYearMonth.from("2019-06-24"); // => 2019-06 + ym = Temporal.PlainYearMonth.from("2019-06-24T15:43:27"); // => 2019-06 + ym = Temporal.PlainYearMonth.from("2019-06-24T15:43:27+01:00[Europe/Brussels]"); + // => 2019-06 + ym === Temporal.PlainYearMonth.from(ym); // => false + ym = Temporal.PlainYearMonth.from({ year: 2019, month: 6 }); // => 2019-06 + ym = Temporal.PlainYearMonth.from(Temporal.PlainDate.from("2019-06-24")); + // => 2019-06 + // (same as above; Temporal.PlainDate has year and month properties) + // Different overflow modes + ym = Temporal.PlainYearMonth.from({ year: 2001, month: 13 }, { overflow: "constrain" }); + // => 2001-12 + ym = Temporal.PlainYearMonth.from({ year: 2001, month: 13 }, { overflow: "reject" }); + // => throws +} +{ + const one = Temporal.PlainYearMonth.from("2006-08"); + const two = Temporal.PlainYearMonth.from("2015-07"); + const three = Temporal.PlainYearMonth.from("1930-02"); + const sorted = [one, two, three].sort(Temporal.PlainYearMonth.compare); + sorted.join(" "); // => '1930-02 2006-08 2015-07' +} +{ + let ym; + ym = Temporal.PlainYearMonth.from("2019-06"); + ym.year; // => 2019 + ym.month; // => 6 + ym.monthCode; // => 'M06' + ym = Temporal.PlainYearMonth.from("2019-02-23[u-ca=hebrew]"); + ym.year; // => 5779 + ym.month; // => 6 + ym.monthCode; // => 'M05L' +} +{ + const ym = Temporal.PlainYearMonth.from("-000015-01-01[u-ca=gregory]"); + ym.era; + // => 'bce' + ym.eraYear; + // => 16 + ym.year; + // => -15 +} +{ + // Attempt to write some mnemonic poetry + const monthsByDays = {}; + for (let month = 1; month <= 12; month++) { + const ym = Temporal.PlainYearMonth.from({ year: 2020, calendar: "iso8601", month }); + monthsByDays[ym.daysInMonth] = (monthsByDays[ym.daysInMonth] || []).concat(ym); + } + const strings = monthsByDays[30].map(ym => ym.toLocaleString("en", { month: "long", calendar: "iso8601" })); + // Shuffle to improve poem as determined empirically + strings.unshift(strings.pop()); + const format = new Intl.ListFormat("en"); + const poem = `Thirty days hath ${format.format(strings)}`; + console.log(poem); +} +{ + const ym = Temporal.PlainYearMonth.from({ year: 2019, month: 6, calendar: "iso8601" }); + const percent = ym.daysInMonth / ym.daysInYear; + `${ym.toLocaleString("en", { month: "long", year: "numeric", calendar: "iso8601" })} was ${percent.toLocaleString("en", { style: "percent" })} of the year!`; + // => 'June 2019 was 8% of the year!' +} +{ + const ym = Temporal.PlainYearMonth.from("1900-01"); + ym.monthsInYear; // => 12 +} +{ + // Was June 2019 in a leap year? + const ym = Temporal.PlainYearMonth.from("2019-06"); + ym.inLeapYear; // => false + // Is 2100 a leap year? (no, because it's divisible by 100 and not 400) + ym.with({ year: 2100 }).inLeapYear; // => false +} +{ + const ym = Temporal.PlainYearMonth.from("2019-06"); + // Get December of that year + ym.with({ month: 12 }); // => 2019-12 +} +{ + const ym = Temporal.PlainYearMonth.from("2019-06"); + ym.add({ years: 20, months: 4 }); // => 2039-10 +} +{ + const ym = Temporal.PlainYearMonth.from("2019-06"); + ym.subtract({ years: 20, months: 4 }); // => 1999-02 +} +{ + const ym = Temporal.PlainYearMonth.from("2006-08"); + const other = Temporal.PlainYearMonth.from("2019-06"); + ym.until(other); // => P12Y10M + ym.until(other, { largestUnit: "month" }); // => P154M + other.until(ym, { largestUnit: "month" }); // => -P154M + // If you really need to calculate the difference between two YearMonths + // in days, you can eliminate the ambiguity by explicitly choosing the + // day of the month (and if applicable, the time of that day) from which + // you want to reckon the difference. For example, using the first of + // the month to calculate a number of days: + ym.toPlainDate({ day: 1 }).until(other.toPlainDate({ day: 1 }), { largestUnit: "day" }); // => P4687D +} +{ + const ym = Temporal.PlainYearMonth.from("2019-06"); + const other = Temporal.PlainYearMonth.from("2006-08"); + ym.since(other); // => P12Y10M +} +{ + const ym = Temporal.PlainYearMonth.from("2019-06"); + const other = Temporal.PlainYearMonth.from("2006-08"); + ym.equals(other); // => false + ym.equals(ym); // => true +} +{ + const ym = Temporal.PlainYearMonth.from("2019-06"); + ym.toString(); // => '2019-06' +} +{ + const { calendar } = new Intl.DateTimeFormat().resolvedOptions(); + const ym = Temporal.PlainYearMonth.from({ year: 2019, month: 6, calendar }); + ym.toLocaleString(); // example output: '6/2019' + // Same as above, but explicitly specifying the calendar: + ym.toLocaleString(undefined, { calendar }); + ym.toLocaleString("de-DE", { calendar }); // example output: '6.2019' + ym.toLocaleString("de-DE", { month: "long", year: "numeric", calendar }); // => 'Juni 2019' + ym.toLocaleString(`en-US-u-nu-fullwide-ca-${calendar}`); // => '6/2019' +} +{ + const ym = Temporal.PlainYearMonth.from("2019-06"); + ym.toPlainDate({ day: 24 }); // => 2019-06-24 +} +{ + let md; + // Pi day + md = new Temporal.PlainMonthDay(3, 14); // => 03-14 + // Leap day + md = new Temporal.PlainMonthDay(2, 29); // => 02-29 +} +{ + let md; + md = Temporal.PlainMonthDay.from("08-24"); // => 08-24 + md = Temporal.PlainMonthDay.from("0824"); // => 08-24 + md = Temporal.PlainMonthDay.from("2006-08-24"); // => 08-24 + md = Temporal.PlainMonthDay.from("2006-08-24T15:43:27"); // => 08-24 + md = Temporal.PlainMonthDay.from("2006-08-24T15:43:27+01:00[Europe/Brussels]"); + // => 08-24 + md === Temporal.PlainMonthDay.from(md); // => false + md = Temporal.PlainMonthDay.from({ monthCode: "M08", day: 24 }); // => 08-24 + md = Temporal.PlainMonthDay.from(Temporal.PlainDate.from("2006-08-24")); + // => 08-24 + // (same as above; Temporal.PlainDate has month and day properties) + // Different overflow modes + md = Temporal.PlainMonthDay.from({ month: 13, day: 1, year: 2000 }, { overflow: "constrain" }); + // => 12-01 + md = Temporal.PlainMonthDay.from({ month: 1, day: 32, year: 2000 }, { overflow: "constrain" }); + // => 01-31 + md = Temporal.PlainMonthDay.from({ month: 13, day: 1, year: 2000 }, { overflow: "reject" }); + // => throws + md = Temporal.PlainMonthDay.from({ month: 1, day: 32, year: 2000 }, { overflow: "reject" }); + // => throws + md = Temporal.PlainMonthDay.from({ month: 2, day: 29, year: 2001 }, { overflow: "reject" }); + // => throws (this year is not a leap year in the ISO 8601 calendar) + // non-ISO calendars + md = Temporal.PlainMonthDay.from({ monthCode: "M05L", day: 15, calendar: "hebrew" }); + // => 1970-02-21[u-ca=hebrew] + md = Temporal.PlainMonthDay.from({ month: 6, day: 15, year: 5779, calendar: "hebrew" }); + // => 1970-02-21[u-ca=hebrew] + /* WRONG */ md = Temporal.PlainMonthDay.from({ month: 6, day: 15, calendar: "hebrew" }); + // => throws (either year or monthCode is required) + md = Temporal.PlainMonthDay.from("2019-02-20[u-ca=hebrew]"); + md.monthCode; // => 'M05L' + md.day; // => 15 + md.month; // undefined + // (month property is not present in this type; use monthCode instead) +} +{ + let md; + md = Temporal.PlainMonthDay.from("08-24"); + md.monthCode; // => 'M08' + md.day; // => 24 + md.month; // => undefined + // (no `month` property; use `monthCode` instead) + md = Temporal.PlainMonthDay.from("2019-02-20[u-ca=hebrew]"); + md.monthCode; // => 'M05L' + md.day; // => 15 + md.month; // => undefined + // (no `month` property; use `monthCode` instead) +} +{ + const md = Temporal.PlainMonthDay.from("11-15"); + // What's the last day of that month? + md.with({ day: 31 }); // => 11-30 + Temporal.PlainMonthDay.from("02-01").with({ day: 31 }); // => 02-29 +} +{ + const md1 = Temporal.PlainMonthDay.from("02-28"); + const md2 = Temporal.PlainMonthDay.from("02-29"); + md1.equals(md2); // => false + md1.equals("02-29"); // => false + md1.equals({ monthCode: "M02", day: 29 }); // => false + md2.equals(md2); // => true + md2.equals("02-29"); // => true + md2.equals({ monthCode: "M02", day: 29 }); // => true +} +{ + const md = Temporal.PlainMonthDay.from("08-24"); + md.toString(); // => '08-24' +} +{ + const { calendar } = new Intl.DateTimeFormat().resolvedOptions(); + const md = Temporal.PlainMonthDay.from({ monthCode: "M08", day: 24, calendar }); + md.toLocaleString(); // example output: '8/24' + // Same as above, but explicitly specifying the calendar: + md.toLocaleString(undefined, { calendar }); // example output: '8/24' + md.toLocaleString("de-DE", { calendar }); // => '24.8.' + md.toLocaleString("de-DE", { month: "long", day: "numeric", calendar }); // => '24. August' + md.toLocaleString(`en-US-u-nu-fullwide-ca-${calendar}`); // => '8/24' +} +{ + const md = Temporal.PlainMonthDay.from({ + calendar: "japanese", + monthCode: "M01", + day: 1, + }); + const date = md.toPlainDate({ era: "reiwa", eraYear: 2 }); // => 2020-01-01[u-ca=japanese] +} +{ + new Temporal.Duration(1, 2, 3, 4, 5, 6, 7, 987, 654, 321); // => P1Y2M3W4DT5H6M7.987654321S + new Temporal.Duration(0, 0, 0, 40); // => P40D + new Temporal.Duration(undefined, undefined, undefined, 40); // => P40D + new Temporal.Duration(); // => PT0S +} +{ + let d; + d = Temporal.Duration.from({ years: 1, days: 1 }); // => P1Y1D + d = Temporal.Duration.from({ days: -2, hours: -12 }); // => -P2DT12H + Temporal.Duration.from(d) === d; // => false + d = Temporal.Duration.from("P1Y1D"); // => P1Y1D + d = Temporal.Duration.from("-P2DT12H"); // => -P2DT12H + d = Temporal.Duration.from("P0D"); // => PT0S +} +{ + const one = Temporal.Duration.from({ hours: 79, minutes: 10 }); + const two = Temporal.Duration.from({ days: 3, hours: 7, seconds: 630 }); + const three = Temporal.Duration.from({ days: 3, hours: 6, minutes: 50 }); + const sorted1 = [one, two, three].sort(Temporal.Duration.compare); + sorted1.join(" "); + // => 'P3DT6H50M PT79H10M P3DT7H630S' + // Sorting relative to a date, taking DST changes into account: + const relativeTo = Temporal.ZonedDateTime.from("2020-11-01T00:00-07:00[America/Los_Angeles]"); + const sorted2 = [one, two, three].sort((one, two) => Temporal.Duration.compare(one, two, { relativeTo })); + sorted2.join(" "); + // => 'PT79H10M P3DT6H50M P3DT7H630S' +} +{ + const d = Temporal.Duration.from("P1Y2M3W4DT5H6M7.987654321S"); + d.years; // => 1 + d.months; // => 2 + d.weeks; // => 3 + d.days; // => 4 + d.hours; // => 5 + d.minutes; // => 6 + d.seconds; // => 7 + d.milliseconds; // => 987 + d.microseconds; // => 654 + d.nanoseconds; // => 321 +} +{ + let d; + d = Temporal.Duration.from("PT0S"); + d.blank; // => true + d = Temporal.Duration.from({ days: 0, hours: 0, minutes: 0 }); + d.blank; // => true +} +{ + let duration; + duration = Temporal.Duration.from({ months: 50, days: 50, hours: 50, minutes: 100 }); + // Perform a balance operation using additional ISO 8601 calendar rules: + let { years, months } = duration; + years += Math.floor(months / 12); + months %= 12; + duration = duration.with({ years, months }); + // => P4Y2M50DT50H100M +} +{ + const hour = Temporal.Duration.from("PT1H"); + hour.add({ minutes: 30 }); // => PT1H30M + // Examples of balancing: + const one = Temporal.Duration.from({ hours: 1, minutes: 30 }); + const two = Temporal.Duration.from({ hours: 2, minutes: 45 }); + const result = one.add(two); // => PT4H15M + // Example of adding calendar units + const oneAndAHalfMonth = Temporal.Duration.from({ months: 1, days: 16 }); + // To convert units, use arithmetic relative to a start date: + const startDate1 = Temporal.PlainDate.from("2000-12-01"); + startDate1.add(oneAndAHalfMonth).add(oneAndAHalfMonth) + .since(startDate1, { largestUnit: "months" }); // => P3M4D + const startDate2 = Temporal.PlainDate.from("2001-01-01"); + startDate2.add(oneAndAHalfMonth).add(oneAndAHalfMonth) + .since(startDate2, { largestUnit: "months" }); // => P3M1D +} +{ + const hourAndAHalf = Temporal.Duration.from("PT1H30M"); + hourAndAHalf.subtract({ hours: 1 }); // => PT30M + const one = Temporal.Duration.from({ minutes: 180 }); + const two = Temporal.Duration.from({ seconds: 30 }); + one.subtract(two); // => PT179M30S + one.subtract(two).round({ largestUnit: "hour" }); // => PT2H59M30S + // Example of subtracting calendar units; cannot be subtracted using + // subtract() because units need to be converted + const threeMonths = Temporal.Duration.from({ months: 3 }); + const oneAndAHalfMonth = Temporal.Duration.from({ months: 1, days: 15 }); + // To convert units, use arithmetic relative to a start date: + const startDate1 = Temporal.PlainDate.from("2001-01-01"); + startDate1.add(threeMonths).subtract(oneAndAHalfMonth) + .since(startDate1, { largestUnit: "months" }); // => P1M13D + const startDate2 = Temporal.PlainDate.from("2001-02-01"); + startDate2.add(threeMonths).subtract(oneAndAHalfMonth) + .since(startDate2, { largestUnit: "months" }); // => P1M16D +} +{ + const d = Temporal.Duration.from("P1Y2M3DT4H5M6.987654321S"); + d.sign; // 1 + d.negated(); // -P1Y2M3DT4H5M6.987654321S + d.negated().sign; // -1 +} +{ + const d = Temporal.Duration.from("-PT8H30M"); + d.abs(); // PT8H30M +} +{ + let d; + // Balance a duration as far as possible without knowing a starting point + d = Temporal.Duration.from({ minutes: 130 }); + d.round({ largestUnit: "day" }); // => PT2H10M + // Round to the nearest unit + d = Temporal.Duration.from({ minutes: 10, seconds: 52 }); + d.round({ smallestUnit: "minute" }); // => PT11M + d.round({ smallestUnit: "minute", roundingMode: "trunc" }); // => PT10M + // How many seconds in a multi-unit duration? + d = Temporal.Duration.from("PT2H34M18S"); + d.round({ largestUnit: "second" }).seconds; // => 9258 + // Normalize, with and without taking DST into account + d = Temporal.Duration.from({ hours: 2756 }); + d.round({ + relativeTo: "2020-01-01T00:00+01:00[Europe/Rome]", + largestUnit: "year", + }); // => P114DT21H + // (one hour longer because DST skipped an hour) + d.round({ + relativeTo: "2020-01-01", + largestUnit: "year", + }); // => P114DT20H + // (one hour shorter if ignoring DST) + // Normalize days into months or years + d = Temporal.Duration.from({ days: 190 }); + const refDate = Temporal.PlainDate.from("2020-01-01"); + d.round({ relativeTo: refDate, largestUnit: "year" }); // => P6M8D + // Same, but in a different calendar system + d.round({ + relativeTo: refDate.withCalendar("hebrew"), + largestUnit: "year", + }); // => P6M13D + // Round a duration up to the next 5-minute billing period + d = Temporal.Duration.from({ minutes: 6 }); + d.round({ + smallestUnit: "minute", + roundingIncrement: 5, + roundingMode: "ceil", + }); // => PT10M + // How many full 3-month quarters of this year, are in this duration? + d = Temporal.Duration.from({ months: 10, days: 15 }); + d = d.round({ + smallestUnit: "month", + roundingIncrement: 3, + roundingMode: "trunc", + relativeTo: Temporal.Now.plainDateISO(), + }); + const quarters = d.months / 3; + quarters; // => 3 +} +{ + let d; + // How many seconds in 130 hours and 20 minutes? + d = Temporal.Duration.from({ hours: 130, minutes: 20 }); + d.total({ unit: "second" }); // => 469200 + // How many 24-hour days is 123456789 seconds? + d = Temporal.Duration.from("PT123456789S"); + d.total({ unit: "day" }); // 1428.8980208333332 + // Find totals in months, with and without taking DST into account + d = Temporal.Duration.from({ hours: 2756 }); + d.total({ + relativeTo: "2020-01-01T00:00+01:00[Europe/Rome]", + unit: "month", + }); // => 3.7958333333333334 + d.total({ + unit: "month", + relativeTo: "2020-01-01", + }); // => 3.7944444444444443 +} +{ + let d; + d = Temporal.Duration.from({ years: 1, days: 1 }); + d.toString(); // => P1Y1D + d = Temporal.Duration.from({ years: -1, days: -1 }); + d.toString(); // => -P1Y1D + d = Temporal.Duration.from({ milliseconds: 1000 }); + d.toString(); // => PT1S + // The output format always balances units under 1 s, even if the + // underlying Temporal.Duration object doesn't. + const nobal = Temporal.Duration.from({ milliseconds: 3500 }); + console.log(`${nobal}`, nobal.seconds, nobal.milliseconds); // => 'PT3.5S 0 3500' + const bal = nobal.round({ largestUnit: "year" }); // balance through round + console.log(`${bal}`, bal.seconds, bal.milliseconds); // => 'PT3.5S 3 500' + d = Temporal.Duration.from("PT59.999999999S"); + d.toString({ smallestUnit: "second" }); // => PT59S + d.toString({ fractionalSecondDigits: 0 }); // => PT59S + d.toString({ fractionalSecondDigits: 4 }); // => PT59.9999S + d.toString({ fractionalSecondDigits: 8, roundingMode: "halfExpand" }); + // => PT60.00000000S +} +{ + const d = Temporal.Duration.from("P1DT6H30M"); + d.toLocaleString(); // example output: '1 day 6 hours 30 minutes' + d.toLocaleString("de-DE"); // example output: '1 Tag 6 Stunden 30 Minuten' + d.toLocaleString("en-US", { days: "short", hours: "numeric" }); // example output: '1 day 6 hours' +} +{ + Temporal.Now.instant(); // get the current system exact time + Temporal.Now.timeZoneId(); // get the current system time zone + Temporal.Now.zonedDateTimeISO(); // get the current date and wall-clock time in the system time zone and ISO-8601 calendar + Temporal.Now.plainDateISO(); // get the current date in the system time zone and ISO-8601 calendar + Temporal.Now.plainTimeISO(); // get the current wall-clock time in the system time zone and ISO-8601 calendar + Temporal.Now.plainDateTimeISO(); // same as above, but return the DateTime in the ISO-8601 calendar +} diff --git a/tests/baselines/reference/temporal.symbols b/tests/baselines/reference/temporal.symbols new file mode 100644 index 0000000000000..d3c5080ad61da --- /dev/null +++ b/tests/baselines/reference/temporal.symbols @@ -0,0 +1,7026 @@ +//// [tests/cases/compiler/temporal.ts] //// + +=== temporal.ts === +/** + * Test cases derived from documentation at tc39/proposal-temporal, + * under the following license: + * + * Copyright 2017, 2018, 2019, 2020 ECMA International + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH + * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, + * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM + * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR + * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. + */ + +{ + const instant = Temporal.Instant.from("2020-01-01T00:00+05:30"); // => 2019-12-31T18:30:00Z +>instant : Symbol(instant, Decl(temporal.ts, 20, 9)) +>Temporal.Instant.from : Symbol(Temporal.InstantConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.Instant : Symbol(Temporal.Instant, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>Instant : Symbol(Temporal.Instant, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.InstantConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) + + instant.epochNanoseconds; // => 1577817000000000000n +>instant.epochNanoseconds : Symbol(Temporal.Instant.epochNanoseconds, Decl(lib.esnext.temporal.d.ts, --, --)) +>instant : Symbol(instant, Decl(temporal.ts, 20, 9)) +>epochNanoseconds : Symbol(Temporal.Instant.epochNanoseconds, Decl(lib.esnext.temporal.d.ts, --, --)) + + // `Temporal.Instant` lacks properties that depend on time zone or calendar + instant.year; // => undefined +>instant : Symbol(instant, Decl(temporal.ts, 20, 9)) + + const zdtTokyo = instant.toZonedDateTimeISO("Asia/Tokyo"); // => 2020-01-01T03:30:00+09:00[Asia/Tokyo] +>zdtTokyo : Symbol(zdtTokyo, Decl(temporal.ts, 26, 9)) +>instant.toZonedDateTimeISO : Symbol(Temporal.Instant.toZonedDateTimeISO, Decl(lib.esnext.temporal.d.ts, --, --)) +>instant : Symbol(instant, Decl(temporal.ts, 20, 9)) +>toZonedDateTimeISO : Symbol(Temporal.Instant.toZonedDateTimeISO, Decl(lib.esnext.temporal.d.ts, --, --)) + + zdtTokyo.year; // => 2020 +>zdtTokyo.year : Symbol(Temporal.ZonedDateTime.year, Decl(lib.esnext.temporal.d.ts, --, --)) +>zdtTokyo : Symbol(zdtTokyo, Decl(temporal.ts, 26, 9)) +>year : Symbol(Temporal.ZonedDateTime.year, Decl(lib.esnext.temporal.d.ts, --, --)) + + zdtTokyo.toPlainDate(); // => 2020-01-01 +>zdtTokyo.toPlainDate : Symbol(Temporal.ZonedDateTime.toPlainDate, Decl(lib.esnext.temporal.d.ts, --, --)) +>zdtTokyo : Symbol(zdtTokyo, Decl(temporal.ts, 26, 9)) +>toPlainDate : Symbol(Temporal.ZonedDateTime.toPlainDate, Decl(lib.esnext.temporal.d.ts, --, --)) +} + +{ + // Convert from `Temporal.Instant` to `Date` (which uses millisecond precision) + const instant = Temporal.Instant.from("2020-01-01T00:00:00.123456789+05:30"); +>instant : Symbol(instant, Decl(temporal.ts, 33, 9)) +>Temporal.Instant.from : Symbol(Temporal.InstantConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.Instant : Symbol(Temporal.Instant, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>Instant : Symbol(Temporal.Instant, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.InstantConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) + + // => 2019-12-31T18:30:00.123456789Z + const date = new Date(instant.epochMilliseconds); +>date : Symbol(date, Decl(temporal.ts, 35, 9)) +>Date : Symbol(Date, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.esnext.date.d.ts, --, --)) +>instant.epochMilliseconds : Symbol(Temporal.Instant.epochMilliseconds, Decl(lib.esnext.temporal.d.ts, --, --)) +>instant : Symbol(instant, Decl(temporal.ts, 33, 9)) +>epochMilliseconds : Symbol(Temporal.Instant.epochMilliseconds, Decl(lib.esnext.temporal.d.ts, --, --)) + + date.toISOString(); // => 2019-12-31T18:30:00.123Z +>date.toISOString : Symbol(Date.toISOString, Decl(lib.es5.d.ts, --, --)) +>date : Symbol(date, Decl(temporal.ts, 35, 9)) +>toISOString : Symbol(Date.toISOString, Decl(lib.es5.d.ts, --, --)) + + // Convert from `Date` to `Temporal.Instant` + const sameInstant = date.toTemporalInstant(); // => 2019-12-31T18:30:00.123Z +>sameInstant : Symbol(sameInstant, Decl(temporal.ts, 39, 9)) +>date.toTemporalInstant : Symbol(Date.toTemporalInstant, Decl(lib.esnext.date.d.ts, --, --)) +>date : Symbol(date, Decl(temporal.ts, 35, 9)) +>toTemporalInstant : Symbol(Date.toTemporalInstant, Decl(lib.esnext.date.d.ts, --, --)) +} + +{ + const date = new Date(2019, 11, 31, 18, 30); // => Tue Dec 31 2019 18:30:00 GMT-0800 (Pacific Standard Time) +>date : Symbol(date, Decl(temporal.ts, 43, 9)) +>Date : Symbol(Date, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.esnext.date.d.ts, --, --)) + + const instant = date.toTemporalInstant(); // => 2020-01-01T02:30:00Z +>instant : Symbol(instant, Decl(temporal.ts, 44, 9)) +>date.toTemporalInstant : Symbol(Date.toTemporalInstant, Decl(lib.esnext.date.d.ts, --, --)) +>date : Symbol(date, Decl(temporal.ts, 43, 9)) +>toTemporalInstant : Symbol(Date.toTemporalInstant, Decl(lib.esnext.date.d.ts, --, --)) + + const zonedDateTime = instant.toZonedDateTimeISO(Temporal.Now.timeZoneId()); +>zonedDateTime : Symbol(zonedDateTime, Decl(temporal.ts, 45, 9)) +>instant.toZonedDateTimeISO : Symbol(Temporal.Instant.toZonedDateTimeISO, Decl(lib.esnext.temporal.d.ts, --, --)) +>instant : Symbol(instant, Decl(temporal.ts, 44, 9)) +>toZonedDateTimeISO : Symbol(Temporal.Instant.toZonedDateTimeISO, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.Now.timeZoneId : Symbol(Temporal.Now.timeZoneId, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.Now : Symbol(Temporal.Now, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>Now : Symbol(Temporal.Now, Decl(lib.esnext.temporal.d.ts, --, --)) +>timeZoneId : Symbol(Temporal.Now.timeZoneId, Decl(lib.esnext.temporal.d.ts, --, --)) + + // => 2019-12-31T18:30:00-08:00[America/Los_Angeles] + zonedDateTime.day; // => 31 +>zonedDateTime.day : Symbol(Temporal.ZonedDateTime.day, Decl(lib.esnext.temporal.d.ts, --, --)) +>zonedDateTime : Symbol(zonedDateTime, Decl(temporal.ts, 45, 9)) +>day : Symbol(Temporal.ZonedDateTime.day, Decl(lib.esnext.temporal.d.ts, --, --)) + + const dateOnly = zonedDateTime.toPlainDate(); // => 2019-12-31 +>dateOnly : Symbol(dateOnly, Decl(temporal.ts, 48, 9)) +>zonedDateTime.toPlainDate : Symbol(Temporal.ZonedDateTime.toPlainDate, Decl(lib.esnext.temporal.d.ts, --, --)) +>zonedDateTime : Symbol(zonedDateTime, Decl(temporal.ts, 45, 9)) +>toPlainDate : Symbol(Temporal.ZonedDateTime.toPlainDate, Decl(lib.esnext.temporal.d.ts, --, --)) +} + +{ + const instant = new Temporal.Instant(1553906700000000000n); +>instant : Symbol(instant, Decl(temporal.ts, 52, 9)) +>Temporal.Instant : Symbol(Temporal.Instant, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>Instant : Symbol(Temporal.Instant, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) + + // When was the Unix epoch? + const epoch = new Temporal.Instant(0n); // => 1970-01-01T00:00:00Z +>epoch : Symbol(epoch, Decl(temporal.ts, 54, 9)) +>Temporal.Instant : Symbol(Temporal.Instant, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>Instant : Symbol(Temporal.Instant, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) + + // Dates before the Unix epoch are negative + const turnOfTheCentury = new Temporal.Instant(-2208988800000000000n); // => 1900-01-01T00:00:00Z +>turnOfTheCentury : Symbol(turnOfTheCentury, Decl(temporal.ts, 56, 9)) +>Temporal.Instant : Symbol(Temporal.Instant, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>Instant : Symbol(Temporal.Instant, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +} + +{ + let instant: Temporal.Instant; +>instant : Symbol(instant, Decl(temporal.ts, 60, 7)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>Instant : Symbol(Temporal.Instant, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) + + instant = Temporal.Instant.from("2019-03-30T01:45:00+01:00[Europe/Berlin]"); +>instant : Symbol(instant, Decl(temporal.ts, 60, 7)) +>Temporal.Instant.from : Symbol(Temporal.InstantConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.Instant : Symbol(Temporal.Instant, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>Instant : Symbol(Temporal.Instant, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.InstantConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) + + instant = Temporal.Instant.from("2019-03-30T01:45+01:00"); +>instant : Symbol(instant, Decl(temporal.ts, 60, 7)) +>Temporal.Instant.from : Symbol(Temporal.InstantConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.Instant : Symbol(Temporal.Instant, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>Instant : Symbol(Temporal.Instant, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.InstantConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) + + instant = Temporal.Instant.from("2019-03-30T00:45Z"); +>instant : Symbol(instant, Decl(temporal.ts, 60, 7)) +>Temporal.Instant.from : Symbol(Temporal.InstantConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.Instant : Symbol(Temporal.Instant, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>Instant : Symbol(Temporal.Instant, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.InstantConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) + + instant === Temporal.Instant.from(instant); // => false +>instant : Symbol(instant, Decl(temporal.ts, 60, 7)) +>Temporal.Instant.from : Symbol(Temporal.InstantConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.Instant : Symbol(Temporal.Instant, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>Instant : Symbol(Temporal.Instant, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.InstantConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>instant : Symbol(instant, Decl(temporal.ts, 60, 7)) +} + +{ + const legacyDate = new Date("1995-12-17T03:24Z"); +>legacyDate : Symbol(legacyDate, Decl(temporal.ts, 68, 9)) +>Date : Symbol(Date, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.esnext.date.d.ts, --, --)) + + let instant: Temporal.Instant; +>instant : Symbol(instant, Decl(temporal.ts, 69, 7)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>Instant : Symbol(Temporal.Instant, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) + + instant = Temporal.Instant.fromEpochMilliseconds(legacyDate.getTime()); // => 1995-12-17T03:24:00Z +>instant : Symbol(instant, Decl(temporal.ts, 69, 7)) +>Temporal.Instant.fromEpochMilliseconds : Symbol(Temporal.InstantConstructor.fromEpochMilliseconds, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.Instant : Symbol(Temporal.Instant, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>Instant : Symbol(Temporal.Instant, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>fromEpochMilliseconds : Symbol(Temporal.InstantConstructor.fromEpochMilliseconds, Decl(lib.esnext.temporal.d.ts, --, --)) +>legacyDate.getTime : Symbol(Date.getTime, Decl(lib.es5.d.ts, --, --)) +>legacyDate : Symbol(legacyDate, Decl(temporal.ts, 68, 9)) +>getTime : Symbol(Date.getTime, Decl(lib.es5.d.ts, --, --)) + + instant = Temporal.Instant.fromEpochMilliseconds(legacyDate); // valueOf() called implicitly +>instant : Symbol(instant, Decl(temporal.ts, 69, 7)) +>Temporal.Instant.fromEpochMilliseconds : Symbol(Temporal.InstantConstructor.fromEpochMilliseconds, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.Instant : Symbol(Temporal.Instant, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>Instant : Symbol(Temporal.Instant, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>fromEpochMilliseconds : Symbol(Temporal.InstantConstructor.fromEpochMilliseconds, Decl(lib.esnext.temporal.d.ts, --, --)) +>legacyDate : Symbol(legacyDate, Decl(temporal.ts, 68, 9)) + + instant = legacyDate.toTemporalInstant(); // recommended +>instant : Symbol(instant, Decl(temporal.ts, 69, 7)) +>legacyDate.toTemporalInstant : Symbol(Date.toTemporalInstant, Decl(lib.esnext.date.d.ts, --, --)) +>legacyDate : Symbol(legacyDate, Decl(temporal.ts, 68, 9)) +>toTemporalInstant : Symbol(Date.toTemporalInstant, Decl(lib.esnext.date.d.ts, --, --)) +} + +{ + const one = Temporal.Instant.fromEpochMilliseconds(1.0e12); +>one : Symbol(one, Decl(temporal.ts, 76, 9)) +>Temporal.Instant.fromEpochMilliseconds : Symbol(Temporal.InstantConstructor.fromEpochMilliseconds, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.Instant : Symbol(Temporal.Instant, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>Instant : Symbol(Temporal.Instant, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>fromEpochMilliseconds : Symbol(Temporal.InstantConstructor.fromEpochMilliseconds, Decl(lib.esnext.temporal.d.ts, --, --)) + + const two = Temporal.Instant.fromEpochMilliseconds(1.1e12); +>two : Symbol(two, Decl(temporal.ts, 77, 9)) +>Temporal.Instant.fromEpochMilliseconds : Symbol(Temporal.InstantConstructor.fromEpochMilliseconds, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.Instant : Symbol(Temporal.Instant, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>Instant : Symbol(Temporal.Instant, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>fromEpochMilliseconds : Symbol(Temporal.InstantConstructor.fromEpochMilliseconds, Decl(lib.esnext.temporal.d.ts, --, --)) + + const three = Temporal.Instant.fromEpochMilliseconds(1.2e12); +>three : Symbol(three, Decl(temporal.ts, 78, 9)) +>Temporal.Instant.fromEpochMilliseconds : Symbol(Temporal.InstantConstructor.fromEpochMilliseconds, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.Instant : Symbol(Temporal.Instant, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>Instant : Symbol(Temporal.Instant, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>fromEpochMilliseconds : Symbol(Temporal.InstantConstructor.fromEpochMilliseconds, Decl(lib.esnext.temporal.d.ts, --, --)) + + const sorted = [three, one, two].sort(Temporal.Instant.compare); +>sorted : Symbol(sorted, Decl(temporal.ts, 79, 9)) +>[three, one, two].sort : Symbol(Array.sort, Decl(lib.es5.d.ts, --, --)) +>three : Symbol(three, Decl(temporal.ts, 78, 9)) +>one : Symbol(one, Decl(temporal.ts, 76, 9)) +>two : Symbol(two, Decl(temporal.ts, 77, 9)) +>sort : Symbol(Array.sort, Decl(lib.es5.d.ts, --, --)) +>Temporal.Instant.compare : Symbol(Temporal.InstantConstructor.compare, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.Instant : Symbol(Temporal.Instant, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>Instant : Symbol(Temporal.Instant, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>compare : Symbol(Temporal.InstantConstructor.compare, Decl(lib.esnext.temporal.d.ts, --, --)) + + sorted.join(" "); +>sorted.join : Symbol(Array.join, Decl(lib.es5.d.ts, --, --)) +>sorted : Symbol(sorted, Decl(temporal.ts, 79, 9)) +>join : Symbol(Array.join, Decl(lib.es5.d.ts, --, --)) + + // => '2001-09-09T01:46:40Z 2004-11-09T11:33:20Z 2008-01-10T21:20:00Z' +} + +{ + const instant = Temporal.Instant.from("2019-03-30T00:45Z"); +>instant : Symbol(instant, Decl(temporal.ts, 85, 9)) +>Temporal.Instant.from : Symbol(Temporal.InstantConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.Instant : Symbol(Temporal.Instant, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>Instant : Symbol(Temporal.Instant, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.InstantConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) + + new Date(instant.epochMilliseconds); // => 2019-03-30T00:45:00.000Z +>Date : Symbol(Date, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.esnext.date.d.ts, --, --)) +>instant.epochMilliseconds : Symbol(Temporal.Instant.epochMilliseconds, Decl(lib.esnext.temporal.d.ts, --, --)) +>instant : Symbol(instant, Decl(temporal.ts, 85, 9)) +>epochMilliseconds : Symbol(Temporal.Instant.epochMilliseconds, Decl(lib.esnext.temporal.d.ts, --, --)) + + // If you need epoch seconds data: + const epochSecs = Math.floor(instant.epochMilliseconds / 1000); // => 1553906700 +>epochSecs : Symbol(epochSecs, Decl(temporal.ts, 89, 9)) +>Math.floor : Symbol(Math.floor, Decl(lib.es5.d.ts, --, --)) +>Math : Symbol(Math, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) +>floor : Symbol(Math.floor, Decl(lib.es5.d.ts, --, --)) +>instant.epochMilliseconds : Symbol(Temporal.Instant.epochMilliseconds, Decl(lib.esnext.temporal.d.ts, --, --)) +>instant : Symbol(instant, Decl(temporal.ts, 85, 9)) +>epochMilliseconds : Symbol(Temporal.Instant.epochMilliseconds, Decl(lib.esnext.temporal.d.ts, --, --)) + + const ns = instant.epochNanoseconds; +>ns : Symbol(ns, Decl(temporal.ts, 91, 9)) +>instant.epochNanoseconds : Symbol(Temporal.Instant.epochNanoseconds, Decl(lib.esnext.temporal.d.ts, --, --)) +>instant : Symbol(instant, Decl(temporal.ts, 85, 9)) +>epochNanoseconds : Symbol(Temporal.Instant.epochNanoseconds, Decl(lib.esnext.temporal.d.ts, --, --)) + + const epochMicros = ns / 1000n + ((ns % 1000n) < 0n ? -1n : 0n); +>epochMicros : Symbol(epochMicros, Decl(temporal.ts, 92, 9)) +>ns : Symbol(ns, Decl(temporal.ts, 91, 9)) +>ns : Symbol(ns, Decl(temporal.ts, 91, 9)) +} + +{ + // Converting a specific exact time to a calendar date / wall-clock time + let timestamp: Temporal.Instant; +>timestamp : Symbol(timestamp, Decl(temporal.ts, 97, 7)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>Instant : Symbol(Temporal.Instant, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) + + timestamp = Temporal.Instant.fromEpochMilliseconds(1553993100_000); +>timestamp : Symbol(timestamp, Decl(temporal.ts, 97, 7)) +>Temporal.Instant.fromEpochMilliseconds : Symbol(Temporal.InstantConstructor.fromEpochMilliseconds, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.Instant : Symbol(Temporal.Instant, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>Instant : Symbol(Temporal.Instant, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>fromEpochMilliseconds : Symbol(Temporal.InstantConstructor.fromEpochMilliseconds, Decl(lib.esnext.temporal.d.ts, --, --)) + + timestamp.toZonedDateTimeISO("Europe/Berlin"); // => 2019-03-31T01:45:00+01:00[Europe/Berlin] +>timestamp.toZonedDateTimeISO : Symbol(Temporal.Instant.toZonedDateTimeISO, Decl(lib.esnext.temporal.d.ts, --, --)) +>timestamp : Symbol(timestamp, Decl(temporal.ts, 97, 7)) +>toZonedDateTimeISO : Symbol(Temporal.Instant.toZonedDateTimeISO, Decl(lib.esnext.temporal.d.ts, --, --)) + + timestamp.toZonedDateTimeISO("UTC"); // => 2019-03-31T00:45:00+00:00[UTC] +>timestamp.toZonedDateTimeISO : Symbol(Temporal.Instant.toZonedDateTimeISO, Decl(lib.esnext.temporal.d.ts, --, --)) +>timestamp : Symbol(timestamp, Decl(temporal.ts, 97, 7)) +>toZonedDateTimeISO : Symbol(Temporal.Instant.toZonedDateTimeISO, Decl(lib.esnext.temporal.d.ts, --, --)) + + timestamp.toZonedDateTimeISO("-08:00"); // => 2019-03-30T16:45:00-08:00[-08:00] +>timestamp.toZonedDateTimeISO : Symbol(Temporal.Instant.toZonedDateTimeISO, Decl(lib.esnext.temporal.d.ts, --, --)) +>timestamp : Symbol(timestamp, Decl(temporal.ts, 97, 7)) +>toZonedDateTimeISO : Symbol(Temporal.Instant.toZonedDateTimeISO, Decl(lib.esnext.temporal.d.ts, --, --)) + + // What time was the Unix epoch (timestamp 0) in Bell Labs (Murray Hill, New Jersey, USA) in the Gregorian calendar? + const epoch = Temporal.Instant.fromEpochMilliseconds(0); +>epoch : Symbol(epoch, Decl(temporal.ts, 104, 9)) +>Temporal.Instant.fromEpochMilliseconds : Symbol(Temporal.InstantConstructor.fromEpochMilliseconds, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.Instant : Symbol(Temporal.Instant, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>Instant : Symbol(Temporal.Instant, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>fromEpochMilliseconds : Symbol(Temporal.InstantConstructor.fromEpochMilliseconds, Decl(lib.esnext.temporal.d.ts, --, --)) + + epoch.toZonedDateTimeISO("America/New_York").withCalendar("gregory"); +>epoch.toZonedDateTimeISO("America/New_York").withCalendar : Symbol(Temporal.ZonedDateTime.withCalendar, Decl(lib.esnext.temporal.d.ts, --, --)) +>epoch.toZonedDateTimeISO : Symbol(Temporal.Instant.toZonedDateTimeISO, Decl(lib.esnext.temporal.d.ts, --, --)) +>epoch : Symbol(epoch, Decl(temporal.ts, 104, 9)) +>toZonedDateTimeISO : Symbol(Temporal.Instant.toZonedDateTimeISO, Decl(lib.esnext.temporal.d.ts, --, --)) +>withCalendar : Symbol(Temporal.ZonedDateTime.withCalendar, Decl(lib.esnext.temporal.d.ts, --, --)) + + // => 1969-12-31T19:00:00-05:00[America/New_York][u-ca=gregory] + + // What time was the Unix epoch in Tokyo in the Japanese calendar? + const zdt = epoch.toZonedDateTimeISO("Asia/Tokyo").withCalendar("japanese"); +>zdt : Symbol(zdt, Decl(temporal.ts, 109, 9)) +>epoch.toZonedDateTimeISO("Asia/Tokyo").withCalendar : Symbol(Temporal.ZonedDateTime.withCalendar, Decl(lib.esnext.temporal.d.ts, --, --)) +>epoch.toZonedDateTimeISO : Symbol(Temporal.Instant.toZonedDateTimeISO, Decl(lib.esnext.temporal.d.ts, --, --)) +>epoch : Symbol(epoch, Decl(temporal.ts, 104, 9)) +>toZonedDateTimeISO : Symbol(Temporal.Instant.toZonedDateTimeISO, Decl(lib.esnext.temporal.d.ts, --, --)) +>withCalendar : Symbol(Temporal.ZonedDateTime.withCalendar, Decl(lib.esnext.temporal.d.ts, --, --)) + + // => 1970-01-01T09:00:00+09:00[Asia/Tokyo][u-ca=japanese] + console.log(zdt.eraYear, zdt.era); +>console.log : Symbol(Console.log, Decl(lib.dom.d.ts, --, --)) +>console : Symbol(console, Decl(lib.dom.d.ts, --, --)) +>log : Symbol(Console.log, Decl(lib.dom.d.ts, --, --)) +>zdt.eraYear : Symbol(Temporal.ZonedDateTime.eraYear, Decl(lib.esnext.temporal.d.ts, --, --)) +>zdt : Symbol(zdt, Decl(temporal.ts, 109, 9)) +>eraYear : Symbol(Temporal.ZonedDateTime.eraYear, Decl(lib.esnext.temporal.d.ts, --, --)) +>zdt.era : Symbol(Temporal.ZonedDateTime.era, Decl(lib.esnext.temporal.d.ts, --, --)) +>zdt : Symbol(zdt, Decl(temporal.ts, 109, 9)) +>era : Symbol(Temporal.ZonedDateTime.era, Decl(lib.esnext.temporal.d.ts, --, --)) + + // => '45 showa' +} + +{ + // Temporal.Instant representing five hours from now + Temporal.Now.instant().add({ hours: 5 }); +>Temporal.Now.instant().add : Symbol(Temporal.Instant.add, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.Now.instant : Symbol(Temporal.Now.instant, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.Now : Symbol(Temporal.Now, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>Now : Symbol(Temporal.Now, Decl(lib.esnext.temporal.d.ts, --, --)) +>instant : Symbol(Temporal.Now.instant, Decl(lib.esnext.temporal.d.ts, --, --)) +>add : Symbol(Temporal.Instant.add, Decl(lib.esnext.temporal.d.ts, --, --)) +>hours : Symbol(hours, Decl(temporal.ts, 117, 32)) + + const fiveHours = Temporal.Duration.from({ hours: 5 }); +>fiveHours : Symbol(fiveHours, Decl(temporal.ts, 118, 9)) +>Temporal.Duration.from : Symbol(Temporal.DurationConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.Duration : Symbol(Temporal.Duration, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>Duration : Symbol(Temporal.Duration, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.DurationConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>hours : Symbol(hours, Decl(temporal.ts, 118, 46)) + + Temporal.Now.instant().add(fiveHours); +>Temporal.Now.instant().add : Symbol(Temporal.Instant.add, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.Now.instant : Symbol(Temporal.Now.instant, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.Now : Symbol(Temporal.Now, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>Now : Symbol(Temporal.Now, Decl(lib.esnext.temporal.d.ts, --, --)) +>instant : Symbol(Temporal.Now.instant, Decl(lib.esnext.temporal.d.ts, --, --)) +>add : Symbol(Temporal.Instant.add, Decl(lib.esnext.temporal.d.ts, --, --)) +>fiveHours : Symbol(fiveHours, Decl(temporal.ts, 118, 9)) +} + +{ + // Temporal.Instant representing this time an hour ago + Temporal.Now.instant().subtract({ hours: 1 }); +>Temporal.Now.instant().subtract : Symbol(Temporal.Instant.subtract, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.Now.instant : Symbol(Temporal.Now.instant, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.Now : Symbol(Temporal.Now, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>Now : Symbol(Temporal.Now, Decl(lib.esnext.temporal.d.ts, --, --)) +>instant : Symbol(Temporal.Now.instant, Decl(lib.esnext.temporal.d.ts, --, --)) +>subtract : Symbol(Temporal.Instant.subtract, Decl(lib.esnext.temporal.d.ts, --, --)) +>hours : Symbol(hours, Decl(temporal.ts, 124, 37)) + + const oneHour = Temporal.Duration.from({ hours: 1 }); +>oneHour : Symbol(oneHour, Decl(temporal.ts, 125, 9)) +>Temporal.Duration.from : Symbol(Temporal.DurationConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.Duration : Symbol(Temporal.Duration, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>Duration : Symbol(Temporal.Duration, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.DurationConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>hours : Symbol(hours, Decl(temporal.ts, 125, 44)) + + Temporal.Now.instant().subtract(oneHour); +>Temporal.Now.instant().subtract : Symbol(Temporal.Instant.subtract, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.Now.instant : Symbol(Temporal.Now.instant, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.Now : Symbol(Temporal.Now, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>Now : Symbol(Temporal.Now, Decl(lib.esnext.temporal.d.ts, --, --)) +>instant : Symbol(Temporal.Now.instant, Decl(lib.esnext.temporal.d.ts, --, --)) +>subtract : Symbol(Temporal.Instant.subtract, Decl(lib.esnext.temporal.d.ts, --, --)) +>oneHour : Symbol(oneHour, Decl(temporal.ts, 125, 9)) +} + +{ + const startOfMoonMission = Temporal.Instant.from("1969-07-16T13:32:00Z"); +>startOfMoonMission : Symbol(startOfMoonMission, Decl(temporal.ts, 130, 9)) +>Temporal.Instant.from : Symbol(Temporal.InstantConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.Instant : Symbol(Temporal.Instant, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>Instant : Symbol(Temporal.Instant, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.InstantConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) + + const endOfMoonMission = Temporal.Instant.from("1969-07-24T16:50:35Z"); +>endOfMoonMission : Symbol(endOfMoonMission, Decl(temporal.ts, 131, 9)) +>Temporal.Instant.from : Symbol(Temporal.InstantConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.Instant : Symbol(Temporal.Instant, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>Instant : Symbol(Temporal.Instant, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.InstantConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) + + const missionLength = startOfMoonMission.until(endOfMoonMission, { largestUnit: "hour" }); +>missionLength : Symbol(missionLength, Decl(temporal.ts, 132, 9)) +>startOfMoonMission.until : Symbol(Temporal.Instant.until, Decl(lib.esnext.temporal.d.ts, --, --)) +>startOfMoonMission : Symbol(startOfMoonMission, Decl(temporal.ts, 130, 9)) +>until : Symbol(Temporal.Instant.until, Decl(lib.esnext.temporal.d.ts, --, --)) +>endOfMoonMission : Symbol(endOfMoonMission, Decl(temporal.ts, 131, 9)) +>largestUnit : Symbol(largestUnit, Decl(temporal.ts, 132, 70)) + + // => PT195H18M35S + missionLength.toLocaleString(); +>missionLength.toLocaleString : Symbol(Temporal.Duration.toLocaleString, Decl(lib.esnext.temporal.d.ts, --, --)) +>missionLength : Symbol(missionLength, Decl(temporal.ts, 132, 9)) +>toLocaleString : Symbol(Temporal.Duration.toLocaleString, Decl(lib.esnext.temporal.d.ts, --, --)) + + // example output: '195 hours 18 minutes 35 seconds' + + // Rounding, for example if you don't care about the minutes and seconds + const approxMissionLength = startOfMoonMission.until(endOfMoonMission, { +>approxMissionLength : Symbol(approxMissionLength, Decl(temporal.ts, 138, 9)) +>startOfMoonMission.until : Symbol(Temporal.Instant.until, Decl(lib.esnext.temporal.d.ts, --, --)) +>startOfMoonMission : Symbol(startOfMoonMission, Decl(temporal.ts, 130, 9)) +>until : Symbol(Temporal.Instant.until, Decl(lib.esnext.temporal.d.ts, --, --)) +>endOfMoonMission : Symbol(endOfMoonMission, Decl(temporal.ts, 131, 9)) + + largestUnit: "hour", +>largestUnit : Symbol(largestUnit, Decl(temporal.ts, 138, 76)) + + smallestUnit: "hour", +>smallestUnit : Symbol(smallestUnit, Decl(temporal.ts, 139, 28)) + + }); + // => PT195H + + // A billion (10^9) seconds since the epoch in different units + const epoch = Temporal.Instant.fromEpochMilliseconds(0); +>epoch : Symbol(epoch, Decl(temporal.ts, 145, 9)) +>Temporal.Instant.fromEpochMilliseconds : Symbol(Temporal.InstantConstructor.fromEpochMilliseconds, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.Instant : Symbol(Temporal.Instant, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>Instant : Symbol(Temporal.Instant, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>fromEpochMilliseconds : Symbol(Temporal.InstantConstructor.fromEpochMilliseconds, Decl(lib.esnext.temporal.d.ts, --, --)) + + const billion = Temporal.Instant.fromEpochMilliseconds(1e9); +>billion : Symbol(billion, Decl(temporal.ts, 146, 9)) +>Temporal.Instant.fromEpochMilliseconds : Symbol(Temporal.InstantConstructor.fromEpochMilliseconds, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.Instant : Symbol(Temporal.Instant, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>Instant : Symbol(Temporal.Instant, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>fromEpochMilliseconds : Symbol(Temporal.InstantConstructor.fromEpochMilliseconds, Decl(lib.esnext.temporal.d.ts, --, --)) + + epoch.until(billion); +>epoch.until : Symbol(Temporal.Instant.until, Decl(lib.esnext.temporal.d.ts, --, --)) +>epoch : Symbol(epoch, Decl(temporal.ts, 145, 9)) +>until : Symbol(Temporal.Instant.until, Decl(lib.esnext.temporal.d.ts, --, --)) +>billion : Symbol(billion, Decl(temporal.ts, 146, 9)) + + // => PT1000000000S + epoch.until(billion, { largestUnit: "hour" }); +>epoch.until : Symbol(Temporal.Instant.until, Decl(lib.esnext.temporal.d.ts, --, --)) +>epoch : Symbol(epoch, Decl(temporal.ts, 145, 9)) +>until : Symbol(Temporal.Instant.until, Decl(lib.esnext.temporal.d.ts, --, --)) +>billion : Symbol(billion, Decl(temporal.ts, 146, 9)) +>largestUnit : Symbol(largestUnit, Decl(temporal.ts, 149, 26)) + + // => PT277777H46M40S + const ns = epoch.until(billion, { largestUnit: "nanosecond" }); +>ns : Symbol(ns, Decl(temporal.ts, 151, 9)) +>epoch.until : Symbol(Temporal.Instant.until, Decl(lib.esnext.temporal.d.ts, --, --)) +>epoch : Symbol(epoch, Decl(temporal.ts, 145, 9)) +>until : Symbol(Temporal.Instant.until, Decl(lib.esnext.temporal.d.ts, --, --)) +>billion : Symbol(billion, Decl(temporal.ts, 146, 9)) +>largestUnit : Symbol(largestUnit, Decl(temporal.ts, 151, 37)) + + // => PT1000000000S + ns.add({ nanoseconds: 1 }); +>ns.add : Symbol(Temporal.Duration.add, Decl(lib.esnext.temporal.d.ts, --, --)) +>ns : Symbol(ns, Decl(temporal.ts, 151, 9)) +>add : Symbol(Temporal.Duration.add, Decl(lib.esnext.temporal.d.ts, --, --)) +>nanoseconds : Symbol(nanoseconds, Decl(temporal.ts, 153, 12)) + + // => PT1000000000S + // (lost precision) + + // Calculate the difference in years, eliminating the ambiguity by + // explicitly using the corresponding calendar date in UTC: + epoch.toZonedDateTimeISO("UTC").until( +>epoch.toZonedDateTimeISO("UTC").until : Symbol(Temporal.ZonedDateTime.until, Decl(lib.esnext.temporal.d.ts, --, --)) +>epoch.toZonedDateTimeISO : Symbol(Temporal.Instant.toZonedDateTimeISO, Decl(lib.esnext.temporal.d.ts, --, --)) +>epoch : Symbol(epoch, Decl(temporal.ts, 145, 9)) +>toZonedDateTimeISO : Symbol(Temporal.Instant.toZonedDateTimeISO, Decl(lib.esnext.temporal.d.ts, --, --)) +>until : Symbol(Temporal.ZonedDateTime.until, Decl(lib.esnext.temporal.d.ts, --, --)) + + billion.toZonedDateTimeISO("UTC"), +>billion.toZonedDateTimeISO : Symbol(Temporal.Instant.toZonedDateTimeISO, Decl(lib.esnext.temporal.d.ts, --, --)) +>billion : Symbol(billion, Decl(temporal.ts, 146, 9)) +>toZonedDateTimeISO : Symbol(Temporal.Instant.toZonedDateTimeISO, Decl(lib.esnext.temporal.d.ts, --, --)) + + { largestUnit: "year" }, +>largestUnit : Symbol(largestUnit, Decl(temporal.ts, 161, 9)) + + ); + // => P31Y8M8DT1H46M40S +} + +{ + const instant = Temporal.Instant.from("2019-03-30T02:45:59.999999999Z"); +>instant : Symbol(instant, Decl(temporal.ts, 167, 9)) +>Temporal.Instant.from : Symbol(Temporal.InstantConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.Instant : Symbol(Temporal.Instant, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>Instant : Symbol(Temporal.Instant, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.InstantConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) + + // Round to a particular unit + instant.round({ smallestUnit: "second" }); // => 2019-03-30T02:46:00Z +>instant.round : Symbol(Temporal.Instant.round, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>instant : Symbol(instant, Decl(temporal.ts, 167, 9)) +>round : Symbol(Temporal.Instant.round, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>smallestUnit : Symbol(smallestUnit, Decl(temporal.ts, 170, 19)) + + // Round to an increment of a unit, e.g. an hour: + instant.round({ roundingIncrement: 60, smallestUnit: "minute" }); +>instant.round : Symbol(Temporal.Instant.round, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>instant : Symbol(instant, Decl(temporal.ts, 167, 9)) +>round : Symbol(Temporal.Instant.round, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>roundingIncrement : Symbol(roundingIncrement, Decl(temporal.ts, 172, 19)) +>smallestUnit : Symbol(smallestUnit, Decl(temporal.ts, 172, 42)) + + // => 2019-03-30T03:00:00Z + // Round to the same increment but round down instead: + instant.round({ roundingIncrement: 60, smallestUnit: "minute", roundingMode: "floor" }); +>instant.round : Symbol(Temporal.Instant.round, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>instant : Symbol(instant, Decl(temporal.ts, 167, 9)) +>round : Symbol(Temporal.Instant.round, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>roundingIncrement : Symbol(roundingIncrement, Decl(temporal.ts, 175, 19)) +>smallestUnit : Symbol(smallestUnit, Decl(temporal.ts, 175, 42)) +>roundingMode : Symbol(roundingMode, Decl(temporal.ts, 175, 66)) + + // => 2019-03-30T02:00:00Z +} + +{ + const one = Temporal.Instant.fromEpochMilliseconds(1.0e12); +>one : Symbol(one, Decl(temporal.ts, 180, 9)) +>Temporal.Instant.fromEpochMilliseconds : Symbol(Temporal.InstantConstructor.fromEpochMilliseconds, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.Instant : Symbol(Temporal.Instant, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>Instant : Symbol(Temporal.Instant, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>fromEpochMilliseconds : Symbol(Temporal.InstantConstructor.fromEpochMilliseconds, Decl(lib.esnext.temporal.d.ts, --, --)) + + const two = Temporal.Instant.fromEpochMilliseconds(1.1e12); +>two : Symbol(two, Decl(temporal.ts, 181, 9)) +>Temporal.Instant.fromEpochMilliseconds : Symbol(Temporal.InstantConstructor.fromEpochMilliseconds, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.Instant : Symbol(Temporal.Instant, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>Instant : Symbol(Temporal.Instant, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>fromEpochMilliseconds : Symbol(Temporal.InstantConstructor.fromEpochMilliseconds, Decl(lib.esnext.temporal.d.ts, --, --)) + + one.equals(two); // => false +>one.equals : Symbol(Temporal.Instant.equals, Decl(lib.esnext.temporal.d.ts, --, --)) +>one : Symbol(one, Decl(temporal.ts, 180, 9)) +>equals : Symbol(Temporal.Instant.equals, Decl(lib.esnext.temporal.d.ts, --, --)) +>two : Symbol(two, Decl(temporal.ts, 181, 9)) + + one.equals(one); // => true +>one.equals : Symbol(Temporal.Instant.equals, Decl(lib.esnext.temporal.d.ts, --, --)) +>one : Symbol(one, Decl(temporal.ts, 180, 9)) +>equals : Symbol(Temporal.Instant.equals, Decl(lib.esnext.temporal.d.ts, --, --)) +>one : Symbol(one, Decl(temporal.ts, 180, 9)) +} + +{ + const instant = Temporal.Instant.fromEpochMilliseconds(1574074321816); +>instant : Symbol(instant, Decl(temporal.ts, 187, 9)) +>Temporal.Instant.fromEpochMilliseconds : Symbol(Temporal.InstantConstructor.fromEpochMilliseconds, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.Instant : Symbol(Temporal.Instant, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>Instant : Symbol(Temporal.Instant, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>fromEpochMilliseconds : Symbol(Temporal.InstantConstructor.fromEpochMilliseconds, Decl(lib.esnext.temporal.d.ts, --, --)) + + instant.toString(); // => '2019-11-18T10:52:01.816Z' +>instant.toString : Symbol(Temporal.Instant.toString, Decl(lib.esnext.temporal.d.ts, --, --)) +>instant : Symbol(instant, Decl(temporal.ts, 187, 9)) +>toString : Symbol(Temporal.Instant.toString, Decl(lib.esnext.temporal.d.ts, --, --)) + + instant.toString({ timeZone: "UTC" }); +>instant.toString : Symbol(Temporal.Instant.toString, Decl(lib.esnext.temporal.d.ts, --, --)) +>instant : Symbol(instant, Decl(temporal.ts, 187, 9)) +>toString : Symbol(Temporal.Instant.toString, Decl(lib.esnext.temporal.d.ts, --, --)) +>timeZone : Symbol(timeZone, Decl(temporal.ts, 189, 22)) + + // => '2019-11-18T10:52:01.816+00:00' + instant.toString({ timeZone: "Asia/Seoul" }); +>instant.toString : Symbol(Temporal.Instant.toString, Decl(lib.esnext.temporal.d.ts, --, --)) +>instant : Symbol(instant, Decl(temporal.ts, 187, 9)) +>toString : Symbol(Temporal.Instant.toString, Decl(lib.esnext.temporal.d.ts, --, --)) +>timeZone : Symbol(timeZone, Decl(temporal.ts, 191, 22)) + + // => '2019-11-18T19:52:01.816+09:00' + + instant.toString({ smallestUnit: "minute" }); +>instant.toString : Symbol(Temporal.Instant.toString, Decl(lib.esnext.temporal.d.ts, --, --)) +>instant : Symbol(instant, Decl(temporal.ts, 187, 9)) +>toString : Symbol(Temporal.Instant.toString, Decl(lib.esnext.temporal.d.ts, --, --)) +>smallestUnit : Symbol(smallestUnit, Decl(temporal.ts, 194, 22)) + + // => '2019-11-18T10:52Z' + instant.toString({ fractionalSecondDigits: 0 }); +>instant.toString : Symbol(Temporal.Instant.toString, Decl(lib.esnext.temporal.d.ts, --, --)) +>instant : Symbol(instant, Decl(temporal.ts, 187, 9)) +>toString : Symbol(Temporal.Instant.toString, Decl(lib.esnext.temporal.d.ts, --, --)) +>fractionalSecondDigits : Symbol(fractionalSecondDigits, Decl(temporal.ts, 196, 22)) + + // => '2019-11-18T10:52:01Z' + instant.toString({ fractionalSecondDigits: 4 }); +>instant.toString : Symbol(Temporal.Instant.toString, Decl(lib.esnext.temporal.d.ts, --, --)) +>instant : Symbol(instant, Decl(temporal.ts, 187, 9)) +>toString : Symbol(Temporal.Instant.toString, Decl(lib.esnext.temporal.d.ts, --, --)) +>fractionalSecondDigits : Symbol(fractionalSecondDigits, Decl(temporal.ts, 198, 22)) + + // => '2019-11-18T10:52:01.8160Z' + instant.toString({ smallestUnit: "second", roundingMode: "halfExpand" }); +>instant.toString : Symbol(Temporal.Instant.toString, Decl(lib.esnext.temporal.d.ts, --, --)) +>instant : Symbol(instant, Decl(temporal.ts, 187, 9)) +>toString : Symbol(Temporal.Instant.toString, Decl(lib.esnext.temporal.d.ts, --, --)) +>smallestUnit : Symbol(smallestUnit, Decl(temporal.ts, 200, 22)) +>roundingMode : Symbol(roundingMode, Decl(temporal.ts, 200, 46)) + + // => '2019-11-18T10:52:02Z' +} + +{ + const instant = Temporal.Instant.from("2019-11-18T11:00:00.000Z"); +>instant : Symbol(instant, Decl(temporal.ts, 205, 9)) +>Temporal.Instant.from : Symbol(Temporal.InstantConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.Instant : Symbol(Temporal.Instant, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>Instant : Symbol(Temporal.Instant, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.InstantConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) + + instant.toLocaleString(); // example output: '2019-11-18, 3:00:00 a.m.' +>instant.toLocaleString : Symbol(Temporal.Instant.toLocaleString, Decl(lib.esnext.temporal.d.ts, --, --)) +>instant : Symbol(instant, Decl(temporal.ts, 205, 9)) +>toLocaleString : Symbol(Temporal.Instant.toLocaleString, Decl(lib.esnext.temporal.d.ts, --, --)) + + instant.toLocaleString("de-DE"); // example output: '18.11.2019, 03:00:00' +>instant.toLocaleString : Symbol(Temporal.Instant.toLocaleString, Decl(lib.esnext.temporal.d.ts, --, --)) +>instant : Symbol(instant, Decl(temporal.ts, 205, 9)) +>toLocaleString : Symbol(Temporal.Instant.toLocaleString, Decl(lib.esnext.temporal.d.ts, --, --)) + + instant.toLocaleString("de-DE", { +>instant.toLocaleString : Symbol(Temporal.Instant.toLocaleString, Decl(lib.esnext.temporal.d.ts, --, --)) +>instant : Symbol(instant, Decl(temporal.ts, 205, 9)) +>toLocaleString : Symbol(Temporal.Instant.toLocaleString, Decl(lib.esnext.temporal.d.ts, --, --)) + + timeZone: "Europe/Berlin", +>timeZone : Symbol(timeZone, Decl(temporal.ts, 208, 37)) + + year: "numeric", +>year : Symbol(year, Decl(temporal.ts, 209, 34)) + + month: "numeric", +>month : Symbol(month, Decl(temporal.ts, 210, 24)) + + day: "numeric", +>day : Symbol(day, Decl(temporal.ts, 211, 25)) + + hour: "numeric", +>hour : Symbol(hour, Decl(temporal.ts, 212, 23)) + + minute: "numeric", +>minute : Symbol(minute, Decl(temporal.ts, 213, 24)) + + timeZoneName: "long", +>timeZoneName : Symbol(timeZoneName, Decl(temporal.ts, 214, 26)) + + }); // => '18.11.2019, 12:00 Mitteleuropäische Normalzeit' + instant.toLocaleString("en-US-u-nu-fullwide-hc-h12", { +>instant.toLocaleString : Symbol(Temporal.Instant.toLocaleString, Decl(lib.esnext.temporal.d.ts, --, --)) +>instant : Symbol(instant, Decl(temporal.ts, 205, 9)) +>toLocaleString : Symbol(Temporal.Instant.toLocaleString, Decl(lib.esnext.temporal.d.ts, --, --)) + + timeZone: "Asia/Kolkata", +>timeZone : Symbol(timeZone, Decl(temporal.ts, 217, 58)) + + }); // => '11/18/2019, 4:30:00 PM' +} + +{ + // UNIX epoch in California + new Temporal.ZonedDateTime(0n, "America/Los_Angeles", "iso8601"); +>Temporal.ZonedDateTime : Symbol(Temporal.ZonedDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>ZonedDateTime : Symbol(Temporal.ZonedDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) + + // => 1969-12-31T16:00:00-08:00[America/Los_Angeles] + new Temporal.ZonedDateTime(0n, "America/Los_Angeles"); +>Temporal.ZonedDateTime : Symbol(Temporal.ZonedDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>ZonedDateTime : Symbol(Temporal.ZonedDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) + + // => 1969-12-31T16:00:00-08:00[America/Los_Angeles] + // same, but shorter +} + +{ + let zdt: Temporal.ZonedDateTime; +>zdt : Symbol(zdt, Decl(temporal.ts, 232, 7)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>ZonedDateTime : Symbol(Temporal.ZonedDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) + + zdt = Temporal.ZonedDateTime.from("1995-12-07T03:24:30+02:00[Africa/Cairo]"); +>zdt : Symbol(zdt, Decl(temporal.ts, 232, 7)) +>Temporal.ZonedDateTime.from : Symbol(Temporal.ZonedDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.ZonedDateTime : Symbol(Temporal.ZonedDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>ZonedDateTime : Symbol(Temporal.ZonedDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.ZonedDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) + + zdt = Temporal.ZonedDateTime.from("1995-12-07T03:24:30+02:00[Africa/Cairo][u-ca=islamic]"); +>zdt : Symbol(zdt, Decl(temporal.ts, 232, 7)) +>Temporal.ZonedDateTime.from : Symbol(Temporal.ZonedDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.ZonedDateTime : Symbol(Temporal.ZonedDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>ZonedDateTime : Symbol(Temporal.ZonedDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.ZonedDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) + + zdt = Temporal.ZonedDateTime.from("19951207T032430+0200[Africa/Cairo]"); +>zdt : Symbol(zdt, Decl(temporal.ts, 232, 7)) +>Temporal.ZonedDateTime.from : Symbol(Temporal.ZonedDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.ZonedDateTime : Symbol(Temporal.ZonedDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>ZonedDateTime : Symbol(Temporal.ZonedDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.ZonedDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) + + zdt = Temporal.ZonedDateTime.from({ +>zdt : Symbol(zdt, Decl(temporal.ts, 232, 7)) +>Temporal.ZonedDateTime.from : Symbol(Temporal.ZonedDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.ZonedDateTime : Symbol(Temporal.ZonedDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>ZonedDateTime : Symbol(Temporal.ZonedDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.ZonedDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) + + timeZone: "America/Los_Angeles", +>timeZone : Symbol(timeZone, Decl(temporal.ts, 238, 39)) + + year: 1995, +>year : Symbol(year, Decl(temporal.ts, 239, 40)) + + month: 12, +>month : Symbol(month, Decl(temporal.ts, 240, 19)) + + day: 7, +>day : Symbol(day, Decl(temporal.ts, 241, 18)) + + hour: 3, +>hour : Symbol(hour, Decl(temporal.ts, 242, 15)) + + minute: 24, +>minute : Symbol(minute, Decl(temporal.ts, 243, 16)) + + second: 30, +>second : Symbol(second, Decl(temporal.ts, 244, 19)) + + millisecond: 0, +>millisecond : Symbol(millisecond, Decl(temporal.ts, 245, 19)) + + microsecond: 3, +>microsecond : Symbol(microsecond, Decl(temporal.ts, 246, 23)) + + nanosecond: 500, +>nanosecond : Symbol(nanosecond, Decl(temporal.ts, 247, 23)) + + }); // => 1995-12-07T03:24:30.0000035-08:00[America/Los_Angeles] + + // Different overflow modes + zdt = Temporal.ZonedDateTime.from({ timeZone: "Europe/Paris", year: 2001, month: 13, day: 1 }, { overflow: "constrain" }); +>zdt : Symbol(zdt, Decl(temporal.ts, 232, 7)) +>Temporal.ZonedDateTime.from : Symbol(Temporal.ZonedDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.ZonedDateTime : Symbol(Temporal.ZonedDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>ZonedDateTime : Symbol(Temporal.ZonedDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.ZonedDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>timeZone : Symbol(timeZone, Decl(temporal.ts, 252, 39)) +>year : Symbol(year, Decl(temporal.ts, 252, 65)) +>month : Symbol(month, Decl(temporal.ts, 252, 77)) +>day : Symbol(day, Decl(temporal.ts, 252, 88)) +>overflow : Symbol(overflow, Decl(temporal.ts, 252, 100)) + + // => 2001-12-01T00:00:00+01:00[Europe/Paris] + zdt = Temporal.ZonedDateTime.from({ timeZone: "Europe/Paris", year: 2001, month: 13, day: 1 }, { overflow: "reject" }); +>zdt : Symbol(zdt, Decl(temporal.ts, 232, 7)) +>Temporal.ZonedDateTime.from : Symbol(Temporal.ZonedDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.ZonedDateTime : Symbol(Temporal.ZonedDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>ZonedDateTime : Symbol(Temporal.ZonedDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.ZonedDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>timeZone : Symbol(timeZone, Decl(temporal.ts, 254, 39)) +>year : Symbol(year, Decl(temporal.ts, 254, 65)) +>month : Symbol(month, Decl(temporal.ts, 254, 77)) +>day : Symbol(day, Decl(temporal.ts, 254, 88)) +>overflow : Symbol(overflow, Decl(temporal.ts, 254, 100)) + + // => throws RangeError +} + +{ + const arr = [ +>arr : Symbol(arr, Decl(temporal.ts, 259, 9)) + + Temporal.ZonedDateTime.from("2020-02-01T12:30-05:00[America/Toronto]"), +>Temporal.ZonedDateTime.from : Symbol(Temporal.ZonedDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.ZonedDateTime : Symbol(Temporal.ZonedDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>ZonedDateTime : Symbol(Temporal.ZonedDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.ZonedDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) + + Temporal.ZonedDateTime.from("2020-02-01T12:30-05:00[America/New_York]"), +>Temporal.ZonedDateTime.from : Symbol(Temporal.ZonedDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.ZonedDateTime : Symbol(Temporal.ZonedDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>ZonedDateTime : Symbol(Temporal.ZonedDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.ZonedDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) + + Temporal.ZonedDateTime.from("2020-02-01T12:30+01:00[Europe/Brussels]"), +>Temporal.ZonedDateTime.from : Symbol(Temporal.ZonedDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.ZonedDateTime : Symbol(Temporal.ZonedDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>ZonedDateTime : Symbol(Temporal.ZonedDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.ZonedDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) + + Temporal.ZonedDateTime.from("2020-02-01T12:30+00:00[Europe/London]"), +>Temporal.ZonedDateTime.from : Symbol(Temporal.ZonedDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.ZonedDateTime : Symbol(Temporal.ZonedDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>ZonedDateTime : Symbol(Temporal.ZonedDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.ZonedDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) + + ]; + const sorted = arr.sort(Temporal.ZonedDateTime.compare); +>sorted : Symbol(sorted, Decl(temporal.ts, 265, 9)) +>arr.sort : Symbol(Array.sort, Decl(lib.es5.d.ts, --, --)) +>arr : Symbol(arr, Decl(temporal.ts, 259, 9)) +>sort : Symbol(Array.sort, Decl(lib.es5.d.ts, --, --)) +>Temporal.ZonedDateTime.compare : Symbol(Temporal.ZonedDateTimeConstructor.compare, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.ZonedDateTime : Symbol(Temporal.ZonedDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>ZonedDateTime : Symbol(Temporal.ZonedDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>compare : Symbol(Temporal.ZonedDateTimeConstructor.compare, Decl(lib.esnext.temporal.d.ts, --, --)) + + JSON.stringify(sorted, undefined, 2); +>JSON.stringify : Symbol(JSON.stringify, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>JSON : Symbol(JSON, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) +>stringify : Symbol(JSON.stringify, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>sorted : Symbol(sorted, Decl(temporal.ts, 265, 9)) +>undefined : Symbol(undefined) + + // => + // '[ + // "2020-02-01T12:30+01:00[Europe/Brussels]", + // "2020-02-01T12:30+00:00[Europe/London]", + // "2020-02-01T12:30-05:00[America/Toronto]", + // "2020-02-01T12:30-05:00[America/New_York]" + // ]' +} + +{ + const dt = Temporal.ZonedDateTime.from("1995-12-07T03:24:30.000003500[Europe/Rome]"); +>dt : Symbol(dt, Decl(temporal.ts, 277, 9)) +>Temporal.ZonedDateTime.from : Symbol(Temporal.ZonedDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.ZonedDateTime : Symbol(Temporal.ZonedDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>ZonedDateTime : Symbol(Temporal.ZonedDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.ZonedDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) + + dt.year; // => 1995 +>dt.year : Symbol(Temporal.ZonedDateTime.year, Decl(lib.esnext.temporal.d.ts, --, --)) +>dt : Symbol(dt, Decl(temporal.ts, 277, 9)) +>year : Symbol(Temporal.ZonedDateTime.year, Decl(lib.esnext.temporal.d.ts, --, --)) + + dt.month; // => 12 +>dt.month : Symbol(Temporal.ZonedDateTime.month, Decl(lib.esnext.temporal.d.ts, --, --)) +>dt : Symbol(dt, Decl(temporal.ts, 277, 9)) +>month : Symbol(Temporal.ZonedDateTime.month, Decl(lib.esnext.temporal.d.ts, --, --)) + + dt.monthCode; // => 'M12' +>dt.monthCode : Symbol(Temporal.ZonedDateTime.monthCode, Decl(lib.esnext.temporal.d.ts, --, --)) +>dt : Symbol(dt, Decl(temporal.ts, 277, 9)) +>monthCode : Symbol(Temporal.ZonedDateTime.monthCode, Decl(lib.esnext.temporal.d.ts, --, --)) + + dt.day; // => 7 +>dt.day : Symbol(Temporal.ZonedDateTime.day, Decl(lib.esnext.temporal.d.ts, --, --)) +>dt : Symbol(dt, Decl(temporal.ts, 277, 9)) +>day : Symbol(Temporal.ZonedDateTime.day, Decl(lib.esnext.temporal.d.ts, --, --)) + + dt.hour; // => 3 +>dt.hour : Symbol(Temporal.ZonedDateTime.hour, Decl(lib.esnext.temporal.d.ts, --, --)) +>dt : Symbol(dt, Decl(temporal.ts, 277, 9)) +>hour : Symbol(Temporal.ZonedDateTime.hour, Decl(lib.esnext.temporal.d.ts, --, --)) + + dt.minute; // => 24 +>dt.minute : Symbol(Temporal.ZonedDateTime.minute, Decl(lib.esnext.temporal.d.ts, --, --)) +>dt : Symbol(dt, Decl(temporal.ts, 277, 9)) +>minute : Symbol(Temporal.ZonedDateTime.minute, Decl(lib.esnext.temporal.d.ts, --, --)) + + dt.second; // => 30 +>dt.second : Symbol(Temporal.ZonedDateTime.second, Decl(lib.esnext.temporal.d.ts, --, --)) +>dt : Symbol(dt, Decl(temporal.ts, 277, 9)) +>second : Symbol(Temporal.ZonedDateTime.second, Decl(lib.esnext.temporal.d.ts, --, --)) + + dt.millisecond; // => 0 +>dt.millisecond : Symbol(Temporal.ZonedDateTime.millisecond, Decl(lib.esnext.temporal.d.ts, --, --)) +>dt : Symbol(dt, Decl(temporal.ts, 277, 9)) +>millisecond : Symbol(Temporal.ZonedDateTime.millisecond, Decl(lib.esnext.temporal.d.ts, --, --)) + + dt.microsecond; // => 3 +>dt.microsecond : Symbol(Temporal.ZonedDateTime.microsecond, Decl(lib.esnext.temporal.d.ts, --, --)) +>dt : Symbol(dt, Decl(temporal.ts, 277, 9)) +>microsecond : Symbol(Temporal.ZonedDateTime.microsecond, Decl(lib.esnext.temporal.d.ts, --, --)) + + dt.nanosecond; // => 500 +>dt.nanosecond : Symbol(Temporal.ZonedDateTime.nanosecond, Decl(lib.esnext.temporal.d.ts, --, --)) +>dt : Symbol(dt, Decl(temporal.ts, 277, 9)) +>nanosecond : Symbol(Temporal.ZonedDateTime.nanosecond, Decl(lib.esnext.temporal.d.ts, --, --)) +} + +{ + const zdt = Temporal.ZonedDateTime.from("2020-02-01T12:30+09:00[Asia/Tokyo]"); +>zdt : Symbol(zdt, Decl(temporal.ts, 291, 9)) +>Temporal.ZonedDateTime.from : Symbol(Temporal.ZonedDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.ZonedDateTime : Symbol(Temporal.ZonedDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>ZonedDateTime : Symbol(Temporal.ZonedDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.ZonedDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) + + const epochMs = zdt.epochMilliseconds; +>epochMs : Symbol(epochMs, Decl(temporal.ts, 292, 9)) +>zdt.epochMilliseconds : Symbol(Temporal.ZonedDateTime.epochMilliseconds, Decl(lib.esnext.temporal.d.ts, --, --)) +>zdt : Symbol(zdt, Decl(temporal.ts, 291, 9)) +>epochMilliseconds : Symbol(Temporal.ZonedDateTime.epochMilliseconds, Decl(lib.esnext.temporal.d.ts, --, --)) + + // => 1580527800000 + zdt.toInstant().epochMilliseconds; +>zdt.toInstant().epochMilliseconds : Symbol(Temporal.Instant.epochMilliseconds, Decl(lib.esnext.temporal.d.ts, --, --)) +>zdt.toInstant : Symbol(Temporal.ZonedDateTime.toInstant, Decl(lib.esnext.temporal.d.ts, --, --)) +>zdt : Symbol(zdt, Decl(temporal.ts, 291, 9)) +>toInstant : Symbol(Temporal.ZonedDateTime.toInstant, Decl(lib.esnext.temporal.d.ts, --, --)) +>epochMilliseconds : Symbol(Temporal.Instant.epochMilliseconds, Decl(lib.esnext.temporal.d.ts, --, --)) + + // => 1580527800000 + const legacyDate = new Date(epochMs); +>legacyDate : Symbol(legacyDate, Decl(temporal.ts, 296, 9)) +>Date : Symbol(Date, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.esnext.date.d.ts, --, --)) +>epochMs : Symbol(epochMs, Decl(temporal.ts, 292, 9)) + + // => 2020-02-01T03:30:00.000Z + // (if the system time zone is America/Los_Angeles) + const epochNanos = zdt.epochNanoseconds; +>epochNanos : Symbol(epochNanos, Decl(temporal.ts, 299, 9)) +>zdt.epochNanoseconds : Symbol(Temporal.ZonedDateTime.epochNanoseconds, Decl(lib.esnext.temporal.d.ts, --, --)) +>zdt : Symbol(zdt, Decl(temporal.ts, 291, 9)) +>epochNanoseconds : Symbol(Temporal.ZonedDateTime.epochNanoseconds, Decl(lib.esnext.temporal.d.ts, --, --)) + + // => 1580527800000000000n + + // If you need epoch seconds data: + const epochSecs = Math.floor(zdt.epochMilliseconds / 1000); // => 1553906700 +>epochSecs : Symbol(epochSecs, Decl(temporal.ts, 303, 9)) +>Math.floor : Symbol(Math.floor, Decl(lib.es5.d.ts, --, --)) +>Math : Symbol(Math, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) +>floor : Symbol(Math.floor, Decl(lib.es5.d.ts, --, --)) +>zdt.epochMilliseconds : Symbol(Temporal.ZonedDateTime.epochMilliseconds, Decl(lib.esnext.temporal.d.ts, --, --)) +>zdt : Symbol(zdt, Decl(temporal.ts, 291, 9)) +>epochMilliseconds : Symbol(Temporal.ZonedDateTime.epochMilliseconds, Decl(lib.esnext.temporal.d.ts, --, --)) + + // => 1580527800 + + // If you need epoch microseconds data: + // (Note the extra check for correct floor rounding with bigints) + const ns = zdt.epochNanoseconds; +>ns : Symbol(ns, Decl(temporal.ts, 308, 9)) +>zdt.epochNanoseconds : Symbol(Temporal.ZonedDateTime.epochNanoseconds, Decl(lib.esnext.temporal.d.ts, --, --)) +>zdt : Symbol(zdt, Decl(temporal.ts, 291, 9)) +>epochNanoseconds : Symbol(Temporal.ZonedDateTime.epochNanoseconds, Decl(lib.esnext.temporal.d.ts, --, --)) + + const epochMicros = ns / 1000n + ((ns % 1000n) < 0n ? -1n : 0n); +>epochMicros : Symbol(epochMicros, Decl(temporal.ts, 309, 9)) +>ns : Symbol(ns, Decl(temporal.ts, 308, 9)) +>ns : Symbol(ns, Decl(temporal.ts, 308, 9)) + + // => 1580527800000000n +} + +{ + const zdt = Temporal.ZonedDateTime.from("1995-12-07T03:24-08:00[America/Los_Angeles]"); +>zdt : Symbol(zdt, Decl(temporal.ts, 314, 9)) +>Temporal.ZonedDateTime.from : Symbol(Temporal.ZonedDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.ZonedDateTime : Symbol(Temporal.ZonedDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>ZonedDateTime : Symbol(Temporal.ZonedDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.ZonedDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) + + `Time zone is: ${zdt.timeZoneId}`; +>zdt.timeZoneId : Symbol(Temporal.ZonedDateTime.timeZoneId, Decl(lib.esnext.temporal.d.ts, --, --)) +>zdt : Symbol(zdt, Decl(temporal.ts, 314, 9)) +>timeZoneId : Symbol(Temporal.ZonedDateTime.timeZoneId, Decl(lib.esnext.temporal.d.ts, --, --)) + + // => 'Time zone is: America/Los_Angeles' + zdt.withTimeZone("Asia/Kolkata").timeZoneId; +>zdt.withTimeZone("Asia/Kolkata").timeZoneId : Symbol(Temporal.ZonedDateTime.timeZoneId, Decl(lib.esnext.temporal.d.ts, --, --)) +>zdt.withTimeZone : Symbol(Temporal.ZonedDateTime.withTimeZone, Decl(lib.esnext.temporal.d.ts, --, --)) +>zdt : Symbol(zdt, Decl(temporal.ts, 314, 9)) +>withTimeZone : Symbol(Temporal.ZonedDateTime.withTimeZone, Decl(lib.esnext.temporal.d.ts, --, --)) +>timeZoneId : Symbol(Temporal.ZonedDateTime.timeZoneId, Decl(lib.esnext.temporal.d.ts, --, --)) + + // => Asia/Kolkata + zdt.withTimeZone("Asia/Calcutta").timeZoneId; +>zdt.withTimeZone("Asia/Calcutta").timeZoneId : Symbol(Temporal.ZonedDateTime.timeZoneId, Decl(lib.esnext.temporal.d.ts, --, --)) +>zdt.withTimeZone : Symbol(Temporal.ZonedDateTime.withTimeZone, Decl(lib.esnext.temporal.d.ts, --, --)) +>zdt : Symbol(zdt, Decl(temporal.ts, 314, 9)) +>withTimeZone : Symbol(Temporal.ZonedDateTime.withTimeZone, Decl(lib.esnext.temporal.d.ts, --, --)) +>timeZoneId : Symbol(Temporal.ZonedDateTime.timeZoneId, Decl(lib.esnext.temporal.d.ts, --, --)) + + // => Asia/Calcutta (does not follow links in the IANA Time Zone Database) + + zdt.withTimeZone("europe/paris").timeZoneId; +>zdt.withTimeZone("europe/paris").timeZoneId : Symbol(Temporal.ZonedDateTime.timeZoneId, Decl(lib.esnext.temporal.d.ts, --, --)) +>zdt.withTimeZone : Symbol(Temporal.ZonedDateTime.withTimeZone, Decl(lib.esnext.temporal.d.ts, --, --)) +>zdt : Symbol(zdt, Decl(temporal.ts, 314, 9)) +>withTimeZone : Symbol(Temporal.ZonedDateTime.withTimeZone, Decl(lib.esnext.temporal.d.ts, --, --)) +>timeZoneId : Symbol(Temporal.ZonedDateTime.timeZoneId, Decl(lib.esnext.temporal.d.ts, --, --)) + + // => Europe/Paris (normalized to match IANA Time Zone Database capitalization) + + zdt.withTimeZone("+05:00").timeZoneId; +>zdt.withTimeZone("+05:00").timeZoneId : Symbol(Temporal.ZonedDateTime.timeZoneId, Decl(lib.esnext.temporal.d.ts, --, --)) +>zdt.withTimeZone : Symbol(Temporal.ZonedDateTime.withTimeZone, Decl(lib.esnext.temporal.d.ts, --, --)) +>zdt : Symbol(zdt, Decl(temporal.ts, 314, 9)) +>withTimeZone : Symbol(Temporal.ZonedDateTime.withTimeZone, Decl(lib.esnext.temporal.d.ts, --, --)) +>timeZoneId : Symbol(Temporal.ZonedDateTime.timeZoneId, Decl(lib.esnext.temporal.d.ts, --, --)) + + // => +05:00 + zdt.withTimeZone("+05").timeZoneId; +>zdt.withTimeZone("+05").timeZoneId : Symbol(Temporal.ZonedDateTime.timeZoneId, Decl(lib.esnext.temporal.d.ts, --, --)) +>zdt.withTimeZone : Symbol(Temporal.ZonedDateTime.withTimeZone, Decl(lib.esnext.temporal.d.ts, --, --)) +>zdt : Symbol(zdt, Decl(temporal.ts, 314, 9)) +>withTimeZone : Symbol(Temporal.ZonedDateTime.withTimeZone, Decl(lib.esnext.temporal.d.ts, --, --)) +>timeZoneId : Symbol(Temporal.ZonedDateTime.timeZoneId, Decl(lib.esnext.temporal.d.ts, --, --)) + + // => +05:00 (normalized to ±HH:MM) + zdt.withTimeZone("+0500").timeZoneId; +>zdt.withTimeZone("+0500").timeZoneId : Symbol(Temporal.ZonedDateTime.timeZoneId, Decl(lib.esnext.temporal.d.ts, --, --)) +>zdt.withTimeZone : Symbol(Temporal.ZonedDateTime.withTimeZone, Decl(lib.esnext.temporal.d.ts, --, --)) +>zdt : Symbol(zdt, Decl(temporal.ts, 314, 9)) +>withTimeZone : Symbol(Temporal.ZonedDateTime.withTimeZone, Decl(lib.esnext.temporal.d.ts, --, --)) +>timeZoneId : Symbol(Temporal.ZonedDateTime.timeZoneId, Decl(lib.esnext.temporal.d.ts, --, --)) + + // => +05:00 (normalized to ±HH:MM) +} + +{ + const date = Temporal.ZonedDateTime.from("-000015-01-01T12:30[Europe/Rome][u-ca=gregory]"); +>date : Symbol(date, Decl(temporal.ts, 334, 9)) +>Temporal.ZonedDateTime.from : Symbol(Temporal.ZonedDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.ZonedDateTime : Symbol(Temporal.ZonedDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>ZonedDateTime : Symbol(Temporal.ZonedDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.ZonedDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) + + date.era; +>date.era : Symbol(Temporal.ZonedDateTime.era, Decl(lib.esnext.temporal.d.ts, --, --)) +>date : Symbol(date, Decl(temporal.ts, 334, 9)) +>era : Symbol(Temporal.ZonedDateTime.era, Decl(lib.esnext.temporal.d.ts, --, --)) + + // => 'bce' + date.eraYear; +>date.eraYear : Symbol(Temporal.ZonedDateTime.eraYear, Decl(lib.esnext.temporal.d.ts, --, --)) +>date : Symbol(date, Decl(temporal.ts, 334, 9)) +>eraYear : Symbol(Temporal.ZonedDateTime.eraYear, Decl(lib.esnext.temporal.d.ts, --, --)) + + // => 16 + date.year; +>date.year : Symbol(Temporal.ZonedDateTime.year, Decl(lib.esnext.temporal.d.ts, --, --)) +>date : Symbol(date, Decl(temporal.ts, 334, 9)) +>year : Symbol(Temporal.ZonedDateTime.year, Decl(lib.esnext.temporal.d.ts, --, --)) + + // => -15 +} + +{ + const zdt = Temporal.ZonedDateTime.from("1995-12-07T03:24-08:00[America/Los_Angeles]"); +>zdt : Symbol(zdt, Decl(temporal.ts, 344, 9)) +>Temporal.ZonedDateTime.from : Symbol(Temporal.ZonedDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.ZonedDateTime : Symbol(Temporal.ZonedDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>ZonedDateTime : Symbol(Temporal.ZonedDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.ZonedDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) + + ["MON", "TUE", "WED", "THU", "FRI", "SAT", "SUN"][zdt.dayOfWeek - 1]; // => 'THU' +>zdt.dayOfWeek : Symbol(Temporal.ZonedDateTime.dayOfWeek, Decl(lib.esnext.temporal.d.ts, --, --)) +>zdt : Symbol(zdt, Decl(temporal.ts, 344, 9)) +>dayOfWeek : Symbol(Temporal.ZonedDateTime.dayOfWeek, Decl(lib.esnext.temporal.d.ts, --, --)) +} + +{ + const zdt = Temporal.ZonedDateTime.from("1995-12-07T03:24-08:00[America/Los_Angeles]"); +>zdt : Symbol(zdt, Decl(temporal.ts, 349, 9)) +>Temporal.ZonedDateTime.from : Symbol(Temporal.ZonedDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.ZonedDateTime : Symbol(Temporal.ZonedDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>ZonedDateTime : Symbol(Temporal.ZonedDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.ZonedDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) + + // ISO ordinal date + console.log(zdt.year, zdt.dayOfYear); // => '1995 341' +>console.log : Symbol(Console.log, Decl(lib.dom.d.ts, --, --)) +>console : Symbol(console, Decl(lib.dom.d.ts, --, --)) +>log : Symbol(Console.log, Decl(lib.dom.d.ts, --, --)) +>zdt.year : Symbol(Temporal.ZonedDateTime.year, Decl(lib.esnext.temporal.d.ts, --, --)) +>zdt : Symbol(zdt, Decl(temporal.ts, 349, 9)) +>year : Symbol(Temporal.ZonedDateTime.year, Decl(lib.esnext.temporal.d.ts, --, --)) +>zdt.dayOfYear : Symbol(Temporal.ZonedDateTime.dayOfYear, Decl(lib.esnext.temporal.d.ts, --, --)) +>zdt : Symbol(zdt, Decl(temporal.ts, 349, 9)) +>dayOfYear : Symbol(Temporal.ZonedDateTime.dayOfYear, Decl(lib.esnext.temporal.d.ts, --, --)) +} + +{ + const zdt = Temporal.ZonedDateTime.from("2022-01-01T03:24-08:00[America/Los_Angeles]"); +>zdt : Symbol(zdt, Decl(temporal.ts, 355, 9)) +>Temporal.ZonedDateTime.from : Symbol(Temporal.ZonedDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.ZonedDateTime : Symbol(Temporal.ZonedDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>ZonedDateTime : Symbol(Temporal.ZonedDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.ZonedDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) + + // ISO week date + console.log(zdt.yearOfWeek, zdt.weekOfYear, zdt.dayOfWeek); // => '2021 52 6' +>console.log : Symbol(Console.log, Decl(lib.dom.d.ts, --, --)) +>console : Symbol(console, Decl(lib.dom.d.ts, --, --)) +>log : Symbol(Console.log, Decl(lib.dom.d.ts, --, --)) +>zdt.yearOfWeek : Symbol(Temporal.ZonedDateTime.yearOfWeek, Decl(lib.esnext.temporal.d.ts, --, --)) +>zdt : Symbol(zdt, Decl(temporal.ts, 355, 9)) +>yearOfWeek : Symbol(Temporal.ZonedDateTime.yearOfWeek, Decl(lib.esnext.temporal.d.ts, --, --)) +>zdt.weekOfYear : Symbol(Temporal.ZonedDateTime.weekOfYear, Decl(lib.esnext.temporal.d.ts, --, --)) +>zdt : Symbol(zdt, Decl(temporal.ts, 355, 9)) +>weekOfYear : Symbol(Temporal.ZonedDateTime.weekOfYear, Decl(lib.esnext.temporal.d.ts, --, --)) +>zdt.dayOfWeek : Symbol(Temporal.ZonedDateTime.dayOfWeek, Decl(lib.esnext.temporal.d.ts, --, --)) +>zdt : Symbol(zdt, Decl(temporal.ts, 355, 9)) +>dayOfWeek : Symbol(Temporal.ZonedDateTime.dayOfWeek, Decl(lib.esnext.temporal.d.ts, --, --)) +} + +{ + const zdt = Temporal.ZonedDateTime.from("1995-12-07T03:24-08:00[America/Los_Angeles]"); +>zdt : Symbol(zdt, Decl(temporal.ts, 361, 9)) +>Temporal.ZonedDateTime.from : Symbol(Temporal.ZonedDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.ZonedDateTime : Symbol(Temporal.ZonedDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>ZonedDateTime : Symbol(Temporal.ZonedDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.ZonedDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) + + zdt.daysInWeek; // => 7 +>zdt.daysInWeek : Symbol(Temporal.ZonedDateTime.daysInWeek, Decl(lib.esnext.temporal.d.ts, --, --)) +>zdt : Symbol(zdt, Decl(temporal.ts, 361, 9)) +>daysInWeek : Symbol(Temporal.ZonedDateTime.daysInWeek, Decl(lib.esnext.temporal.d.ts, --, --)) +} + +{ + // Attempt to write some mnemonic poetry + const monthsByDays: Record = {}; +>monthsByDays : Symbol(monthsByDays, Decl(temporal.ts, 367, 9)) +>Record : Symbol(Record, Decl(lib.es5.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>ZonedDateTime : Symbol(Temporal.ZonedDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) + + for (let month = 1; month <= 12; month++) { +>month : Symbol(month, Decl(temporal.ts, 368, 12)) +>month : Symbol(month, Decl(temporal.ts, 368, 12)) +>month : Symbol(month, Decl(temporal.ts, 368, 12)) + + const zdt = Temporal.Now.zonedDateTimeISO().with({ month }); +>zdt : Symbol(zdt, Decl(temporal.ts, 369, 13)) +>Temporal.Now.zonedDateTimeISO().with : Symbol(Temporal.ZonedDateTime.with, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.Now.zonedDateTimeISO : Symbol(Temporal.Now.zonedDateTimeISO, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.Now : Symbol(Temporal.Now, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>Now : Symbol(Temporal.Now, Decl(lib.esnext.temporal.d.ts, --, --)) +>zonedDateTimeISO : Symbol(Temporal.Now.zonedDateTimeISO, Decl(lib.esnext.temporal.d.ts, --, --)) +>with : Symbol(Temporal.ZonedDateTime.with, Decl(lib.esnext.temporal.d.ts, --, --)) +>month : Symbol(month, Decl(temporal.ts, 369, 58)) + + monthsByDays[zdt.daysInMonth] = (monthsByDays[zdt.daysInMonth] || []).concat(zdt); +>monthsByDays : Symbol(monthsByDays, Decl(temporal.ts, 367, 9)) +>zdt.daysInMonth : Symbol(Temporal.ZonedDateTime.daysInMonth, Decl(lib.esnext.temporal.d.ts, --, --)) +>zdt : Symbol(zdt, Decl(temporal.ts, 369, 13)) +>daysInMonth : Symbol(Temporal.ZonedDateTime.daysInMonth, Decl(lib.esnext.temporal.d.ts, --, --)) +>(monthsByDays[zdt.daysInMonth] || []).concat : Symbol(Array.concat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>monthsByDays : Symbol(monthsByDays, Decl(temporal.ts, 367, 9)) +>zdt.daysInMonth : Symbol(Temporal.ZonedDateTime.daysInMonth, Decl(lib.esnext.temporal.d.ts, --, --)) +>zdt : Symbol(zdt, Decl(temporal.ts, 369, 13)) +>daysInMonth : Symbol(Temporal.ZonedDateTime.daysInMonth, Decl(lib.esnext.temporal.d.ts, --, --)) +>concat : Symbol(Array.concat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>zdt : Symbol(zdt, Decl(temporal.ts, 369, 13)) + } + + const strings = monthsByDays[30].map(zdt => zdt.toLocaleString("en", { month: "long" })); +>strings : Symbol(strings, Decl(temporal.ts, 373, 9)) +>monthsByDays[30].map : Symbol(Array.map, Decl(lib.es5.d.ts, --, --)) +>monthsByDays : Symbol(monthsByDays, Decl(temporal.ts, 367, 9)) +>map : Symbol(Array.map, Decl(lib.es5.d.ts, --, --)) +>zdt : Symbol(zdt, Decl(temporal.ts, 373, 41)) +>zdt.toLocaleString : Symbol(Temporal.ZonedDateTime.toLocaleString, Decl(lib.esnext.temporal.d.ts, --, --)) +>zdt : Symbol(zdt, Decl(temporal.ts, 373, 41)) +>toLocaleString : Symbol(Temporal.ZonedDateTime.toLocaleString, Decl(lib.esnext.temporal.d.ts, --, --)) +>month : Symbol(month, Decl(temporal.ts, 373, 74)) + + // Shuffle to improve poem as determined empirically + strings.unshift(strings.pop()!); +>strings.unshift : Symbol(Array.unshift, Decl(lib.es5.d.ts, --, --)) +>strings : Symbol(strings, Decl(temporal.ts, 373, 9)) +>unshift : Symbol(Array.unshift, Decl(lib.es5.d.ts, --, --)) +>strings.pop : Symbol(Array.pop, Decl(lib.es5.d.ts, --, --)) +>strings : Symbol(strings, Decl(temporal.ts, 373, 9)) +>pop : Symbol(Array.pop, Decl(lib.es5.d.ts, --, --)) + + const format = new Intl.ListFormat("en"); +>format : Symbol(format, Decl(temporal.ts, 376, 9)) +>Intl.ListFormat : Symbol(Intl.ListFormat, Decl(lib.es2021.intl.d.ts, --, --), Decl(lib.es2021.intl.d.ts, --, --)) +>Intl : Symbol(Intl, Decl(lib.es5.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2020.intl.d.ts, --, --), Decl(lib.es2021.intl.d.ts, --, --), Decl(lib.es2025.intl.d.ts, --, --) ... and 1 more) +>ListFormat : Symbol(Intl.ListFormat, Decl(lib.es2021.intl.d.ts, --, --), Decl(lib.es2021.intl.d.ts, --, --)) + + const poem = `Thirty days hath ${format.format(strings)}`; +>poem : Symbol(poem, Decl(temporal.ts, 377, 9)) +>format.format : Symbol(Intl.ListFormat.format, Decl(lib.es2021.intl.d.ts, --, --)) +>format : Symbol(format, Decl(temporal.ts, 376, 9)) +>format : Symbol(Intl.ListFormat.format, Decl(lib.es2021.intl.d.ts, --, --)) +>strings : Symbol(strings, Decl(temporal.ts, 373, 9)) + + console.log(poem); +>console.log : Symbol(Console.log, Decl(lib.dom.d.ts, --, --)) +>console : Symbol(console, Decl(lib.dom.d.ts, --, --)) +>log : Symbol(Console.log, Decl(lib.dom.d.ts, --, --)) +>poem : Symbol(poem, Decl(temporal.ts, 377, 9)) +} + +{ + const zdt = Temporal.Now.zonedDateTimeISO(); +>zdt : Symbol(zdt, Decl(temporal.ts, 383, 9)) +>Temporal.Now.zonedDateTimeISO : Symbol(Temporal.Now.zonedDateTimeISO, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.Now : Symbol(Temporal.Now, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>Now : Symbol(Temporal.Now, Decl(lib.esnext.temporal.d.ts, --, --)) +>zonedDateTimeISO : Symbol(Temporal.Now.zonedDateTimeISO, Decl(lib.esnext.temporal.d.ts, --, --)) + + const percent = zdt.dayOfYear / zdt.daysInYear; +>percent : Symbol(percent, Decl(temporal.ts, 384, 9)) +>zdt.dayOfYear : Symbol(Temporal.ZonedDateTime.dayOfYear, Decl(lib.esnext.temporal.d.ts, --, --)) +>zdt : Symbol(zdt, Decl(temporal.ts, 383, 9)) +>dayOfYear : Symbol(Temporal.ZonedDateTime.dayOfYear, Decl(lib.esnext.temporal.d.ts, --, --)) +>zdt.daysInYear : Symbol(Temporal.ZonedDateTime.daysInYear, Decl(lib.esnext.temporal.d.ts, --, --)) +>zdt : Symbol(zdt, Decl(temporal.ts, 383, 9)) +>daysInYear : Symbol(Temporal.ZonedDateTime.daysInYear, Decl(lib.esnext.temporal.d.ts, --, --)) + + `The year is ${percent.toLocaleString("en", { style: "percent" })} over!`; +>percent.toLocaleString : Symbol(Number.toLocaleString, Decl(lib.es5.d.ts, --, --)) +>percent : Symbol(percent, Decl(temporal.ts, 384, 9)) +>toLocaleString : Symbol(Number.toLocaleString, Decl(lib.es5.d.ts, --, --)) +>style : Symbol(style, Decl(temporal.ts, 385, 49)) + + // example output: "The year is 10% over!" +} + +{ + const zdt = Temporal.ZonedDateTime.from("1900-01-01T12:00+09:00[Asia/Tokyo]"); +>zdt : Symbol(zdt, Decl(temporal.ts, 390, 9)) +>Temporal.ZonedDateTime.from : Symbol(Temporal.ZonedDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.ZonedDateTime : Symbol(Temporal.ZonedDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>ZonedDateTime : Symbol(Temporal.ZonedDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.ZonedDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) + + zdt.monthsInYear; // => 12 +>zdt.monthsInYear : Symbol(Temporal.ZonedDateTime.monthsInYear, Decl(lib.esnext.temporal.d.ts, --, --)) +>zdt : Symbol(zdt, Decl(temporal.ts, 390, 9)) +>monthsInYear : Symbol(Temporal.ZonedDateTime.monthsInYear, Decl(lib.esnext.temporal.d.ts, --, --)) +} + +{ + // Is this year a leap year? + const zdt = Temporal.Now.zonedDateTimeISO(); +>zdt : Symbol(zdt, Decl(temporal.ts, 396, 9)) +>Temporal.Now.zonedDateTimeISO : Symbol(Temporal.Now.zonedDateTimeISO, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.Now : Symbol(Temporal.Now, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>Now : Symbol(Temporal.Now, Decl(lib.esnext.temporal.d.ts, --, --)) +>zonedDateTimeISO : Symbol(Temporal.Now.zonedDateTimeISO, Decl(lib.esnext.temporal.d.ts, --, --)) + + zdt.inLeapYear; // example output: true +>zdt.inLeapYear : Symbol(Temporal.ZonedDateTime.inLeapYear, Decl(lib.esnext.temporal.d.ts, --, --)) +>zdt : Symbol(zdt, Decl(temporal.ts, 396, 9)) +>inLeapYear : Symbol(Temporal.ZonedDateTime.inLeapYear, Decl(lib.esnext.temporal.d.ts, --, --)) + + // Is 2100 a leap year? (no, because it's divisible by 100 and not 400) + zdt.with({ year: 2100 }).inLeapYear; // => false +>zdt.with({ year: 2100 }).inLeapYear : Symbol(Temporal.ZonedDateTime.inLeapYear, Decl(lib.esnext.temporal.d.ts, --, --)) +>zdt.with : Symbol(Temporal.ZonedDateTime.with, Decl(lib.esnext.temporal.d.ts, --, --)) +>zdt : Symbol(zdt, Decl(temporal.ts, 396, 9)) +>with : Symbol(Temporal.ZonedDateTime.with, Decl(lib.esnext.temporal.d.ts, --, --)) +>year : Symbol(year, Decl(temporal.ts, 399, 14)) +>inLeapYear : Symbol(Temporal.ZonedDateTime.inLeapYear, Decl(lib.esnext.temporal.d.ts, --, --)) +} + +{ + const zdt = Temporal.ZonedDateTime.from("2010-11-07T23:00:00-03:30[America/St_Johns]"); +>zdt : Symbol(zdt, Decl(temporal.ts, 403, 9)) +>Temporal.ZonedDateTime.from : Symbol(Temporal.ZonedDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.ZonedDateTime : Symbol(Temporal.ZonedDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>ZonedDateTime : Symbol(Temporal.ZonedDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.ZonedDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) + + zdt.hoursInDay; // 25 +>zdt.hoursInDay : Symbol(Temporal.ZonedDateTime.hoursInDay, Decl(lib.esnext.temporal.d.ts, --, --)) +>zdt : Symbol(zdt, Decl(temporal.ts, 403, 9)) +>hoursInDay : Symbol(Temporal.ZonedDateTime.hoursInDay, Decl(lib.esnext.temporal.d.ts, --, --)) +} + +{ + const zdt = Temporal.ZonedDateTime.from("2020-11-01T01:30-07:00[America/Los_Angeles]"); +>zdt : Symbol(zdt, Decl(temporal.ts, 408, 9)) +>Temporal.ZonedDateTime.from : Symbol(Temporal.ZonedDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.ZonedDateTime : Symbol(Temporal.ZonedDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>ZonedDateTime : Symbol(Temporal.ZonedDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.ZonedDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) + + zdt.offsetNanoseconds; +>zdt.offsetNanoseconds : Symbol(Temporal.ZonedDateTime.offsetNanoseconds, Decl(lib.esnext.temporal.d.ts, --, --)) +>zdt : Symbol(zdt, Decl(temporal.ts, 408, 9)) +>offsetNanoseconds : Symbol(Temporal.ZonedDateTime.offsetNanoseconds, Decl(lib.esnext.temporal.d.ts, --, --)) + + // => -25200000000000 + // (-7 * 3600 * 1e9) +} + +{ + const zdt = Temporal.ZonedDateTime.from("2020-11-01T01:30-07:00[America/Los_Angeles]"); +>zdt : Symbol(zdt, Decl(temporal.ts, 415, 9)) +>Temporal.ZonedDateTime.from : Symbol(Temporal.ZonedDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.ZonedDateTime : Symbol(Temporal.ZonedDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>ZonedDateTime : Symbol(Temporal.ZonedDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.ZonedDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) + + zdt.offset; +>zdt.offset : Symbol(Temporal.ZonedDateTime.offset, Decl(lib.esnext.temporal.d.ts, --, --)) +>zdt : Symbol(zdt, Decl(temporal.ts, 415, 9)) +>offset : Symbol(Temporal.ZonedDateTime.offset, Decl(lib.esnext.temporal.d.ts, --, --)) + + // => '-07:00' + zdt.withTimeZone("Asia/Kolkata").offset; +>zdt.withTimeZone("Asia/Kolkata").offset : Symbol(Temporal.ZonedDateTime.offset, Decl(lib.esnext.temporal.d.ts, --, --)) +>zdt.withTimeZone : Symbol(Temporal.ZonedDateTime.withTimeZone, Decl(lib.esnext.temporal.d.ts, --, --)) +>zdt : Symbol(zdt, Decl(temporal.ts, 415, 9)) +>withTimeZone : Symbol(Temporal.ZonedDateTime.withTimeZone, Decl(lib.esnext.temporal.d.ts, --, --)) +>offset : Symbol(Temporal.ZonedDateTime.offset, Decl(lib.esnext.temporal.d.ts, --, --)) + + // => '+05:30' + + const minus8Hours = "-08:00"; +>minus8Hours : Symbol(minus8Hours, Decl(temporal.ts, 421, 9)) + + const daylightTime0130 = Temporal.ZonedDateTime.from("2020-11-01T01:30-07:00[America/Los_Angeles]"); +>daylightTime0130 : Symbol(daylightTime0130, Decl(temporal.ts, 422, 9)) +>Temporal.ZonedDateTime.from : Symbol(Temporal.ZonedDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.ZonedDateTime : Symbol(Temporal.ZonedDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>ZonedDateTime : Symbol(Temporal.ZonedDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.ZonedDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) + + // => 2020-11-01T01:30:00-07:00[America/Los_Angeles] + // This is Pacific Daylight Time 1:30AM + const repeated0130 = daylightTime0130.with({ offset: minus8Hours }); +>repeated0130 : Symbol(repeated0130, Decl(temporal.ts, 425, 9)) +>daylightTime0130.with : Symbol(Temporal.ZonedDateTime.with, Decl(lib.esnext.temporal.d.ts, --, --)) +>daylightTime0130 : Symbol(daylightTime0130, Decl(temporal.ts, 422, 9)) +>with : Symbol(Temporal.ZonedDateTime.with, Decl(lib.esnext.temporal.d.ts, --, --)) +>offset : Symbol(offset, Decl(temporal.ts, 425, 48)) +>minus8Hours : Symbol(minus8Hours, Decl(temporal.ts, 421, 9)) + + // => 2020-11-01T01:30:00-08:00[America/Los_Angeles] + // This is Pacific Standard Time 1:30AM +} + +{ + const zdt = Temporal.ZonedDateTime.from("1995-12-07T03:24:00-06:00[America/Chicago]"); +>zdt : Symbol(zdt, Decl(temporal.ts, 431, 9)) +>Temporal.ZonedDateTime.from : Symbol(Temporal.ZonedDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.ZonedDateTime : Symbol(Temporal.ZonedDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>ZonedDateTime : Symbol(Temporal.ZonedDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.ZonedDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) + + zdt.with({ year: 2015, minute: 31 }); // => 2015-12-07T03:31:00-06:00[America/Chicago] +>zdt.with : Symbol(Temporal.ZonedDateTime.with, Decl(lib.esnext.temporal.d.ts, --, --)) +>zdt : Symbol(zdt, Decl(temporal.ts, 431, 9)) +>with : Symbol(Temporal.ZonedDateTime.with, Decl(lib.esnext.temporal.d.ts, --, --)) +>year : Symbol(year, Decl(temporal.ts, 432, 14)) +>minute : Symbol(minute, Decl(temporal.ts, 432, 26)) +} + +{ + const zdt = Temporal.ZonedDateTime.from("2015-12-07T03:24:30.000003500-08:00[America/Los_Angeles]"); +>zdt : Symbol(zdt, Decl(temporal.ts, 436, 9)) +>Temporal.ZonedDateTime.from : Symbol(Temporal.ZonedDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.ZonedDateTime : Symbol(Temporal.ZonedDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>ZonedDateTime : Symbol(Temporal.ZonedDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.ZonedDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) + + zdt.withPlainTime({ hour: 10 }); // => 2015-12-07T10:00:00-08:00[America/Los_Angeles] +>zdt.withPlainTime : Symbol(Temporal.ZonedDateTime.withPlainTime, Decl(lib.esnext.temporal.d.ts, --, --)) +>zdt : Symbol(zdt, Decl(temporal.ts, 436, 9)) +>withPlainTime : Symbol(Temporal.ZonedDateTime.withPlainTime, Decl(lib.esnext.temporal.d.ts, --, --)) +>hour : Symbol(hour, Decl(temporal.ts, 437, 23)) + + const time = Temporal.PlainTime.from("11:22"); +>time : Symbol(time, Decl(temporal.ts, 438, 9)) +>Temporal.PlainTime.from : Symbol(Temporal.PlainTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainTime : Symbol(Temporal.PlainTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainTime : Symbol(Temporal.PlainTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.PlainTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) + + zdt.withPlainTime(time); // => 2015-12-07T11:22:00-08:00[America/Los_Angeles] +>zdt.withPlainTime : Symbol(Temporal.ZonedDateTime.withPlainTime, Decl(lib.esnext.temporal.d.ts, --, --)) +>zdt : Symbol(zdt, Decl(temporal.ts, 436, 9)) +>withPlainTime : Symbol(Temporal.ZonedDateTime.withPlainTime, Decl(lib.esnext.temporal.d.ts, --, --)) +>time : Symbol(time, Decl(temporal.ts, 438, 9)) + + zdt.withPlainTime("12:34"); // => 2015-12-07T12:34:00-08:00[America/Los_Angeles] +>zdt.withPlainTime : Symbol(Temporal.ZonedDateTime.withPlainTime, Decl(lib.esnext.temporal.d.ts, --, --)) +>zdt : Symbol(zdt, Decl(temporal.ts, 436, 9)) +>withPlainTime : Symbol(Temporal.ZonedDateTime.withPlainTime, Decl(lib.esnext.temporal.d.ts, --, --)) + + // easier for chaining + zdt.add({ days: 2, hours: 22 }).withPlainTime("00:00"); // => 2015-12-10T00:00:00-08:00[America/Los_Angeles] +>zdt.add({ days: 2, hours: 22 }).withPlainTime : Symbol(Temporal.ZonedDateTime.withPlainTime, Decl(lib.esnext.temporal.d.ts, --, --)) +>zdt.add : Symbol(Temporal.ZonedDateTime.add, Decl(lib.esnext.temporal.d.ts, --, --)) +>zdt : Symbol(zdt, Decl(temporal.ts, 436, 9)) +>add : Symbol(Temporal.ZonedDateTime.add, Decl(lib.esnext.temporal.d.ts, --, --)) +>days : Symbol(days, Decl(temporal.ts, 443, 13)) +>hours : Symbol(hours, Decl(temporal.ts, 443, 22)) +>withPlainTime : Symbol(Temporal.ZonedDateTime.withPlainTime, Decl(lib.esnext.temporal.d.ts, --, --)) +} + +{ + const zdt = Temporal.ZonedDateTime.from("1995-12-07T03:24:30+09:00[Asia/Tokyo]"); +>zdt : Symbol(zdt, Decl(temporal.ts, 447, 9)) +>Temporal.ZonedDateTime.from : Symbol(Temporal.ZonedDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.ZonedDateTime : Symbol(Temporal.ZonedDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>ZonedDateTime : Symbol(Temporal.ZonedDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.ZonedDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) + + zdt.toString(); // => '1995-12-07T03:24:30+09:00[Asia/Tokyo]' +>zdt.toString : Symbol(Temporal.ZonedDateTime.toString, Decl(lib.esnext.temporal.d.ts, --, --)) +>zdt : Symbol(zdt, Decl(temporal.ts, 447, 9)) +>toString : Symbol(Temporal.ZonedDateTime.toString, Decl(lib.esnext.temporal.d.ts, --, --)) + + zdt.withTimeZone("Africa/Accra").toString(); // => '1995-12-06T18:24:30+00:00[Africa/Accra]' +>zdt.withTimeZone("Africa/Accra").toString : Symbol(Temporal.ZonedDateTime.toString, Decl(lib.esnext.temporal.d.ts, --, --)) +>zdt.withTimeZone : Symbol(Temporal.ZonedDateTime.withTimeZone, Decl(lib.esnext.temporal.d.ts, --, --)) +>zdt : Symbol(zdt, Decl(temporal.ts, 447, 9)) +>withTimeZone : Symbol(Temporal.ZonedDateTime.withTimeZone, Decl(lib.esnext.temporal.d.ts, --, --)) +>toString : Symbol(Temporal.ZonedDateTime.toString, Decl(lib.esnext.temporal.d.ts, --, --)) +} + +{ + const zdt = Temporal.ZonedDateTime.from("1995-12-07T03:24:30.000003500+09:00[Asia/Tokyo][u-ca=japanese]"); +>zdt : Symbol(zdt, Decl(temporal.ts, 453, 9)) +>Temporal.ZonedDateTime.from : Symbol(Temporal.ZonedDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.ZonedDateTime : Symbol(Temporal.ZonedDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>ZonedDateTime : Symbol(Temporal.ZonedDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.ZonedDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) + + `${zdt.era} ${zdt.eraYear}`; // => 'heisei 7' +>zdt.era : Symbol(Temporal.ZonedDateTime.era, Decl(lib.esnext.temporal.d.ts, --, --)) +>zdt : Symbol(zdt, Decl(temporal.ts, 453, 9)) +>era : Symbol(Temporal.ZonedDateTime.era, Decl(lib.esnext.temporal.d.ts, --, --)) +>zdt.eraYear : Symbol(Temporal.ZonedDateTime.eraYear, Decl(lib.esnext.temporal.d.ts, --, --)) +>zdt : Symbol(zdt, Decl(temporal.ts, 453, 9)) +>eraYear : Symbol(Temporal.ZonedDateTime.eraYear, Decl(lib.esnext.temporal.d.ts, --, --)) + + zdt.withCalendar("gregory").eraYear; // => 1995 +>zdt.withCalendar("gregory").eraYear : Symbol(Temporal.ZonedDateTime.eraYear, Decl(lib.esnext.temporal.d.ts, --, --)) +>zdt.withCalendar : Symbol(Temporal.ZonedDateTime.withCalendar, Decl(lib.esnext.temporal.d.ts, --, --)) +>zdt : Symbol(zdt, Decl(temporal.ts, 453, 9)) +>withCalendar : Symbol(Temporal.ZonedDateTime.withCalendar, Decl(lib.esnext.temporal.d.ts, --, --)) +>eraYear : Symbol(Temporal.ZonedDateTime.eraYear, Decl(lib.esnext.temporal.d.ts, --, --)) +} + +{ + const zdt = Temporal.ZonedDateTime.from("2020-03-08T00:00-08:00[America/Los_Angeles]"); +>zdt : Symbol(zdt, Decl(temporal.ts, 459, 9)) +>Temporal.ZonedDateTime.from : Symbol(Temporal.ZonedDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.ZonedDateTime : Symbol(Temporal.ZonedDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>ZonedDateTime : Symbol(Temporal.ZonedDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.ZonedDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) + + // Add a day to get midnight on the day after DST starts + const laterDay = zdt.add({ days: 1 }); +>laterDay : Symbol(laterDay, Decl(temporal.ts, 461, 9)) +>zdt.add : Symbol(Temporal.ZonedDateTime.add, Decl(lib.esnext.temporal.d.ts, --, --)) +>zdt : Symbol(zdt, Decl(temporal.ts, 459, 9)) +>add : Symbol(Temporal.ZonedDateTime.add, Decl(lib.esnext.temporal.d.ts, --, --)) +>days : Symbol(days, Decl(temporal.ts, 461, 30)) + + // => 2020-03-09T00:00:00-07:00[America/Los_Angeles] + // Note that the new offset is different, indicating the result is adjusted for DST. + laterDay.since(zdt, { largestUnit: "hour" }).hours; +>laterDay.since(zdt, { largestUnit: "hour" }).hours : Symbol(Temporal.Duration.hours, Decl(lib.esnext.temporal.d.ts, --, --)) +>laterDay.since : Symbol(Temporal.ZonedDateTime.since, Decl(lib.esnext.temporal.d.ts, --, --)) +>laterDay : Symbol(laterDay, Decl(temporal.ts, 461, 9)) +>since : Symbol(Temporal.ZonedDateTime.since, Decl(lib.esnext.temporal.d.ts, --, --)) +>zdt : Symbol(zdt, Decl(temporal.ts, 459, 9)) +>largestUnit : Symbol(largestUnit, Decl(temporal.ts, 464, 25)) +>hours : Symbol(Temporal.Duration.hours, Decl(lib.esnext.temporal.d.ts, --, --)) + + // => 23 + // because one clock hour lost to DST + + const laterHours = zdt.add({ hours: 24 }); +>laterHours : Symbol(laterHours, Decl(temporal.ts, 468, 9)) +>zdt.add : Symbol(Temporal.ZonedDateTime.add, Decl(lib.esnext.temporal.d.ts, --, --)) +>zdt : Symbol(zdt, Decl(temporal.ts, 459, 9)) +>add : Symbol(Temporal.ZonedDateTime.add, Decl(lib.esnext.temporal.d.ts, --, --)) +>hours : Symbol(hours, Decl(temporal.ts, 468, 32)) + + // => 2020-03-09T01:00:00-07:00[America/Los_Angeles] + // Adding time units doesn't adjust for DST. Result is 1:00AM: 24 real-world + // hours later because a clock hour was skipped by DST. + laterHours.since(zdt, { largestUnit: "hour" }).hours; // => 24 +>laterHours.since(zdt, { largestUnit: "hour" }).hours : Symbol(Temporal.Duration.hours, Decl(lib.esnext.temporal.d.ts, --, --)) +>laterHours.since : Symbol(Temporal.ZonedDateTime.since, Decl(lib.esnext.temporal.d.ts, --, --)) +>laterHours : Symbol(laterHours, Decl(temporal.ts, 468, 9)) +>since : Symbol(Temporal.ZonedDateTime.since, Decl(lib.esnext.temporal.d.ts, --, --)) +>zdt : Symbol(zdt, Decl(temporal.ts, 459, 9)) +>largestUnit : Symbol(largestUnit, Decl(temporal.ts, 472, 27)) +>hours : Symbol(Temporal.Duration.hours, Decl(lib.esnext.temporal.d.ts, --, --)) +} + +{ + const zdt = Temporal.ZonedDateTime.from("2020-03-09T00:00-07:00[America/Los_Angeles]"); +>zdt : Symbol(zdt, Decl(temporal.ts, 476, 9)) +>Temporal.ZonedDateTime.from : Symbol(Temporal.ZonedDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.ZonedDateTime : Symbol(Temporal.ZonedDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>ZonedDateTime : Symbol(Temporal.ZonedDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.ZonedDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) + + // Add a day to get midnight on the day after DST starts + const earlierDay = zdt.subtract({ days: 1 }); +>earlierDay : Symbol(earlierDay, Decl(temporal.ts, 478, 9)) +>zdt.subtract : Symbol(Temporal.ZonedDateTime.subtract, Decl(lib.esnext.temporal.d.ts, --, --)) +>zdt : Symbol(zdt, Decl(temporal.ts, 476, 9)) +>subtract : Symbol(Temporal.ZonedDateTime.subtract, Decl(lib.esnext.temporal.d.ts, --, --)) +>days : Symbol(days, Decl(temporal.ts, 478, 37)) + + // => 2020-03-08T00:00:00-08:00[America/Los_Angeles] + // Note that the new offset is different, indicating the result is adjusted for DST. + earlierDay.since(zdt, { largestUnit: "hour" }).hours; +>earlierDay.since(zdt, { largestUnit: "hour" }).hours : Symbol(Temporal.Duration.hours, Decl(lib.esnext.temporal.d.ts, --, --)) +>earlierDay.since : Symbol(Temporal.ZonedDateTime.since, Decl(lib.esnext.temporal.d.ts, --, --)) +>earlierDay : Symbol(earlierDay, Decl(temporal.ts, 478, 9)) +>since : Symbol(Temporal.ZonedDateTime.since, Decl(lib.esnext.temporal.d.ts, --, --)) +>zdt : Symbol(zdt, Decl(temporal.ts, 476, 9)) +>largestUnit : Symbol(largestUnit, Decl(temporal.ts, 481, 27)) +>hours : Symbol(Temporal.Duration.hours, Decl(lib.esnext.temporal.d.ts, --, --)) + + // => -23 + // because one clock hour lost to DST + + const earlierHours = zdt.subtract({ hours: 24 }); +>earlierHours : Symbol(earlierHours, Decl(temporal.ts, 485, 9)) +>zdt.subtract : Symbol(Temporal.ZonedDateTime.subtract, Decl(lib.esnext.temporal.d.ts, --, --)) +>zdt : Symbol(zdt, Decl(temporal.ts, 476, 9)) +>subtract : Symbol(Temporal.ZonedDateTime.subtract, Decl(lib.esnext.temporal.d.ts, --, --)) +>hours : Symbol(hours, Decl(temporal.ts, 485, 39)) + + // => 2020-03-07T23:00:00-08:00[America/Los_Angeles] + // Subtracting time units doesn't adjust for DST. Result is 11:00PM: 24 real-world + // hours earlier because a clock hour was skipped by DST. + earlierHours.since(zdt, { largestUnit: "hour" }).hours; // => -24 +>earlierHours.since(zdt, { largestUnit: "hour" }).hours : Symbol(Temporal.Duration.hours, Decl(lib.esnext.temporal.d.ts, --, --)) +>earlierHours.since : Symbol(Temporal.ZonedDateTime.since, Decl(lib.esnext.temporal.d.ts, --, --)) +>earlierHours : Symbol(earlierHours, Decl(temporal.ts, 485, 9)) +>since : Symbol(Temporal.ZonedDateTime.since, Decl(lib.esnext.temporal.d.ts, --, --)) +>zdt : Symbol(zdt, Decl(temporal.ts, 476, 9)) +>largestUnit : Symbol(largestUnit, Decl(temporal.ts, 489, 29)) +>hours : Symbol(Temporal.Duration.hours, Decl(lib.esnext.temporal.d.ts, --, --)) +} + +{ + const zdt1 = Temporal.ZonedDateTime.from("1995-12-07T03:24:30.000003500+05:30[Asia/Kolkata]"); +>zdt1 : Symbol(zdt1, Decl(temporal.ts, 493, 9)) +>Temporal.ZonedDateTime.from : Symbol(Temporal.ZonedDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.ZonedDateTime : Symbol(Temporal.ZonedDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>ZonedDateTime : Symbol(Temporal.ZonedDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.ZonedDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) + + const zdt2 = Temporal.ZonedDateTime.from("2019-01-31T15:30+05:30[Asia/Kolkata]"); +>zdt2 : Symbol(zdt2, Decl(temporal.ts, 494, 9)) +>Temporal.ZonedDateTime.from : Symbol(Temporal.ZonedDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.ZonedDateTime : Symbol(Temporal.ZonedDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>ZonedDateTime : Symbol(Temporal.ZonedDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.ZonedDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) + + zdt1.until(zdt2); +>zdt1.until : Symbol(Temporal.ZonedDateTime.until, Decl(lib.esnext.temporal.d.ts, --, --)) +>zdt1 : Symbol(zdt1, Decl(temporal.ts, 493, 9)) +>until : Symbol(Temporal.ZonedDateTime.until, Decl(lib.esnext.temporal.d.ts, --, --)) +>zdt2 : Symbol(zdt2, Decl(temporal.ts, 494, 9)) + + // => PT202956H5M29.9999965S + zdt1.until(zdt2, { largestUnit: "year" }); +>zdt1.until : Symbol(Temporal.ZonedDateTime.until, Decl(lib.esnext.temporal.d.ts, --, --)) +>zdt1 : Symbol(zdt1, Decl(temporal.ts, 493, 9)) +>until : Symbol(Temporal.ZonedDateTime.until, Decl(lib.esnext.temporal.d.ts, --, --)) +>zdt2 : Symbol(zdt2, Decl(temporal.ts, 494, 9)) +>largestUnit : Symbol(largestUnit, Decl(temporal.ts, 497, 22)) + + // => P23Y1M24DT12H5M29.9999965S + zdt2.until(zdt1, { largestUnit: "year" }); +>zdt2.until : Symbol(Temporal.ZonedDateTime.until, Decl(lib.esnext.temporal.d.ts, --, --)) +>zdt2 : Symbol(zdt2, Decl(temporal.ts, 494, 9)) +>until : Symbol(Temporal.ZonedDateTime.until, Decl(lib.esnext.temporal.d.ts, --, --)) +>zdt1 : Symbol(zdt1, Decl(temporal.ts, 493, 9)) +>largestUnit : Symbol(largestUnit, Decl(temporal.ts, 499, 22)) + + // => -P23Y1M24DT12H5M29.9999965S + zdt1.until(zdt2, { largestUnit: "nanosecond" }); +>zdt1.until : Symbol(Temporal.ZonedDateTime.until, Decl(lib.esnext.temporal.d.ts, --, --)) +>zdt1 : Symbol(zdt1, Decl(temporal.ts, 493, 9)) +>until : Symbol(Temporal.ZonedDateTime.until, Decl(lib.esnext.temporal.d.ts, --, --)) +>zdt2 : Symbol(zdt2, Decl(temporal.ts, 494, 9)) +>largestUnit : Symbol(largestUnit, Decl(temporal.ts, 501, 22)) + + // => PT730641929.999996544S + // (precision lost) + + // Rounding, for example if you don't care about sub-seconds + zdt1.until(zdt2, { smallestUnit: "second" }); +>zdt1.until : Symbol(Temporal.ZonedDateTime.until, Decl(lib.esnext.temporal.d.ts, --, --)) +>zdt1 : Symbol(zdt1, Decl(temporal.ts, 493, 9)) +>until : Symbol(Temporal.ZonedDateTime.until, Decl(lib.esnext.temporal.d.ts, --, --)) +>zdt2 : Symbol(zdt2, Decl(temporal.ts, 494, 9)) +>smallestUnit : Symbol(smallestUnit, Decl(temporal.ts, 506, 22)) + + // => PT202956H5M29S + + // Months and years can be different lengths + const [jan1, feb1, mar1] = [1, 2, 3].map(month => Temporal.ZonedDateTime.from({ year: 2020, month, day: 1, timeZone: "Asia/Seoul" })); +>jan1 : Symbol(jan1, Decl(temporal.ts, 510, 11)) +>feb1 : Symbol(feb1, Decl(temporal.ts, 510, 16)) +>mar1 : Symbol(mar1, Decl(temporal.ts, 510, 22)) +>[1, 2, 3].map : Symbol(Array.map, Decl(lib.es5.d.ts, --, --)) +>map : Symbol(Array.map, Decl(lib.es5.d.ts, --, --)) +>month : Symbol(month, Decl(temporal.ts, 510, 45)) +>Temporal.ZonedDateTime.from : Symbol(Temporal.ZonedDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.ZonedDateTime : Symbol(Temporal.ZonedDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>ZonedDateTime : Symbol(Temporal.ZonedDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.ZonedDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>year : Symbol(year, Decl(temporal.ts, 510, 83)) +>month : Symbol(month, Decl(temporal.ts, 510, 95)) +>day : Symbol(day, Decl(temporal.ts, 510, 102)) +>timeZone : Symbol(timeZone, Decl(temporal.ts, 510, 110)) + + jan1.until(feb1, { largestUnit: "day" }); // => P31D +>jan1.until : Symbol(Temporal.ZonedDateTime.until, Decl(lib.esnext.temporal.d.ts, --, --)) +>jan1 : Symbol(jan1, Decl(temporal.ts, 510, 11)) +>until : Symbol(Temporal.ZonedDateTime.until, Decl(lib.esnext.temporal.d.ts, --, --)) +>feb1 : Symbol(feb1, Decl(temporal.ts, 510, 16)) +>largestUnit : Symbol(largestUnit, Decl(temporal.ts, 511, 22)) + + jan1.until(feb1, { largestUnit: "month" }); // => P1M +>jan1.until : Symbol(Temporal.ZonedDateTime.until, Decl(lib.esnext.temporal.d.ts, --, --)) +>jan1 : Symbol(jan1, Decl(temporal.ts, 510, 11)) +>until : Symbol(Temporal.ZonedDateTime.until, Decl(lib.esnext.temporal.d.ts, --, --)) +>feb1 : Symbol(feb1, Decl(temporal.ts, 510, 16)) +>largestUnit : Symbol(largestUnit, Decl(temporal.ts, 512, 22)) + + feb1.until(mar1, { largestUnit: "day" }); // => P29D +>feb1.until : Symbol(Temporal.ZonedDateTime.until, Decl(lib.esnext.temporal.d.ts, --, --)) +>feb1 : Symbol(feb1, Decl(temporal.ts, 510, 16)) +>until : Symbol(Temporal.ZonedDateTime.until, Decl(lib.esnext.temporal.d.ts, --, --)) +>mar1 : Symbol(mar1, Decl(temporal.ts, 510, 22)) +>largestUnit : Symbol(largestUnit, Decl(temporal.ts, 513, 22)) + + feb1.until(mar1, { largestUnit: "month" }); // => P1M +>feb1.until : Symbol(Temporal.ZonedDateTime.until, Decl(lib.esnext.temporal.d.ts, --, --)) +>feb1 : Symbol(feb1, Decl(temporal.ts, 510, 16)) +>until : Symbol(Temporal.ZonedDateTime.until, Decl(lib.esnext.temporal.d.ts, --, --)) +>mar1 : Symbol(mar1, Decl(temporal.ts, 510, 22)) +>largestUnit : Symbol(largestUnit, Decl(temporal.ts, 514, 22)) + + jan1.until(mar1, { largestUnit: "day" }); // => P60D +>jan1.until : Symbol(Temporal.ZonedDateTime.until, Decl(lib.esnext.temporal.d.ts, --, --)) +>jan1 : Symbol(jan1, Decl(temporal.ts, 510, 11)) +>until : Symbol(Temporal.ZonedDateTime.until, Decl(lib.esnext.temporal.d.ts, --, --)) +>mar1 : Symbol(mar1, Decl(temporal.ts, 510, 22)) +>largestUnit : Symbol(largestUnit, Decl(temporal.ts, 515, 22)) +} + +{ + const zdt1 = Temporal.ZonedDateTime.from("1995-12-07T03:24:30.000003500+05:30[Asia/Kolkata]"); +>zdt1 : Symbol(zdt1, Decl(temporal.ts, 519, 9)) +>Temporal.ZonedDateTime.from : Symbol(Temporal.ZonedDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.ZonedDateTime : Symbol(Temporal.ZonedDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>ZonedDateTime : Symbol(Temporal.ZonedDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.ZonedDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) + + const zdt2 = Temporal.ZonedDateTime.from("2019-01-31T15:30+05:30[Asia/Kolkata]"); +>zdt2 : Symbol(zdt2, Decl(temporal.ts, 520, 9)) +>Temporal.ZonedDateTime.from : Symbol(Temporal.ZonedDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.ZonedDateTime : Symbol(Temporal.ZonedDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>ZonedDateTime : Symbol(Temporal.ZonedDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.ZonedDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) + + zdt2.since(zdt1); // => PT202956H5M29.9999965S +>zdt2.since : Symbol(Temporal.ZonedDateTime.since, Decl(lib.esnext.temporal.d.ts, --, --)) +>zdt2 : Symbol(zdt2, Decl(temporal.ts, 520, 9)) +>since : Symbol(Temporal.ZonedDateTime.since, Decl(lib.esnext.temporal.d.ts, --, --)) +>zdt1 : Symbol(zdt1, Decl(temporal.ts, 519, 9)) +} + +{ + const zdt = Temporal.ZonedDateTime.from("1995-12-07T03:24:30.000003500-08:00[America/Los_Angeles]"); +>zdt : Symbol(zdt, Decl(temporal.ts, 525, 9)) +>Temporal.ZonedDateTime.from : Symbol(Temporal.ZonedDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.ZonedDateTime : Symbol(Temporal.ZonedDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>ZonedDateTime : Symbol(Temporal.ZonedDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.ZonedDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) + + // Round to a particular unit + zdt.round({ smallestUnit: "hour" }); +>zdt.round : Symbol(Temporal.ZonedDateTime.round, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>zdt : Symbol(zdt, Decl(temporal.ts, 525, 9)) +>round : Symbol(Temporal.ZonedDateTime.round, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>smallestUnit : Symbol(smallestUnit, Decl(temporal.ts, 528, 15)) + + // => 1995-12-07T03:00:00-08:00[America/Los_Angeles] + // Round to an increment of a unit, e.g. half an hour: + zdt.round({ roundingIncrement: 30, smallestUnit: "minute" }); +>zdt.round : Symbol(Temporal.ZonedDateTime.round, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>zdt : Symbol(zdt, Decl(temporal.ts, 525, 9)) +>round : Symbol(Temporal.ZonedDateTime.round, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>roundingIncrement : Symbol(roundingIncrement, Decl(temporal.ts, 531, 15)) +>smallestUnit : Symbol(smallestUnit, Decl(temporal.ts, 531, 38)) + + // => 1995-12-07T03:30:00-08:00[America/Los_Angeles] + // Round to the same increment but round down instead: + zdt.round({ roundingIncrement: 30, smallestUnit: "minute", roundingMode: "floor" }); +>zdt.round : Symbol(Temporal.ZonedDateTime.round, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>zdt : Symbol(zdt, Decl(temporal.ts, 525, 9)) +>round : Symbol(Temporal.ZonedDateTime.round, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>roundingIncrement : Symbol(roundingIncrement, Decl(temporal.ts, 534, 15)) +>smallestUnit : Symbol(smallestUnit, Decl(temporal.ts, 534, 38)) +>roundingMode : Symbol(roundingMode, Decl(temporal.ts, 534, 62)) + + // => 1995-12-07T03:00:00-08:00[America/Los_Angeles] +} + +{ + const zdt = Temporal.ZonedDateTime.from("2015-10-18T12:00-02:00[America/Sao_Paulo]"); +>zdt : Symbol(zdt, Decl(temporal.ts, 539, 9)) +>Temporal.ZonedDateTime.from : Symbol(Temporal.ZonedDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.ZonedDateTime : Symbol(Temporal.ZonedDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>ZonedDateTime : Symbol(Temporal.ZonedDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.ZonedDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) + + zdt.startOfDay(); // => 2015-10-18T01:00:00-02:00[America/Sao_Paulo] +>zdt.startOfDay : Symbol(Temporal.ZonedDateTime.startOfDay, Decl(lib.esnext.temporal.d.ts, --, --)) +>zdt : Symbol(zdt, Decl(temporal.ts, 539, 9)) +>startOfDay : Symbol(Temporal.ZonedDateTime.startOfDay, Decl(lib.esnext.temporal.d.ts, --, --)) +} + +{ + let duration: Temporal.Duration; +>duration : Symbol(duration, Decl(temporal.ts, 544, 7)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>Duration : Symbol(Temporal.Duration, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) + + // How long until the next offset change from now, in the current location? + const tz = Temporal.Now.timeZoneId(); +>tz : Symbol(tz, Decl(temporal.ts, 546, 9)) +>Temporal.Now.timeZoneId : Symbol(Temporal.Now.timeZoneId, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.Now : Symbol(Temporal.Now, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>Now : Symbol(Temporal.Now, Decl(lib.esnext.temporal.d.ts, --, --)) +>timeZoneId : Symbol(Temporal.Now.timeZoneId, Decl(lib.esnext.temporal.d.ts, --, --)) + + const now = Temporal.Now.zonedDateTimeISO(tz); +>now : Symbol(now, Decl(temporal.ts, 547, 9)) +>Temporal.Now.zonedDateTimeISO : Symbol(Temporal.Now.zonedDateTimeISO, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.Now : Symbol(Temporal.Now, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>Now : Symbol(Temporal.Now, Decl(lib.esnext.temporal.d.ts, --, --)) +>zonedDateTimeISO : Symbol(Temporal.Now.zonedDateTimeISO, Decl(lib.esnext.temporal.d.ts, --, --)) +>tz : Symbol(tz, Decl(temporal.ts, 546, 9)) + + const nextTransition = now.getTimeZoneTransition("next"); +>nextTransition : Symbol(nextTransition, Decl(temporal.ts, 548, 9)) +>now.getTimeZoneTransition : Symbol(Temporal.ZonedDateTime.getTimeZoneTransition, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>now : Symbol(now, Decl(temporal.ts, 547, 9)) +>getTimeZoneTransition : Symbol(Temporal.ZonedDateTime.getTimeZoneTransition, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) + + duration = nextTransition!.since(now); +>duration : Symbol(duration, Decl(temporal.ts, 544, 7)) +>nextTransition!.since : Symbol(Temporal.ZonedDateTime.since, Decl(lib.esnext.temporal.d.ts, --, --)) +>nextTransition : Symbol(nextTransition, Decl(temporal.ts, 548, 9)) +>since : Symbol(Temporal.ZonedDateTime.since, Decl(lib.esnext.temporal.d.ts, --, --)) +>now : Symbol(now, Decl(temporal.ts, 547, 9)) + + duration.toLocaleString(); // output will vary +>duration.toLocaleString : Symbol(Temporal.Duration.toLocaleString, Decl(lib.esnext.temporal.d.ts, --, --)) +>duration : Symbol(duration, Decl(temporal.ts, 544, 7)) +>toLocaleString : Symbol(Temporal.Duration.toLocaleString, Decl(lib.esnext.temporal.d.ts, --, --)) + + // How long until the previous offset change from now, in the current location? + const previousTransition = now.getTimeZoneTransition("previous"); +>previousTransition : Symbol(previousTransition, Decl(temporal.ts, 553, 9)) +>now.getTimeZoneTransition : Symbol(Temporal.ZonedDateTime.getTimeZoneTransition, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>now : Symbol(now, Decl(temporal.ts, 547, 9)) +>getTimeZoneTransition : Symbol(Temporal.ZonedDateTime.getTimeZoneTransition, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) + + duration = now.since(previousTransition!); +>duration : Symbol(duration, Decl(temporal.ts, 544, 7)) +>now.since : Symbol(Temporal.ZonedDateTime.since, Decl(lib.esnext.temporal.d.ts, --, --)) +>now : Symbol(now, Decl(temporal.ts, 547, 9)) +>since : Symbol(Temporal.ZonedDateTime.since, Decl(lib.esnext.temporal.d.ts, --, --)) +>previousTransition : Symbol(previousTransition, Decl(temporal.ts, 553, 9)) + + duration.toLocaleString(); // output will vary +>duration.toLocaleString : Symbol(Temporal.Duration.toLocaleString, Decl(lib.esnext.temporal.d.ts, --, --)) +>duration : Symbol(duration, Decl(temporal.ts, 544, 7)) +>toLocaleString : Symbol(Temporal.Duration.toLocaleString, Decl(lib.esnext.temporal.d.ts, --, --)) +} + +{ + const zdt1 = Temporal.ZonedDateTime.from("1995-12-07T03:24:30.000003500+01:00[Europe/Paris]"); +>zdt1 : Symbol(zdt1, Decl(temporal.ts, 559, 9)) +>Temporal.ZonedDateTime.from : Symbol(Temporal.ZonedDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.ZonedDateTime : Symbol(Temporal.ZonedDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>ZonedDateTime : Symbol(Temporal.ZonedDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.ZonedDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) + + const zdt2 = Temporal.ZonedDateTime.from("1995-12-07T03:24:30.000003500+01:00[Europe/Brussels]"); +>zdt2 : Symbol(zdt2, Decl(temporal.ts, 560, 9)) +>Temporal.ZonedDateTime.from : Symbol(Temporal.ZonedDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.ZonedDateTime : Symbol(Temporal.ZonedDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>ZonedDateTime : Symbol(Temporal.ZonedDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.ZonedDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) + + zdt1.equals(zdt2); // => false (same offset but different time zones) +>zdt1.equals : Symbol(Temporal.ZonedDateTime.equals, Decl(lib.esnext.temporal.d.ts, --, --)) +>zdt1 : Symbol(zdt1, Decl(temporal.ts, 559, 9)) +>equals : Symbol(Temporal.ZonedDateTime.equals, Decl(lib.esnext.temporal.d.ts, --, --)) +>zdt2 : Symbol(zdt2, Decl(temporal.ts, 560, 9)) + + zdt1.equals(zdt1); // => true +>zdt1.equals : Symbol(Temporal.ZonedDateTime.equals, Decl(lib.esnext.temporal.d.ts, --, --)) +>zdt1 : Symbol(zdt1, Decl(temporal.ts, 559, 9)) +>equals : Symbol(Temporal.ZonedDateTime.equals, Decl(lib.esnext.temporal.d.ts, --, --)) +>zdt1 : Symbol(zdt1, Decl(temporal.ts, 559, 9)) + + // To compare time zone IDs, use withTimeZone() with each ID on the same + // ZonedDateTime instance, and use equals() to compare + const kolkata = zdt1.withTimeZone("Asia/Kolkata"); +>kolkata : Symbol(kolkata, Decl(temporal.ts, 566, 9)) +>zdt1.withTimeZone : Symbol(Temporal.ZonedDateTime.withTimeZone, Decl(lib.esnext.temporal.d.ts, --, --)) +>zdt1 : Symbol(zdt1, Decl(temporal.ts, 559, 9)) +>withTimeZone : Symbol(Temporal.ZonedDateTime.withTimeZone, Decl(lib.esnext.temporal.d.ts, --, --)) + + kolkata.equals(zdt1.withTimeZone("Asia/Calcutta")); // => true +>kolkata.equals : Symbol(Temporal.ZonedDateTime.equals, Decl(lib.esnext.temporal.d.ts, --, --)) +>kolkata : Symbol(kolkata, Decl(temporal.ts, 566, 9)) +>equals : Symbol(Temporal.ZonedDateTime.equals, Decl(lib.esnext.temporal.d.ts, --, --)) +>zdt1.withTimeZone : Symbol(Temporal.ZonedDateTime.withTimeZone, Decl(lib.esnext.temporal.d.ts, --, --)) +>zdt1 : Symbol(zdt1, Decl(temporal.ts, 559, 9)) +>withTimeZone : Symbol(Temporal.ZonedDateTime.withTimeZone, Decl(lib.esnext.temporal.d.ts, --, --)) + + // Offset time zones are never equivalent to named time zones + kolkata.equals(zdt1.withTimeZone("+05:30")); // => false +>kolkata.equals : Symbol(Temporal.ZonedDateTime.equals, Decl(lib.esnext.temporal.d.ts, --, --)) +>kolkata : Symbol(kolkata, Decl(temporal.ts, 566, 9)) +>equals : Symbol(Temporal.ZonedDateTime.equals, Decl(lib.esnext.temporal.d.ts, --, --)) +>zdt1.withTimeZone : Symbol(Temporal.ZonedDateTime.withTimeZone, Decl(lib.esnext.temporal.d.ts, --, --)) +>zdt1 : Symbol(zdt1, Decl(temporal.ts, 559, 9)) +>withTimeZone : Symbol(Temporal.ZonedDateTime.withTimeZone, Decl(lib.esnext.temporal.d.ts, --, --)) + + const zeroOffset = zdt1.withTimeZone("+00:00"); +>zeroOffset : Symbol(zeroOffset, Decl(temporal.ts, 571, 9)) +>zdt1.withTimeZone : Symbol(Temporal.ZonedDateTime.withTimeZone, Decl(lib.esnext.temporal.d.ts, --, --)) +>zdt1 : Symbol(zdt1, Decl(temporal.ts, 559, 9)) +>withTimeZone : Symbol(Temporal.ZonedDateTime.withTimeZone, Decl(lib.esnext.temporal.d.ts, --, --)) + + zeroOffset.equals(zdt1.withTimeZone("UTC")); // => false +>zeroOffset.equals : Symbol(Temporal.ZonedDateTime.equals, Decl(lib.esnext.temporal.d.ts, --, --)) +>zeroOffset : Symbol(zeroOffset, Decl(temporal.ts, 571, 9)) +>equals : Symbol(Temporal.ZonedDateTime.equals, Decl(lib.esnext.temporal.d.ts, --, --)) +>zdt1.withTimeZone : Symbol(Temporal.ZonedDateTime.withTimeZone, Decl(lib.esnext.temporal.d.ts, --, --)) +>zdt1 : Symbol(zdt1, Decl(temporal.ts, 559, 9)) +>withTimeZone : Symbol(Temporal.ZonedDateTime.withTimeZone, Decl(lib.esnext.temporal.d.ts, --, --)) + + // For offset time zones, any valid format is accepted + zeroOffset.equals(zdt1.withTimeZone("+00:00")); // => true +>zeroOffset.equals : Symbol(Temporal.ZonedDateTime.equals, Decl(lib.esnext.temporal.d.ts, --, --)) +>zeroOffset : Symbol(zeroOffset, Decl(temporal.ts, 571, 9)) +>equals : Symbol(Temporal.ZonedDateTime.equals, Decl(lib.esnext.temporal.d.ts, --, --)) +>zdt1.withTimeZone : Symbol(Temporal.ZonedDateTime.withTimeZone, Decl(lib.esnext.temporal.d.ts, --, --)) +>zdt1 : Symbol(zdt1, Decl(temporal.ts, 559, 9)) +>withTimeZone : Symbol(Temporal.ZonedDateTime.withTimeZone, Decl(lib.esnext.temporal.d.ts, --, --)) + + zeroOffset.equals(zdt1.withTimeZone("+0000")); // => true +>zeroOffset.equals : Symbol(Temporal.ZonedDateTime.equals, Decl(lib.esnext.temporal.d.ts, --, --)) +>zeroOffset : Symbol(zeroOffset, Decl(temporal.ts, 571, 9)) +>equals : Symbol(Temporal.ZonedDateTime.equals, Decl(lib.esnext.temporal.d.ts, --, --)) +>zdt1.withTimeZone : Symbol(Temporal.ZonedDateTime.withTimeZone, Decl(lib.esnext.temporal.d.ts, --, --)) +>zdt1 : Symbol(zdt1, Decl(temporal.ts, 559, 9)) +>withTimeZone : Symbol(Temporal.ZonedDateTime.withTimeZone, Decl(lib.esnext.temporal.d.ts, --, --)) + + zeroOffset.equals(zdt1.withTimeZone("+00")); // => true +>zeroOffset.equals : Symbol(Temporal.ZonedDateTime.equals, Decl(lib.esnext.temporal.d.ts, --, --)) +>zeroOffset : Symbol(zeroOffset, Decl(temporal.ts, 571, 9)) +>equals : Symbol(Temporal.ZonedDateTime.equals, Decl(lib.esnext.temporal.d.ts, --, --)) +>zdt1.withTimeZone : Symbol(Temporal.ZonedDateTime.withTimeZone, Decl(lib.esnext.temporal.d.ts, --, --)) +>zdt1 : Symbol(zdt1, Decl(temporal.ts, 559, 9)) +>withTimeZone : Symbol(Temporal.ZonedDateTime.withTimeZone, Decl(lib.esnext.temporal.d.ts, --, --)) +} + +{ + let zdt: Temporal.ZonedDateTime; +>zdt : Symbol(zdt, Decl(temporal.ts, 581, 7)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>ZonedDateTime : Symbol(Temporal.ZonedDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) + + zdt = Temporal.ZonedDateTime.from({ year: 2019, month: 12, day: 1, hour: 12, timeZone: "Africa/Lagos" }); +>zdt : Symbol(zdt, Decl(temporal.ts, 581, 7)) +>Temporal.ZonedDateTime.from : Symbol(Temporal.ZonedDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.ZonedDateTime : Symbol(Temporal.ZonedDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>ZonedDateTime : Symbol(Temporal.ZonedDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.ZonedDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>year : Symbol(year, Decl(temporal.ts, 582, 39)) +>month : Symbol(month, Decl(temporal.ts, 582, 51)) +>day : Symbol(day, Decl(temporal.ts, 582, 62)) +>hour : Symbol(hour, Decl(temporal.ts, 582, 70)) +>timeZone : Symbol(timeZone, Decl(temporal.ts, 582, 80)) + + zdt.toString(); // => '2019-12-01T12:00:00+01:00[Africa/Lagos]' +>zdt.toString : Symbol(Temporal.ZonedDateTime.toString, Decl(lib.esnext.temporal.d.ts, --, --)) +>zdt : Symbol(zdt, Decl(temporal.ts, 581, 7)) +>toString : Symbol(Temporal.ZonedDateTime.toString, Decl(lib.esnext.temporal.d.ts, --, --)) + + zdt = zdt.withCalendar("japanese"); +>zdt : Symbol(zdt, Decl(temporal.ts, 581, 7)) +>zdt.withCalendar : Symbol(Temporal.ZonedDateTime.withCalendar, Decl(lib.esnext.temporal.d.ts, --, --)) +>zdt : Symbol(zdt, Decl(temporal.ts, 581, 7)) +>withCalendar : Symbol(Temporal.ZonedDateTime.withCalendar, Decl(lib.esnext.temporal.d.ts, --, --)) + + zdt.toString(); // => '2019-12-01T12:00:00+01:00[Africa/Lagos][u-ca=japanese]' +>zdt.toString : Symbol(Temporal.ZonedDateTime.toString, Decl(lib.esnext.temporal.d.ts, --, --)) +>zdt : Symbol(zdt, Decl(temporal.ts, 581, 7)) +>toString : Symbol(Temporal.ZonedDateTime.toString, Decl(lib.esnext.temporal.d.ts, --, --)) +} + +{ + const zdt = Temporal.ZonedDateTime.from("2019-12-01T12:00+01:00[Europe/Berlin]"); +>zdt : Symbol(zdt, Decl(temporal.ts, 589, 9)) +>Temporal.ZonedDateTime.from : Symbol(Temporal.ZonedDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.ZonedDateTime : Symbol(Temporal.ZonedDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>ZonedDateTime : Symbol(Temporal.ZonedDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.ZonedDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) + + zdt.toLocaleString(); // example output: 12/1/2019, 12:00:00 PM +>zdt.toLocaleString : Symbol(Temporal.ZonedDateTime.toLocaleString, Decl(lib.esnext.temporal.d.ts, --, --)) +>zdt : Symbol(zdt, Decl(temporal.ts, 589, 9)) +>toLocaleString : Symbol(Temporal.ZonedDateTime.toLocaleString, Decl(lib.esnext.temporal.d.ts, --, --)) + + zdt.toLocaleString("de-DE"); // => '1.12.2019, 12:00:00 MEZ' +>zdt.toLocaleString : Symbol(Temporal.ZonedDateTime.toLocaleString, Decl(lib.esnext.temporal.d.ts, --, --)) +>zdt : Symbol(zdt, Decl(temporal.ts, 589, 9)) +>toLocaleString : Symbol(Temporal.ZonedDateTime.toLocaleString, Decl(lib.esnext.temporal.d.ts, --, --)) + + const options = { weekday: "long", year: "numeric", month: "long", day: "numeric" } as const; +>options : Symbol(options, Decl(temporal.ts, 592, 9)) +>weekday : Symbol(weekday, Decl(temporal.ts, 592, 21)) +>year : Symbol(year, Decl(temporal.ts, 592, 38)) +>month : Symbol(month, Decl(temporal.ts, 592, 55)) +>day : Symbol(day, Decl(temporal.ts, 592, 70)) +>const : Symbol(const) + + zdt.toLocaleString("de-DE", options); // => 'Sonntag, 1. Dezember 2019' +>zdt.toLocaleString : Symbol(Temporal.ZonedDateTime.toLocaleString, Decl(lib.esnext.temporal.d.ts, --, --)) +>zdt : Symbol(zdt, Decl(temporal.ts, 589, 9)) +>toLocaleString : Symbol(Temporal.ZonedDateTime.toLocaleString, Decl(lib.esnext.temporal.d.ts, --, --)) +>options : Symbol(options, Decl(temporal.ts, 592, 9)) + + /* WRONG */ zdt.toLocaleString("de-DE", { timeZone: "Pacific/Auckland" }); +>zdt.toLocaleString : Symbol(Temporal.ZonedDateTime.toLocaleString, Decl(lib.esnext.temporal.d.ts, --, --)) +>zdt : Symbol(zdt, Decl(temporal.ts, 589, 9)) +>toLocaleString : Symbol(Temporal.ZonedDateTime.toLocaleString, Decl(lib.esnext.temporal.d.ts, --, --)) +>timeZone : Symbol(timeZone, Decl(temporal.ts, 594, 45)) + + // => RangeError: Time zone option Pacific/Auckland does not match actual time zone Europe/Berlin + zdt.withTimeZone("Pacific/Auckland").toLocaleString("de-DE"); // => '2.12.2019, 0:00:00 GMT+13' +>zdt.withTimeZone("Pacific/Auckland").toLocaleString : Symbol(Temporal.ZonedDateTime.toLocaleString, Decl(lib.esnext.temporal.d.ts, --, --)) +>zdt.withTimeZone : Symbol(Temporal.ZonedDateTime.withTimeZone, Decl(lib.esnext.temporal.d.ts, --, --)) +>zdt : Symbol(zdt, Decl(temporal.ts, 589, 9)) +>withTimeZone : Symbol(Temporal.ZonedDateTime.withTimeZone, Decl(lib.esnext.temporal.d.ts, --, --)) +>toLocaleString : Symbol(Temporal.ZonedDateTime.toLocaleString, Decl(lib.esnext.temporal.d.ts, --, --)) + + zdt.toLocaleString("en-US-u-nu-fullwide-hc-h12"); // => '12/1/2019, 12:00:00 PM GMT+1' +>zdt.toLocaleString : Symbol(Temporal.ZonedDateTime.toLocaleString, Decl(lib.esnext.temporal.d.ts, --, --)) +>zdt : Symbol(zdt, Decl(temporal.ts, 589, 9)) +>toLocaleString : Symbol(Temporal.ZonedDateTime.toLocaleString, Decl(lib.esnext.temporal.d.ts, --, --)) +} + +{ + const zdt = Temporal.ZonedDateTime.from("1995-12-07T03:24:30+02:00[Africa/Johannesburg]"); +>zdt : Symbol(zdt, Decl(temporal.ts, 601, 9)) +>Temporal.ZonedDateTime.from : Symbol(Temporal.ZonedDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.ZonedDateTime : Symbol(Temporal.ZonedDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>ZonedDateTime : Symbol(Temporal.ZonedDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.ZonedDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) + + zdt.toInstant(); // => 1995-12-07T01:24:30Z +>zdt.toInstant : Symbol(Temporal.ZonedDateTime.toInstant, Decl(lib.esnext.temporal.d.ts, --, --)) +>zdt : Symbol(zdt, Decl(temporal.ts, 601, 9)) +>toInstant : Symbol(Temporal.ZonedDateTime.toInstant, Decl(lib.esnext.temporal.d.ts, --, --)) + + zdt.toPlainDateTime(); // => 1995-12-07T03:24:30 +>zdt.toPlainDateTime : Symbol(Temporal.ZonedDateTime.toPlainDateTime, Decl(lib.esnext.temporal.d.ts, --, --)) +>zdt : Symbol(zdt, Decl(temporal.ts, 601, 9)) +>toPlainDateTime : Symbol(Temporal.ZonedDateTime.toPlainDateTime, Decl(lib.esnext.temporal.d.ts, --, --)) + + zdt.toPlainDate(); // => 1995-12-07 +>zdt.toPlainDate : Symbol(Temporal.ZonedDateTime.toPlainDate, Decl(lib.esnext.temporal.d.ts, --, --)) +>zdt : Symbol(zdt, Decl(temporal.ts, 601, 9)) +>toPlainDate : Symbol(Temporal.ZonedDateTime.toPlainDate, Decl(lib.esnext.temporal.d.ts, --, --)) + + zdt.toPlainTime(); // => 03:24:30 +>zdt.toPlainTime : Symbol(Temporal.ZonedDateTime.toPlainTime, Decl(lib.esnext.temporal.d.ts, --, --)) +>zdt : Symbol(zdt, Decl(temporal.ts, 601, 9)) +>toPlainTime : Symbol(Temporal.ZonedDateTime.toPlainTime, Decl(lib.esnext.temporal.d.ts, --, --)) + + zdt.toPlainDate().toPlainYearMonth(); // => 1995-12 +>zdt.toPlainDate().toPlainYearMonth : Symbol(Temporal.PlainDate.toPlainYearMonth, Decl(lib.esnext.temporal.d.ts, --, --)) +>zdt.toPlainDate : Symbol(Temporal.ZonedDateTime.toPlainDate, Decl(lib.esnext.temporal.d.ts, --, --)) +>zdt : Symbol(zdt, Decl(temporal.ts, 601, 9)) +>toPlainDate : Symbol(Temporal.ZonedDateTime.toPlainDate, Decl(lib.esnext.temporal.d.ts, --, --)) +>toPlainYearMonth : Symbol(Temporal.PlainDate.toPlainYearMonth, Decl(lib.esnext.temporal.d.ts, --, --)) + + zdt.toPlainDate().toPlainMonthDay(); // => 12-07 +>zdt.toPlainDate().toPlainMonthDay : Symbol(Temporal.PlainDate.toPlainMonthDay, Decl(lib.esnext.temporal.d.ts, --, --)) +>zdt.toPlainDate : Symbol(Temporal.ZonedDateTime.toPlainDate, Decl(lib.esnext.temporal.d.ts, --, --)) +>zdt : Symbol(zdt, Decl(temporal.ts, 601, 9)) +>toPlainDate : Symbol(Temporal.ZonedDateTime.toPlainDate, Decl(lib.esnext.temporal.d.ts, --, --)) +>toPlainMonthDay : Symbol(Temporal.PlainDate.toPlainMonthDay, Decl(lib.esnext.temporal.d.ts, --, --)) +} + +{ + // Pi day in 2020 + const date = new Temporal.PlainDate(2020, 3, 14); // => 2020-03-14 +>date : Symbol(date, Decl(temporal.ts, 612, 9)) +>Temporal.PlainDate : Symbol(Temporal.PlainDate, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainDate : Symbol(Temporal.PlainDate, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +} + +{ + let date: Temporal.PlainDate; +>date : Symbol(date, Decl(temporal.ts, 616, 7)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainDate : Symbol(Temporal.PlainDate, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) + + date = Temporal.PlainDate.from("2006-08-24"); // => 2006-08-24 +>date : Symbol(date, Decl(temporal.ts, 616, 7)) +>Temporal.PlainDate.from : Symbol(Temporal.PlainDateConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainDate : Symbol(Temporal.PlainDate, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainDate : Symbol(Temporal.PlainDate, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.PlainDateConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) + + date = Temporal.PlainDate.from("20060824"); // => 2006-08-24 +>date : Symbol(date, Decl(temporal.ts, 616, 7)) +>Temporal.PlainDate.from : Symbol(Temporal.PlainDateConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainDate : Symbol(Temporal.PlainDate, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainDate : Symbol(Temporal.PlainDate, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.PlainDateConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) + + date = Temporal.PlainDate.from("2006-08-24T15:43:27"); // => 2006-08-24 +>date : Symbol(date, Decl(temporal.ts, 616, 7)) +>Temporal.PlainDate.from : Symbol(Temporal.PlainDateConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainDate : Symbol(Temporal.PlainDate, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainDate : Symbol(Temporal.PlainDate, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.PlainDateConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) + + date = Temporal.PlainDate.from("2006-08-24T15:43:27+01:00[Europe/Brussels]"); +>date : Symbol(date, Decl(temporal.ts, 616, 7)) +>Temporal.PlainDate.from : Symbol(Temporal.PlainDateConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainDate : Symbol(Temporal.PlainDate, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainDate : Symbol(Temporal.PlainDate, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.PlainDateConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) + + // => 2006-08-24 + date === Temporal.PlainDate.from(date); // => false +>date : Symbol(date, Decl(temporal.ts, 616, 7)) +>Temporal.PlainDate.from : Symbol(Temporal.PlainDateConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainDate : Symbol(Temporal.PlainDate, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainDate : Symbol(Temporal.PlainDate, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.PlainDateConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>date : Symbol(date, Decl(temporal.ts, 616, 7)) + + date = Temporal.PlainDate.from({ year: 2006, month: 8, day: 24 }); // => 2006-08-24 +>date : Symbol(date, Decl(temporal.ts, 616, 7)) +>Temporal.PlainDate.from : Symbol(Temporal.PlainDateConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainDate : Symbol(Temporal.PlainDate, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainDate : Symbol(Temporal.PlainDate, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.PlainDateConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>year : Symbol(year, Decl(temporal.ts, 625, 36)) +>month : Symbol(month, Decl(temporal.ts, 625, 48)) +>day : Symbol(day, Decl(temporal.ts, 625, 58)) + + date = Temporal.PlainDate.from(Temporal.PlainDateTime.from("2006-08-24T15:43:27")); +>date : Symbol(date, Decl(temporal.ts, 616, 7)) +>Temporal.PlainDate.from : Symbol(Temporal.PlainDateConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainDate : Symbol(Temporal.PlainDate, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainDate : Symbol(Temporal.PlainDate, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.PlainDateConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainDateTime.from : Symbol(Temporal.PlainDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainDateTime : Symbol(Temporal.PlainDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainDateTime : Symbol(Temporal.PlainDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.PlainDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) + + // => 2006-08-24 + // same as above; Temporal.PlainDateTime has year, month, and day properties + + date = Temporal.PlainDate.from({ year: 1427, month: 8, day: 1, calendar: "islamic" }); +>date : Symbol(date, Decl(temporal.ts, 616, 7)) +>Temporal.PlainDate.from : Symbol(Temporal.PlainDateConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainDate : Symbol(Temporal.PlainDate, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainDate : Symbol(Temporal.PlainDate, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.PlainDateConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>year : Symbol(year, Decl(temporal.ts, 630, 36)) +>month : Symbol(month, Decl(temporal.ts, 630, 48)) +>day : Symbol(day, Decl(temporal.ts, 630, 58)) +>calendar : Symbol(calendar, Decl(temporal.ts, 630, 66)) + + // => 2006-08-24[u-ca=islamic] + + // Different overflow modes + date = Temporal.PlainDate.from({ year: 2001, month: 13, day: 1 }, { overflow: "constrain" }); +>date : Symbol(date, Decl(temporal.ts, 616, 7)) +>Temporal.PlainDate.from : Symbol(Temporal.PlainDateConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainDate : Symbol(Temporal.PlainDate, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainDate : Symbol(Temporal.PlainDate, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.PlainDateConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>year : Symbol(year, Decl(temporal.ts, 634, 36)) +>month : Symbol(month, Decl(temporal.ts, 634, 48)) +>day : Symbol(day, Decl(temporal.ts, 634, 59)) +>overflow : Symbol(overflow, Decl(temporal.ts, 634, 71)) + + // => 2001-12-01 + date = Temporal.PlainDate.from({ year: 2001, month: 1, day: 32 }, { overflow: "constrain" }); +>date : Symbol(date, Decl(temporal.ts, 616, 7)) +>Temporal.PlainDate.from : Symbol(Temporal.PlainDateConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainDate : Symbol(Temporal.PlainDate, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainDate : Symbol(Temporal.PlainDate, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.PlainDateConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>year : Symbol(year, Decl(temporal.ts, 636, 36)) +>month : Symbol(month, Decl(temporal.ts, 636, 48)) +>day : Symbol(day, Decl(temporal.ts, 636, 58)) +>overflow : Symbol(overflow, Decl(temporal.ts, 636, 71)) + + // => 2001-01-31 + date = Temporal.PlainDate.from({ year: 2001, month: 13, day: 1 }, { overflow: "reject" }); +>date : Symbol(date, Decl(temporal.ts, 616, 7)) +>Temporal.PlainDate.from : Symbol(Temporal.PlainDateConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainDate : Symbol(Temporal.PlainDate, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainDate : Symbol(Temporal.PlainDate, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.PlainDateConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>year : Symbol(year, Decl(temporal.ts, 638, 36)) +>month : Symbol(month, Decl(temporal.ts, 638, 48)) +>day : Symbol(day, Decl(temporal.ts, 638, 59)) +>overflow : Symbol(overflow, Decl(temporal.ts, 638, 71)) + + // => throws + date = Temporal.PlainDate.from({ year: 2001, month: 1, day: 32 }, { overflow: "reject" }); +>date : Symbol(date, Decl(temporal.ts, 616, 7)) +>Temporal.PlainDate.from : Symbol(Temporal.PlainDateConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainDate : Symbol(Temporal.PlainDate, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainDate : Symbol(Temporal.PlainDate, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.PlainDateConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>year : Symbol(year, Decl(temporal.ts, 640, 36)) +>month : Symbol(month, Decl(temporal.ts, 640, 48)) +>day : Symbol(day, Decl(temporal.ts, 640, 58)) +>overflow : Symbol(overflow, Decl(temporal.ts, 640, 71)) + + // => throws +} + +{ + const one = Temporal.PlainDate.from("2006-08-24"); +>one : Symbol(one, Decl(temporal.ts, 645, 9)) +>Temporal.PlainDate.from : Symbol(Temporal.PlainDateConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainDate : Symbol(Temporal.PlainDate, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainDate : Symbol(Temporal.PlainDate, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.PlainDateConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) + + const two = Temporal.PlainDate.from("2015-07-14"); +>two : Symbol(two, Decl(temporal.ts, 646, 9)) +>Temporal.PlainDate.from : Symbol(Temporal.PlainDateConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainDate : Symbol(Temporal.PlainDate, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainDate : Symbol(Temporal.PlainDate, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.PlainDateConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) + + const three = Temporal.PlainDate.from("1930-02-18"); +>three : Symbol(three, Decl(temporal.ts, 647, 9)) +>Temporal.PlainDate.from : Symbol(Temporal.PlainDateConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainDate : Symbol(Temporal.PlainDate, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainDate : Symbol(Temporal.PlainDate, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.PlainDateConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) + + const sorted = [one, two, three].sort(Temporal.PlainDate.compare); +>sorted : Symbol(sorted, Decl(temporal.ts, 648, 9)) +>[one, two, three].sort : Symbol(Array.sort, Decl(lib.es5.d.ts, --, --)) +>one : Symbol(one, Decl(temporal.ts, 645, 9)) +>two : Symbol(two, Decl(temporal.ts, 646, 9)) +>three : Symbol(three, Decl(temporal.ts, 647, 9)) +>sort : Symbol(Array.sort, Decl(lib.es5.d.ts, --, --)) +>Temporal.PlainDate.compare : Symbol(Temporal.PlainDateConstructor.compare, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainDate : Symbol(Temporal.PlainDate, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainDate : Symbol(Temporal.PlainDate, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>compare : Symbol(Temporal.PlainDateConstructor.compare, Decl(lib.esnext.temporal.d.ts, --, --)) + + sorted.join(" "); // => '1930-02-18 2006-08-24 2015-07-14' +>sorted.join : Symbol(Array.join, Decl(lib.es5.d.ts, --, --)) +>sorted : Symbol(sorted, Decl(temporal.ts, 648, 9)) +>join : Symbol(Array.join, Decl(lib.es5.d.ts, --, --)) +} + +{ + let date: Temporal.PlainDate; +>date : Symbol(date, Decl(temporal.ts, 653, 7)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainDate : Symbol(Temporal.PlainDate, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) + + date = Temporal.PlainDate.from("2006-08-24"); +>date : Symbol(date, Decl(temporal.ts, 653, 7)) +>Temporal.PlainDate.from : Symbol(Temporal.PlainDateConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainDate : Symbol(Temporal.PlainDate, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainDate : Symbol(Temporal.PlainDate, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.PlainDateConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) + + date.year; // => 2006 +>date.year : Symbol(Temporal.PlainDate.year, Decl(lib.esnext.temporal.d.ts, --, --)) +>date : Symbol(date, Decl(temporal.ts, 653, 7)) +>year : Symbol(Temporal.PlainDate.year, Decl(lib.esnext.temporal.d.ts, --, --)) + + date.month; // => 8 +>date.month : Symbol(Temporal.PlainDate.month, Decl(lib.esnext.temporal.d.ts, --, --)) +>date : Symbol(date, Decl(temporal.ts, 653, 7)) +>month : Symbol(Temporal.PlainDate.month, Decl(lib.esnext.temporal.d.ts, --, --)) + + date.monthCode; // => 'M08' +>date.monthCode : Symbol(Temporal.PlainDate.monthCode, Decl(lib.esnext.temporal.d.ts, --, --)) +>date : Symbol(date, Decl(temporal.ts, 653, 7)) +>monthCode : Symbol(Temporal.PlainDate.monthCode, Decl(lib.esnext.temporal.d.ts, --, --)) + + date.day; // => 24 +>date.day : Symbol(Temporal.PlainDate.day, Decl(lib.esnext.temporal.d.ts, --, --)) +>date : Symbol(date, Decl(temporal.ts, 653, 7)) +>day : Symbol(Temporal.PlainDate.day, Decl(lib.esnext.temporal.d.ts, --, --)) + + date = Temporal.PlainDate.from("2019-02-23[u-ca=hebrew]"); +>date : Symbol(date, Decl(temporal.ts, 653, 7)) +>Temporal.PlainDate.from : Symbol(Temporal.PlainDateConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainDate : Symbol(Temporal.PlainDate, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainDate : Symbol(Temporal.PlainDate, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.PlainDateConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) + + date.year; // => 5779 +>date.year : Symbol(Temporal.PlainDate.year, Decl(lib.esnext.temporal.d.ts, --, --)) +>date : Symbol(date, Decl(temporal.ts, 653, 7)) +>year : Symbol(Temporal.PlainDate.year, Decl(lib.esnext.temporal.d.ts, --, --)) + + date.month; // => 6 +>date.month : Symbol(Temporal.PlainDate.month, Decl(lib.esnext.temporal.d.ts, --, --)) +>date : Symbol(date, Decl(temporal.ts, 653, 7)) +>month : Symbol(Temporal.PlainDate.month, Decl(lib.esnext.temporal.d.ts, --, --)) + + date.monthCode; // => 'M05L' +>date.monthCode : Symbol(Temporal.PlainDate.monthCode, Decl(lib.esnext.temporal.d.ts, --, --)) +>date : Symbol(date, Decl(temporal.ts, 653, 7)) +>monthCode : Symbol(Temporal.PlainDate.monthCode, Decl(lib.esnext.temporal.d.ts, --, --)) + + date.day; // => 18 +>date.day : Symbol(Temporal.PlainDate.day, Decl(lib.esnext.temporal.d.ts, --, --)) +>date : Symbol(date, Decl(temporal.ts, 653, 7)) +>day : Symbol(Temporal.PlainDate.day, Decl(lib.esnext.temporal.d.ts, --, --)) +} + +{ + const date = Temporal.PlainDate.from("-000015-01-01[u-ca=gregory]"); +>date : Symbol(date, Decl(temporal.ts, 669, 9)) +>Temporal.PlainDate.from : Symbol(Temporal.PlainDateConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainDate : Symbol(Temporal.PlainDate, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainDate : Symbol(Temporal.PlainDate, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.PlainDateConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) + + date.era; +>date.era : Symbol(Temporal.PlainDate.era, Decl(lib.esnext.temporal.d.ts, --, --)) +>date : Symbol(date, Decl(temporal.ts, 669, 9)) +>era : Symbol(Temporal.PlainDate.era, Decl(lib.esnext.temporal.d.ts, --, --)) + + // => 'bce' + date.eraYear; +>date.eraYear : Symbol(Temporal.PlainDate.eraYear, Decl(lib.esnext.temporal.d.ts, --, --)) +>date : Symbol(date, Decl(temporal.ts, 669, 9)) +>eraYear : Symbol(Temporal.PlainDate.eraYear, Decl(lib.esnext.temporal.d.ts, --, --)) + + // => 16 + date.year; +>date.year : Symbol(Temporal.PlainDate.year, Decl(lib.esnext.temporal.d.ts, --, --)) +>date : Symbol(date, Decl(temporal.ts, 669, 9)) +>year : Symbol(Temporal.PlainDate.year, Decl(lib.esnext.temporal.d.ts, --, --)) + + // => -15 +} + +{ + const date = Temporal.PlainDate.from("2006-08-24"); +>date : Symbol(date, Decl(temporal.ts, 679, 9)) +>Temporal.PlainDate.from : Symbol(Temporal.PlainDateConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainDate : Symbol(Temporal.PlainDate, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainDate : Symbol(Temporal.PlainDate, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.PlainDateConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) + + ["MON", "TUE", "WED", "THU", "FRI", "SAT", "SUN"][date.dayOfWeek - 1]; // => 'THU' +>date.dayOfWeek : Symbol(Temporal.PlainDate.dayOfWeek, Decl(lib.esnext.temporal.d.ts, --, --)) +>date : Symbol(date, Decl(temporal.ts, 679, 9)) +>dayOfWeek : Symbol(Temporal.PlainDate.dayOfWeek, Decl(lib.esnext.temporal.d.ts, --, --)) +} + +{ + const date = Temporal.PlainDate.from("2006-08-24"); +>date : Symbol(date, Decl(temporal.ts, 684, 9)) +>Temporal.PlainDate.from : Symbol(Temporal.PlainDateConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainDate : Symbol(Temporal.PlainDate, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainDate : Symbol(Temporal.PlainDate, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.PlainDateConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) + + // ISO ordinal date + console.log(date.year, date.dayOfYear); // => '2006 236' +>console.log : Symbol(Console.log, Decl(lib.dom.d.ts, --, --)) +>console : Symbol(console, Decl(lib.dom.d.ts, --, --)) +>log : Symbol(Console.log, Decl(lib.dom.d.ts, --, --)) +>date.year : Symbol(Temporal.PlainDate.year, Decl(lib.esnext.temporal.d.ts, --, --)) +>date : Symbol(date, Decl(temporal.ts, 684, 9)) +>year : Symbol(Temporal.PlainDate.year, Decl(lib.esnext.temporal.d.ts, --, --)) +>date.dayOfYear : Symbol(Temporal.PlainDate.dayOfYear, Decl(lib.esnext.temporal.d.ts, --, --)) +>date : Symbol(date, Decl(temporal.ts, 684, 9)) +>dayOfYear : Symbol(Temporal.PlainDate.dayOfYear, Decl(lib.esnext.temporal.d.ts, --, --)) +} + +{ + const date = Temporal.PlainDate.from("2022-01-01"); +>date : Symbol(date, Decl(temporal.ts, 690, 9)) +>Temporal.PlainDate.from : Symbol(Temporal.PlainDateConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainDate : Symbol(Temporal.PlainDate, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainDate : Symbol(Temporal.PlainDate, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.PlainDateConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) + + // ISO week date + console.log(date.yearOfWeek, date.weekOfYear, date.dayOfWeek); // => '2021 52 6' +>console.log : Symbol(Console.log, Decl(lib.dom.d.ts, --, --)) +>console : Symbol(console, Decl(lib.dom.d.ts, --, --)) +>log : Symbol(Console.log, Decl(lib.dom.d.ts, --, --)) +>date.yearOfWeek : Symbol(Temporal.PlainDate.yearOfWeek, Decl(lib.esnext.temporal.d.ts, --, --)) +>date : Symbol(date, Decl(temporal.ts, 690, 9)) +>yearOfWeek : Symbol(Temporal.PlainDate.yearOfWeek, Decl(lib.esnext.temporal.d.ts, --, --)) +>date.weekOfYear : Symbol(Temporal.PlainDate.weekOfYear, Decl(lib.esnext.temporal.d.ts, --, --)) +>date : Symbol(date, Decl(temporal.ts, 690, 9)) +>weekOfYear : Symbol(Temporal.PlainDate.weekOfYear, Decl(lib.esnext.temporal.d.ts, --, --)) +>date.dayOfWeek : Symbol(Temporal.PlainDate.dayOfWeek, Decl(lib.esnext.temporal.d.ts, --, --)) +>date : Symbol(date, Decl(temporal.ts, 690, 9)) +>dayOfWeek : Symbol(Temporal.PlainDate.dayOfWeek, Decl(lib.esnext.temporal.d.ts, --, --)) +} + +{ + const date = Temporal.PlainDate.from("2006-08-24"); +>date : Symbol(date, Decl(temporal.ts, 696, 9)) +>Temporal.PlainDate.from : Symbol(Temporal.PlainDateConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainDate : Symbol(Temporal.PlainDate, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainDate : Symbol(Temporal.PlainDate, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.PlainDateConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) + + date.daysInWeek; // => 7 +>date.daysInWeek : Symbol(Temporal.PlainDate.daysInWeek, Decl(lib.esnext.temporal.d.ts, --, --)) +>date : Symbol(date, Decl(temporal.ts, 696, 9)) +>daysInWeek : Symbol(Temporal.PlainDate.daysInWeek, Decl(lib.esnext.temporal.d.ts, --, --)) +} + +{ + // Attempt to write some mnemonic poetry + const monthsByDays: Record = {}; +>monthsByDays : Symbol(monthsByDays, Decl(temporal.ts, 702, 9)) +>Record : Symbol(Record, Decl(lib.es5.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainDate : Symbol(Temporal.PlainDate, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) + + for (let month = 1; month <= 12; month++) { +>month : Symbol(month, Decl(temporal.ts, 703, 12)) +>month : Symbol(month, Decl(temporal.ts, 703, 12)) +>month : Symbol(month, Decl(temporal.ts, 703, 12)) + + const date = Temporal.Now.plainDateISO().with({ month }); +>date : Symbol(date, Decl(temporal.ts, 704, 13)) +>Temporal.Now.plainDateISO().with : Symbol(Temporal.PlainDate.with, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.Now.plainDateISO : Symbol(Temporal.Now.plainDateISO, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.Now : Symbol(Temporal.Now, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>Now : Symbol(Temporal.Now, Decl(lib.esnext.temporal.d.ts, --, --)) +>plainDateISO : Symbol(Temporal.Now.plainDateISO, Decl(lib.esnext.temporal.d.ts, --, --)) +>with : Symbol(Temporal.PlainDate.with, Decl(lib.esnext.temporal.d.ts, --, --)) +>month : Symbol(month, Decl(temporal.ts, 704, 55)) + + monthsByDays[date.daysInMonth] = (monthsByDays[date.daysInMonth] || []).concat(date); +>monthsByDays : Symbol(monthsByDays, Decl(temporal.ts, 702, 9)) +>date.daysInMonth : Symbol(Temporal.PlainDate.daysInMonth, Decl(lib.esnext.temporal.d.ts, --, --)) +>date : Symbol(date, Decl(temporal.ts, 704, 13)) +>daysInMonth : Symbol(Temporal.PlainDate.daysInMonth, Decl(lib.esnext.temporal.d.ts, --, --)) +>(monthsByDays[date.daysInMonth] || []).concat : Symbol(Array.concat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>monthsByDays : Symbol(monthsByDays, Decl(temporal.ts, 702, 9)) +>date.daysInMonth : Symbol(Temporal.PlainDate.daysInMonth, Decl(lib.esnext.temporal.d.ts, --, --)) +>date : Symbol(date, Decl(temporal.ts, 704, 13)) +>daysInMonth : Symbol(Temporal.PlainDate.daysInMonth, Decl(lib.esnext.temporal.d.ts, --, --)) +>concat : Symbol(Array.concat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>date : Symbol(date, Decl(temporal.ts, 704, 13)) + } + + const strings = monthsByDays[30].map(date => date.toLocaleString("en", { month: "long" })); +>strings : Symbol(strings, Decl(temporal.ts, 708, 9)) +>monthsByDays[30].map : Symbol(Array.map, Decl(lib.es5.d.ts, --, --)) +>monthsByDays : Symbol(monthsByDays, Decl(temporal.ts, 702, 9)) +>map : Symbol(Array.map, Decl(lib.es5.d.ts, --, --)) +>date : Symbol(date, Decl(temporal.ts, 708, 41)) +>date.toLocaleString : Symbol(Temporal.PlainDate.toLocaleString, Decl(lib.esnext.temporal.d.ts, --, --)) +>date : Symbol(date, Decl(temporal.ts, 708, 41)) +>toLocaleString : Symbol(Temporal.PlainDate.toLocaleString, Decl(lib.esnext.temporal.d.ts, --, --)) +>month : Symbol(month, Decl(temporal.ts, 708, 76)) + + // Shuffle to improve poem as determined empirically + strings.unshift(strings.pop()!); +>strings.unshift : Symbol(Array.unshift, Decl(lib.es5.d.ts, --, --)) +>strings : Symbol(strings, Decl(temporal.ts, 708, 9)) +>unshift : Symbol(Array.unshift, Decl(lib.es5.d.ts, --, --)) +>strings.pop : Symbol(Array.pop, Decl(lib.es5.d.ts, --, --)) +>strings : Symbol(strings, Decl(temporal.ts, 708, 9)) +>pop : Symbol(Array.pop, Decl(lib.es5.d.ts, --, --)) + + const format = new Intl.ListFormat("en"); +>format : Symbol(format, Decl(temporal.ts, 711, 9)) +>Intl.ListFormat : Symbol(Intl.ListFormat, Decl(lib.es2021.intl.d.ts, --, --), Decl(lib.es2021.intl.d.ts, --, --)) +>Intl : Symbol(Intl, Decl(lib.es5.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2020.intl.d.ts, --, --), Decl(lib.es2021.intl.d.ts, --, --), Decl(lib.es2025.intl.d.ts, --, --) ... and 1 more) +>ListFormat : Symbol(Intl.ListFormat, Decl(lib.es2021.intl.d.ts, --, --), Decl(lib.es2021.intl.d.ts, --, --)) + + const poem = `Thirty days hath ${format.format(strings)}`; +>poem : Symbol(poem, Decl(temporal.ts, 712, 9)) +>format.format : Symbol(Intl.ListFormat.format, Decl(lib.es2021.intl.d.ts, --, --)) +>format : Symbol(format, Decl(temporal.ts, 711, 9)) +>format : Symbol(Intl.ListFormat.format, Decl(lib.es2021.intl.d.ts, --, --)) +>strings : Symbol(strings, Decl(temporal.ts, 708, 9)) + + console.log(poem); +>console.log : Symbol(Console.log, Decl(lib.dom.d.ts, --, --)) +>console : Symbol(console, Decl(lib.dom.d.ts, --, --)) +>log : Symbol(Console.log, Decl(lib.dom.d.ts, --, --)) +>poem : Symbol(poem, Decl(temporal.ts, 712, 9)) +} + +{ + const date = Temporal.Now.plainDateISO(); +>date : Symbol(date, Decl(temporal.ts, 718, 9)) +>Temporal.Now.plainDateISO : Symbol(Temporal.Now.plainDateISO, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.Now : Symbol(Temporal.Now, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>Now : Symbol(Temporal.Now, Decl(lib.esnext.temporal.d.ts, --, --)) +>plainDateISO : Symbol(Temporal.Now.plainDateISO, Decl(lib.esnext.temporal.d.ts, --, --)) + + const percent = date.dayOfYear / date.daysInYear; +>percent : Symbol(percent, Decl(temporal.ts, 719, 9)) +>date.dayOfYear : Symbol(Temporal.PlainDate.dayOfYear, Decl(lib.esnext.temporal.d.ts, --, --)) +>date : Symbol(date, Decl(temporal.ts, 718, 9)) +>dayOfYear : Symbol(Temporal.PlainDate.dayOfYear, Decl(lib.esnext.temporal.d.ts, --, --)) +>date.daysInYear : Symbol(Temporal.PlainDate.daysInYear, Decl(lib.esnext.temporal.d.ts, --, --)) +>date : Symbol(date, Decl(temporal.ts, 718, 9)) +>daysInYear : Symbol(Temporal.PlainDate.daysInYear, Decl(lib.esnext.temporal.d.ts, --, --)) + + `The year is ${percent.toLocaleString("en", { style: "percent" })} over!`; +>percent.toLocaleString : Symbol(Number.toLocaleString, Decl(lib.es5.d.ts, --, --)) +>percent : Symbol(percent, Decl(temporal.ts, 719, 9)) +>toLocaleString : Symbol(Number.toLocaleString, Decl(lib.es5.d.ts, --, --)) +>style : Symbol(style, Decl(temporal.ts, 720, 49)) + + // example output: "The year is 10% over!" +} + +{ + const date = Temporal.PlainDate.from("1900-01-01"); +>date : Symbol(date, Decl(temporal.ts, 725, 9)) +>Temporal.PlainDate.from : Symbol(Temporal.PlainDateConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainDate : Symbol(Temporal.PlainDate, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainDate : Symbol(Temporal.PlainDate, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.PlainDateConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) + + date.monthsInYear; // => 12 +>date.monthsInYear : Symbol(Temporal.PlainDate.monthsInYear, Decl(lib.esnext.temporal.d.ts, --, --)) +>date : Symbol(date, Decl(temporal.ts, 725, 9)) +>monthsInYear : Symbol(Temporal.PlainDate.monthsInYear, Decl(lib.esnext.temporal.d.ts, --, --)) +} + +{ + // Is this year a leap year? + const date = Temporal.Now.plainDateISO(); +>date : Symbol(date, Decl(temporal.ts, 731, 9)) +>Temporal.Now.plainDateISO : Symbol(Temporal.Now.plainDateISO, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.Now : Symbol(Temporal.Now, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>Now : Symbol(Temporal.Now, Decl(lib.esnext.temporal.d.ts, --, --)) +>plainDateISO : Symbol(Temporal.Now.plainDateISO, Decl(lib.esnext.temporal.d.ts, --, --)) + + date.inLeapYear; // example output: true +>date.inLeapYear : Symbol(Temporal.PlainDate.inLeapYear, Decl(lib.esnext.temporal.d.ts, --, --)) +>date : Symbol(date, Decl(temporal.ts, 731, 9)) +>inLeapYear : Symbol(Temporal.PlainDate.inLeapYear, Decl(lib.esnext.temporal.d.ts, --, --)) + + // Is 2100 a leap year? (no, because it's divisible by 100 and not 400) + date.with({ year: 2100 }).inLeapYear; // => false +>date.with({ year: 2100 }).inLeapYear : Symbol(Temporal.PlainDate.inLeapYear, Decl(lib.esnext.temporal.d.ts, --, --)) +>date.with : Symbol(Temporal.PlainDate.with, Decl(lib.esnext.temporal.d.ts, --, --)) +>date : Symbol(date, Decl(temporal.ts, 731, 9)) +>with : Symbol(Temporal.PlainDate.with, Decl(lib.esnext.temporal.d.ts, --, --)) +>year : Symbol(year, Decl(temporal.ts, 734, 15)) +>inLeapYear : Symbol(Temporal.PlainDate.inLeapYear, Decl(lib.esnext.temporal.d.ts, --, --)) +} + +{ + const date = Temporal.PlainDate.from("2006-01-24"); +>date : Symbol(date, Decl(temporal.ts, 738, 9)) +>Temporal.PlainDate.from : Symbol(Temporal.PlainDateConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainDate : Symbol(Temporal.PlainDate, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainDate : Symbol(Temporal.PlainDate, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.PlainDateConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) + + // What's the first day of this month? + date.with({ day: 1 }); // => 2006-01-01 +>date.with : Symbol(Temporal.PlainDate.with, Decl(lib.esnext.temporal.d.ts, --, --)) +>date : Symbol(date, Decl(temporal.ts, 738, 9)) +>with : Symbol(Temporal.PlainDate.with, Decl(lib.esnext.temporal.d.ts, --, --)) +>day : Symbol(day, Decl(temporal.ts, 740, 15)) + + // What's the last day of the next month? + const nextMonthDate = date.add({ months: 1 }); +>nextMonthDate : Symbol(nextMonthDate, Decl(temporal.ts, 742, 9)) +>date.add : Symbol(Temporal.PlainDate.add, Decl(lib.esnext.temporal.d.ts, --, --)) +>date : Symbol(date, Decl(temporal.ts, 738, 9)) +>add : Symbol(Temporal.PlainDate.add, Decl(lib.esnext.temporal.d.ts, --, --)) +>months : Symbol(months, Decl(temporal.ts, 742, 36)) + + nextMonthDate.with({ day: nextMonthDate.daysInMonth }); // => 2006-02-28 +>nextMonthDate.with : Symbol(Temporal.PlainDate.with, Decl(lib.esnext.temporal.d.ts, --, --)) +>nextMonthDate : Symbol(nextMonthDate, Decl(temporal.ts, 742, 9)) +>with : Symbol(Temporal.PlainDate.with, Decl(lib.esnext.temporal.d.ts, --, --)) +>day : Symbol(day, Decl(temporal.ts, 743, 24)) +>nextMonthDate.daysInMonth : Symbol(Temporal.PlainDate.daysInMonth, Decl(lib.esnext.temporal.d.ts, --, --)) +>nextMonthDate : Symbol(nextMonthDate, Decl(temporal.ts, 742, 9)) +>daysInMonth : Symbol(Temporal.PlainDate.daysInMonth, Decl(lib.esnext.temporal.d.ts, --, --)) +} + +{ + const date = Temporal.PlainDate.from("2006-08-24[u-ca=japanese]"); +>date : Symbol(date, Decl(temporal.ts, 747, 9)) +>Temporal.PlainDate.from : Symbol(Temporal.PlainDateConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainDate : Symbol(Temporal.PlainDate, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainDate : Symbol(Temporal.PlainDate, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.PlainDateConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) + + date.withCalendar("iso8601"); // => 2006-08-24 +>date.withCalendar : Symbol(Temporal.PlainDate.withCalendar, Decl(lib.esnext.temporal.d.ts, --, --)) +>date : Symbol(date, Decl(temporal.ts, 747, 9)) +>withCalendar : Symbol(Temporal.PlainDate.withCalendar, Decl(lib.esnext.temporal.d.ts, --, --)) +} + +{ + let date: Temporal.PlainDate; +>date : Symbol(date, Decl(temporal.ts, 752, 7)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainDate : Symbol(Temporal.PlainDate, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) + + date = Temporal.PlainDate.from("2006-08-24"); +>date : Symbol(date, Decl(temporal.ts, 752, 7)) +>Temporal.PlainDate.from : Symbol(Temporal.PlainDateConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainDate : Symbol(Temporal.PlainDate, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainDate : Symbol(Temporal.PlainDate, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.PlainDateConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) + + date.add({ years: 20, months: 4 }); // => 2026-12-24 +>date.add : Symbol(Temporal.PlainDate.add, Decl(lib.esnext.temporal.d.ts, --, --)) +>date : Symbol(date, Decl(temporal.ts, 752, 7)) +>add : Symbol(Temporal.PlainDate.add, Decl(lib.esnext.temporal.d.ts, --, --)) +>years : Symbol(years, Decl(temporal.ts, 755, 14)) +>months : Symbol(months, Decl(temporal.ts, 755, 25)) + + date = Temporal.PlainDate.from("2019-01-31"); +>date : Symbol(date, Decl(temporal.ts, 752, 7)) +>Temporal.PlainDate.from : Symbol(Temporal.PlainDateConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainDate : Symbol(Temporal.PlainDate, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainDate : Symbol(Temporal.PlainDate, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.PlainDateConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) + + date.add({ months: 1 }); // => 2019-02-28 +>date.add : Symbol(Temporal.PlainDate.add, Decl(lib.esnext.temporal.d.ts, --, --)) +>date : Symbol(date, Decl(temporal.ts, 752, 7)) +>add : Symbol(Temporal.PlainDate.add, Decl(lib.esnext.temporal.d.ts, --, --)) +>months : Symbol(months, Decl(temporal.ts, 758, 14)) + + date.add({ months: 1 }, { overflow: "reject" }); // => throws +>date.add : Symbol(Temporal.PlainDate.add, Decl(lib.esnext.temporal.d.ts, --, --)) +>date : Symbol(date, Decl(temporal.ts, 752, 7)) +>add : Symbol(Temporal.PlainDate.add, Decl(lib.esnext.temporal.d.ts, --, --)) +>months : Symbol(months, Decl(temporal.ts, 759, 14)) +>overflow : Symbol(overflow, Decl(temporal.ts, 759, 29)) +} + +{ + let date: Temporal.PlainDate; +>date : Symbol(date, Decl(temporal.ts, 763, 7)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainDate : Symbol(Temporal.PlainDate, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) + + date = Temporal.PlainDate.from("2006-08-24"); +>date : Symbol(date, Decl(temporal.ts, 763, 7)) +>Temporal.PlainDate.from : Symbol(Temporal.PlainDateConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainDate : Symbol(Temporal.PlainDate, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainDate : Symbol(Temporal.PlainDate, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.PlainDateConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) + + date.subtract({ years: 20, months: 4 }); // => 1986-04-24 +>date.subtract : Symbol(Temporal.PlainDate.subtract, Decl(lib.esnext.temporal.d.ts, --, --)) +>date : Symbol(date, Decl(temporal.ts, 763, 7)) +>subtract : Symbol(Temporal.PlainDate.subtract, Decl(lib.esnext.temporal.d.ts, --, --)) +>years : Symbol(years, Decl(temporal.ts, 766, 19)) +>months : Symbol(months, Decl(temporal.ts, 766, 30)) + + date = Temporal.PlainDate.from("2019-03-31"); +>date : Symbol(date, Decl(temporal.ts, 763, 7)) +>Temporal.PlainDate.from : Symbol(Temporal.PlainDateConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainDate : Symbol(Temporal.PlainDate, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainDate : Symbol(Temporal.PlainDate, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.PlainDateConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) + + date.subtract({ months: 1 }); // => 2019-02-28 +>date.subtract : Symbol(Temporal.PlainDate.subtract, Decl(lib.esnext.temporal.d.ts, --, --)) +>date : Symbol(date, Decl(temporal.ts, 763, 7)) +>subtract : Symbol(Temporal.PlainDate.subtract, Decl(lib.esnext.temporal.d.ts, --, --)) +>months : Symbol(months, Decl(temporal.ts, 769, 19)) + + date.subtract({ months: 1 }, { overflow: "reject" }); // => throws +>date.subtract : Symbol(Temporal.PlainDate.subtract, Decl(lib.esnext.temporal.d.ts, --, --)) +>date : Symbol(date, Decl(temporal.ts, 763, 7)) +>subtract : Symbol(Temporal.PlainDate.subtract, Decl(lib.esnext.temporal.d.ts, --, --)) +>months : Symbol(months, Decl(temporal.ts, 770, 19)) +>overflow : Symbol(overflow, Decl(temporal.ts, 770, 34)) +} + +{ + const earlier = Temporal.PlainDate.from("2006-08-24"); +>earlier : Symbol(earlier, Decl(temporal.ts, 774, 9)) +>Temporal.PlainDate.from : Symbol(Temporal.PlainDateConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainDate : Symbol(Temporal.PlainDate, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainDate : Symbol(Temporal.PlainDate, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.PlainDateConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) + + const later = Temporal.PlainDate.from("2019-01-31"); +>later : Symbol(later, Decl(temporal.ts, 775, 9)) +>Temporal.PlainDate.from : Symbol(Temporal.PlainDateConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainDate : Symbol(Temporal.PlainDate, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainDate : Symbol(Temporal.PlainDate, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.PlainDateConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) + + earlier.until(later); // => P4543D +>earlier.until : Symbol(Temporal.PlainDate.until, Decl(lib.esnext.temporal.d.ts, --, --)) +>earlier : Symbol(earlier, Decl(temporal.ts, 774, 9)) +>until : Symbol(Temporal.PlainDate.until, Decl(lib.esnext.temporal.d.ts, --, --)) +>later : Symbol(later, Decl(temporal.ts, 775, 9)) + + earlier.until(later, { largestUnit: "year" }); // => P12Y5M7D +>earlier.until : Symbol(Temporal.PlainDate.until, Decl(lib.esnext.temporal.d.ts, --, --)) +>earlier : Symbol(earlier, Decl(temporal.ts, 774, 9)) +>until : Symbol(Temporal.PlainDate.until, Decl(lib.esnext.temporal.d.ts, --, --)) +>later : Symbol(later, Decl(temporal.ts, 775, 9)) +>largestUnit : Symbol(largestUnit, Decl(temporal.ts, 777, 26)) + + later.until(earlier, { largestUnit: "year" }); // => -P12Y5M7D +>later.until : Symbol(Temporal.PlainDate.until, Decl(lib.esnext.temporal.d.ts, --, --)) +>later : Symbol(later, Decl(temporal.ts, 775, 9)) +>until : Symbol(Temporal.PlainDate.until, Decl(lib.esnext.temporal.d.ts, --, --)) +>earlier : Symbol(earlier, Decl(temporal.ts, 774, 9)) +>largestUnit : Symbol(largestUnit, Decl(temporal.ts, 778, 26)) + + // If you really need to calculate the difference between two Dates in + // hours, you can eliminate the ambiguity by explicitly choosing the + // point in time from which you want to reckon the difference. For + // example, using noon: + const noon = Temporal.PlainTime.from("12:00"); +>noon : Symbol(noon, Decl(temporal.ts, 784, 9)) +>Temporal.PlainTime.from : Symbol(Temporal.PlainTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainTime : Symbol(Temporal.PlainTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainTime : Symbol(Temporal.PlainTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.PlainTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) + + earlier.toPlainDateTime(noon).until(later.toPlainDateTime(noon), { largestUnit: "hour" }); +>earlier.toPlainDateTime(noon).until : Symbol(Temporal.PlainDateTime.until, Decl(lib.esnext.temporal.d.ts, --, --)) +>earlier.toPlainDateTime : Symbol(Temporal.PlainDate.toPlainDateTime, Decl(lib.esnext.temporal.d.ts, --, --)) +>earlier : Symbol(earlier, Decl(temporal.ts, 774, 9)) +>toPlainDateTime : Symbol(Temporal.PlainDate.toPlainDateTime, Decl(lib.esnext.temporal.d.ts, --, --)) +>noon : Symbol(noon, Decl(temporal.ts, 784, 9)) +>until : Symbol(Temporal.PlainDateTime.until, Decl(lib.esnext.temporal.d.ts, --, --)) +>later.toPlainDateTime : Symbol(Temporal.PlainDate.toPlainDateTime, Decl(lib.esnext.temporal.d.ts, --, --)) +>later : Symbol(later, Decl(temporal.ts, 775, 9)) +>toPlainDateTime : Symbol(Temporal.PlainDate.toPlainDateTime, Decl(lib.esnext.temporal.d.ts, --, --)) +>noon : Symbol(noon, Decl(temporal.ts, 784, 9)) +>largestUnit : Symbol(largestUnit, Decl(temporal.ts, 785, 70)) + + // => PT109032H + + const newyear = Temporal.PlainDate.from("2020-01-01"); +>newyear : Symbol(newyear, Decl(temporal.ts, 788, 9)) +>Temporal.PlainDate.from : Symbol(Temporal.PlainDateConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainDate : Symbol(Temporal.PlainDate, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainDate : Symbol(Temporal.PlainDate, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.PlainDateConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) + + newyear.until("2020-01-15", { smallestUnit: "month", roundingMode: "halfExpand" }); +>newyear.until : Symbol(Temporal.PlainDate.until, Decl(lib.esnext.temporal.d.ts, --, --)) +>newyear : Symbol(newyear, Decl(temporal.ts, 788, 9)) +>until : Symbol(Temporal.PlainDate.until, Decl(lib.esnext.temporal.d.ts, --, --)) +>smallestUnit : Symbol(smallestUnit, Decl(temporal.ts, 789, 33)) +>roundingMode : Symbol(roundingMode, Decl(temporal.ts, 789, 56)) + + // => PT0S + newyear.until("2020-01-16", { smallestUnit: "month", roundingMode: "halfExpand" }); +>newyear.until : Symbol(Temporal.PlainDate.until, Decl(lib.esnext.temporal.d.ts, --, --)) +>newyear : Symbol(newyear, Decl(temporal.ts, 788, 9)) +>until : Symbol(Temporal.PlainDate.until, Decl(lib.esnext.temporal.d.ts, --, --)) +>smallestUnit : Symbol(smallestUnit, Decl(temporal.ts, 791, 33)) +>roundingMode : Symbol(roundingMode, Decl(temporal.ts, 791, 56)) + + // => PT0S (mid-month dates rounded down to match `Temporal.PlainDateTime` behavior) + newyear.until("2020-01-17", { smallestUnit: "month", roundingMode: "halfExpand" }); +>newyear.until : Symbol(Temporal.PlainDate.until, Decl(lib.esnext.temporal.d.ts, --, --)) +>newyear : Symbol(newyear, Decl(temporal.ts, 788, 9)) +>until : Symbol(Temporal.PlainDate.until, Decl(lib.esnext.temporal.d.ts, --, --)) +>smallestUnit : Symbol(smallestUnit, Decl(temporal.ts, 793, 33)) +>roundingMode : Symbol(roundingMode, Decl(temporal.ts, 793, 56)) + + // => PT1M +} + +{ + const earlier = Temporal.PlainDate.from("2006-08-24"); +>earlier : Symbol(earlier, Decl(temporal.ts, 798, 9)) +>Temporal.PlainDate.from : Symbol(Temporal.PlainDateConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainDate : Symbol(Temporal.PlainDate, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainDate : Symbol(Temporal.PlainDate, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.PlainDateConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) + + const later = Temporal.PlainDate.from("2019-01-31"); +>later : Symbol(later, Decl(temporal.ts, 799, 9)) +>Temporal.PlainDate.from : Symbol(Temporal.PlainDateConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainDate : Symbol(Temporal.PlainDate, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainDate : Symbol(Temporal.PlainDate, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.PlainDateConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) + + later.since(earlier); // => P4543D +>later.since : Symbol(Temporal.PlainDate.since, Decl(lib.esnext.temporal.d.ts, --, --)) +>later : Symbol(later, Decl(temporal.ts, 799, 9)) +>since : Symbol(Temporal.PlainDate.since, Decl(lib.esnext.temporal.d.ts, --, --)) +>earlier : Symbol(earlier, Decl(temporal.ts, 798, 9)) +} + +{ + const date = Temporal.PlainDate.from("2006-08-24"); +>date : Symbol(date, Decl(temporal.ts, 804, 9)) +>Temporal.PlainDate.from : Symbol(Temporal.PlainDateConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainDate : Symbol(Temporal.PlainDate, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainDate : Symbol(Temporal.PlainDate, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.PlainDateConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) + + const other = Temporal.PlainDate.from("2019-01-31"); +>other : Symbol(other, Decl(temporal.ts, 805, 9)) +>Temporal.PlainDate.from : Symbol(Temporal.PlainDateConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainDate : Symbol(Temporal.PlainDate, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainDate : Symbol(Temporal.PlainDate, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.PlainDateConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) + + date.equals(other); // => false +>date.equals : Symbol(Temporal.PlainDate.equals, Decl(lib.esnext.temporal.d.ts, --, --)) +>date : Symbol(date, Decl(temporal.ts, 804, 9)) +>equals : Symbol(Temporal.PlainDate.equals, Decl(lib.esnext.temporal.d.ts, --, --)) +>other : Symbol(other, Decl(temporal.ts, 805, 9)) + + date.equals(date); // => true +>date.equals : Symbol(Temporal.PlainDate.equals, Decl(lib.esnext.temporal.d.ts, --, --)) +>date : Symbol(date, Decl(temporal.ts, 804, 9)) +>equals : Symbol(Temporal.PlainDate.equals, Decl(lib.esnext.temporal.d.ts, --, --)) +>date : Symbol(date, Decl(temporal.ts, 804, 9)) +} + +{ + const date = Temporal.PlainDate.from("2006-08-24"); +>date : Symbol(date, Decl(temporal.ts, 811, 9)) +>Temporal.PlainDate.from : Symbol(Temporal.PlainDateConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainDate : Symbol(Temporal.PlainDate, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainDate : Symbol(Temporal.PlainDate, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.PlainDateConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) + + date.toString(); // => '2006-08-24' +>date.toString : Symbol(Temporal.PlainDate.toString, Decl(lib.esnext.temporal.d.ts, --, --)) +>date : Symbol(date, Decl(temporal.ts, 811, 9)) +>toString : Symbol(Temporal.PlainDate.toString, Decl(lib.esnext.temporal.d.ts, --, --)) +} + +{ + const date = Temporal.PlainDate.from("2006-08-24"); +>date : Symbol(date, Decl(temporal.ts, 816, 9)) +>Temporal.PlainDate.from : Symbol(Temporal.PlainDateConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainDate : Symbol(Temporal.PlainDate, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainDate : Symbol(Temporal.PlainDate, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.PlainDateConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) + + date.toLocaleString(); // example output: 8/24/2006 +>date.toLocaleString : Symbol(Temporal.PlainDate.toLocaleString, Decl(lib.esnext.temporal.d.ts, --, --)) +>date : Symbol(date, Decl(temporal.ts, 816, 9)) +>toLocaleString : Symbol(Temporal.PlainDate.toLocaleString, Decl(lib.esnext.temporal.d.ts, --, --)) + + date.toLocaleString("de-DE"); // example output: '24.8.2006' +>date.toLocaleString : Symbol(Temporal.PlainDate.toLocaleString, Decl(lib.esnext.temporal.d.ts, --, --)) +>date : Symbol(date, Decl(temporal.ts, 816, 9)) +>toLocaleString : Symbol(Temporal.PlainDate.toLocaleString, Decl(lib.esnext.temporal.d.ts, --, --)) + + date.toLocaleString("de-DE", { weekday: "long" }); // => 'Donnerstag' +>date.toLocaleString : Symbol(Temporal.PlainDate.toLocaleString, Decl(lib.esnext.temporal.d.ts, --, --)) +>date : Symbol(date, Decl(temporal.ts, 816, 9)) +>toLocaleString : Symbol(Temporal.PlainDate.toLocaleString, Decl(lib.esnext.temporal.d.ts, --, --)) +>weekday : Symbol(weekday, Decl(temporal.ts, 819, 34)) + + date.toLocaleString("en-US-u-nu-fullwide"); // => '8/24/2006' +>date.toLocaleString : Symbol(Temporal.PlainDate.toLocaleString, Decl(lib.esnext.temporal.d.ts, --, --)) +>date : Symbol(date, Decl(temporal.ts, 816, 9)) +>toLocaleString : Symbol(Temporal.PlainDate.toLocaleString, Decl(lib.esnext.temporal.d.ts, --, --)) +} + +{ + const plainDate = Temporal.PlainDate.from("2006-08-24"); +>plainDate : Symbol(plainDate, Decl(temporal.ts, 824, 9)) +>Temporal.PlainDate.from : Symbol(Temporal.PlainDateConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainDate : Symbol(Temporal.PlainDate, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainDate : Symbol(Temporal.PlainDate, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.PlainDateConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) + + const plainTime = Temporal.PlainTime.from("15:23:30.003"); +>plainTime : Symbol(plainTime, Decl(temporal.ts, 825, 9)) +>Temporal.PlainTime.from : Symbol(Temporal.PlainTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainTime : Symbol(Temporal.PlainTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainTime : Symbol(Temporal.PlainTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.PlainTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) + + plainDate.toZonedDateTime({ timeZone: "America/Los_Angeles", plainTime }); +>plainDate.toZonedDateTime : Symbol(Temporal.PlainDate.toZonedDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>plainDate : Symbol(plainDate, Decl(temporal.ts, 824, 9)) +>toZonedDateTime : Symbol(Temporal.PlainDate.toZonedDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>timeZone : Symbol(timeZone, Decl(temporal.ts, 826, 31)) +>plainTime : Symbol(plainTime, Decl(temporal.ts, 826, 64)) + + // => 2006-08-24T15:23:30.003-07:00[America/Los_Angeles] + plainDate.toZonedDateTime({ timeZone: "America/Los_Angeles" }); +>plainDate.toZonedDateTime : Symbol(Temporal.PlainDate.toZonedDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>plainDate : Symbol(plainDate, Decl(temporal.ts, 824, 9)) +>toZonedDateTime : Symbol(Temporal.PlainDate.toZonedDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>timeZone : Symbol(timeZone, Decl(temporal.ts, 828, 31)) + + // => 2006-08-24T00:00:00-07:00[America/Los_Angeles] +} + +{ + const date = Temporal.PlainDate.from("2006-08-24"); +>date : Symbol(date, Decl(temporal.ts, 833, 9)) +>Temporal.PlainDate.from : Symbol(Temporal.PlainDateConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainDate : Symbol(Temporal.PlainDate, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainDate : Symbol(Temporal.PlainDate, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.PlainDateConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) + + const time = Temporal.PlainTime.from("15:23:30.003"); +>time : Symbol(time, Decl(temporal.ts, 834, 9)) +>Temporal.PlainTime.from : Symbol(Temporal.PlainTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainTime : Symbol(Temporal.PlainTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainTime : Symbol(Temporal.PlainTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.PlainTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) + + date.toPlainDateTime(time); // => 2006-08-24T15:23:30.003 +>date.toPlainDateTime : Symbol(Temporal.PlainDate.toPlainDateTime, Decl(lib.esnext.temporal.d.ts, --, --)) +>date : Symbol(date, Decl(temporal.ts, 833, 9)) +>toPlainDateTime : Symbol(Temporal.PlainDate.toPlainDateTime, Decl(lib.esnext.temporal.d.ts, --, --)) +>time : Symbol(time, Decl(temporal.ts, 834, 9)) + + date.toPlainDateTime(); // => 2006-08-24T00:00:00 +>date.toPlainDateTime : Symbol(Temporal.PlainDate.toPlainDateTime, Decl(lib.esnext.temporal.d.ts, --, --)) +>date : Symbol(date, Decl(temporal.ts, 833, 9)) +>toPlainDateTime : Symbol(Temporal.PlainDate.toPlainDateTime, Decl(lib.esnext.temporal.d.ts, --, --)) +} + +{ + const date = Temporal.PlainDate.from("2006-08-24"); +>date : Symbol(date, Decl(temporal.ts, 840, 9)) +>Temporal.PlainDate.from : Symbol(Temporal.PlainDateConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainDate : Symbol(Temporal.PlainDate, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainDate : Symbol(Temporal.PlainDate, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.PlainDateConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) + + date.toPlainYearMonth(); // => 2006-08 +>date.toPlainYearMonth : Symbol(Temporal.PlainDate.toPlainYearMonth, Decl(lib.esnext.temporal.d.ts, --, --)) +>date : Symbol(date, Decl(temporal.ts, 840, 9)) +>toPlainYearMonth : Symbol(Temporal.PlainDate.toPlainYearMonth, Decl(lib.esnext.temporal.d.ts, --, --)) + + date.toPlainMonthDay(); // => 08-24 +>date.toPlainMonthDay : Symbol(Temporal.PlainDate.toPlainMonthDay, Decl(lib.esnext.temporal.d.ts, --, --)) +>date : Symbol(date, Decl(temporal.ts, 840, 9)) +>toPlainMonthDay : Symbol(Temporal.PlainDate.toPlainMonthDay, Decl(lib.esnext.temporal.d.ts, --, --)) +} + +{ + // Leet hour + const time = new Temporal.PlainTime(13, 37); // => 13:37:00 +>time : Symbol(time, Decl(temporal.ts, 847, 9)) +>Temporal.PlainTime : Symbol(Temporal.PlainTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainTime : Symbol(Temporal.PlainTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +} + +{ + let time: Temporal.PlainTime; +>time : Symbol(time, Decl(temporal.ts, 851, 7)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainTime : Symbol(Temporal.PlainTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) + + time = Temporal.PlainTime.from("03:24:30"); // => 03:24:30 +>time : Symbol(time, Decl(temporal.ts, 851, 7)) +>Temporal.PlainTime.from : Symbol(Temporal.PlainTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainTime : Symbol(Temporal.PlainTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainTime : Symbol(Temporal.PlainTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.PlainTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) + + time = Temporal.PlainTime.from("032430"); // => 03:24:30 +>time : Symbol(time, Decl(temporal.ts, 851, 7)) +>Temporal.PlainTime.from : Symbol(Temporal.PlainTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainTime : Symbol(Temporal.PlainTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainTime : Symbol(Temporal.PlainTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.PlainTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) + + time = Temporal.PlainTime.from("1995-12-07T03:24:30"); // => 03:24:30 +>time : Symbol(time, Decl(temporal.ts, 851, 7)) +>Temporal.PlainTime.from : Symbol(Temporal.PlainTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainTime : Symbol(Temporal.PlainTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainTime : Symbol(Temporal.PlainTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.PlainTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) + + time = Temporal.PlainTime.from("1995-12-07T03:24:30+01:00[Europe/Brussels]"); +>time : Symbol(time, Decl(temporal.ts, 851, 7)) +>Temporal.PlainTime.from : Symbol(Temporal.PlainTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainTime : Symbol(Temporal.PlainTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainTime : Symbol(Temporal.PlainTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.PlainTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) + + // => 03:24:30 + // (same as above; time zone is ignored) + time === Temporal.PlainTime.from(time); // => false +>time : Symbol(time, Decl(temporal.ts, 851, 7)) +>Temporal.PlainTime.from : Symbol(Temporal.PlainTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainTime : Symbol(Temporal.PlainTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainTime : Symbol(Temporal.PlainTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.PlainTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>time : Symbol(time, Decl(temporal.ts, 851, 7)) + + time = Temporal.PlainTime.from({ +>time : Symbol(time, Decl(temporal.ts, 851, 7)) +>Temporal.PlainTime.from : Symbol(Temporal.PlainTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainTime : Symbol(Temporal.PlainTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainTime : Symbol(Temporal.PlainTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.PlainTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) + + hour: 19, +>hour : Symbol(hour, Decl(temporal.ts, 861, 36)) + + minute: 39, +>minute : Symbol(minute, Decl(temporal.ts, 862, 17)) + + second: 9, +>second : Symbol(second, Decl(temporal.ts, 863, 19)) + + millisecond: 68, +>millisecond : Symbol(millisecond, Decl(temporal.ts, 864, 18)) + + microsecond: 346, +>microsecond : Symbol(microsecond, Decl(temporal.ts, 865, 24)) + + nanosecond: 205, +>nanosecond : Symbol(nanosecond, Decl(temporal.ts, 866, 25)) + + }); // => 19:39:09.068346205 + time = Temporal.PlainTime.from({ hour: 19, minute: 39, second: 9 }); // => 19:39:09 +>time : Symbol(time, Decl(temporal.ts, 851, 7)) +>Temporal.PlainTime.from : Symbol(Temporal.PlainTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainTime : Symbol(Temporal.PlainTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainTime : Symbol(Temporal.PlainTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.PlainTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>hour : Symbol(hour, Decl(temporal.ts, 869, 36)) +>minute : Symbol(minute, Decl(temporal.ts, 869, 46)) +>second : Symbol(second, Decl(temporal.ts, 869, 58)) + + time = Temporal.PlainTime.from(Temporal.PlainDateTime.from("2020-02-15T19:39:09")); +>time : Symbol(time, Decl(temporal.ts, 851, 7)) +>Temporal.PlainTime.from : Symbol(Temporal.PlainTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainTime : Symbol(Temporal.PlainTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainTime : Symbol(Temporal.PlainTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.PlainTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainDateTime.from : Symbol(Temporal.PlainDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainDateTime : Symbol(Temporal.PlainDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainDateTime : Symbol(Temporal.PlainDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.PlainDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) + + // => 19:39:09 + // (same as above; Temporal.PlainDateTime has hour, minute, etc. properties) + + // Different overflow modes + time = Temporal.PlainTime.from({ hour: 15, minute: 60 }, { overflow: "constrain" }); +>time : Symbol(time, Decl(temporal.ts, 851, 7)) +>Temporal.PlainTime.from : Symbol(Temporal.PlainTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainTime : Symbol(Temporal.PlainTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainTime : Symbol(Temporal.PlainTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.PlainTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>hour : Symbol(hour, Decl(temporal.ts, 875, 36)) +>minute : Symbol(minute, Decl(temporal.ts, 875, 46)) +>overflow : Symbol(overflow, Decl(temporal.ts, 875, 62)) + + // => 15:59:00 + time = Temporal.PlainTime.from({ hour: 15, minute: -1 }, { overflow: "constrain" }); +>time : Symbol(time, Decl(temporal.ts, 851, 7)) +>Temporal.PlainTime.from : Symbol(Temporal.PlainTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainTime : Symbol(Temporal.PlainTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainTime : Symbol(Temporal.PlainTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.PlainTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>hour : Symbol(hour, Decl(temporal.ts, 877, 36)) +>minute : Symbol(minute, Decl(temporal.ts, 877, 46)) +>overflow : Symbol(overflow, Decl(temporal.ts, 877, 62)) + + // => 15:00:00 + time = Temporal.PlainTime.from({ hour: 15, minute: 60 }, { overflow: "reject" }); +>time : Symbol(time, Decl(temporal.ts, 851, 7)) +>Temporal.PlainTime.from : Symbol(Temporal.PlainTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainTime : Symbol(Temporal.PlainTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainTime : Symbol(Temporal.PlainTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.PlainTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>hour : Symbol(hour, Decl(temporal.ts, 879, 36)) +>minute : Symbol(minute, Decl(temporal.ts, 879, 46)) +>overflow : Symbol(overflow, Decl(temporal.ts, 879, 62)) + + // => throws + time = Temporal.PlainTime.from({ hour: 15, minute: -1 }, { overflow: "reject" }); +>time : Symbol(time, Decl(temporal.ts, 851, 7)) +>Temporal.PlainTime.from : Symbol(Temporal.PlainTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainTime : Symbol(Temporal.PlainTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainTime : Symbol(Temporal.PlainTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.PlainTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>hour : Symbol(hour, Decl(temporal.ts, 881, 36)) +>minute : Symbol(minute, Decl(temporal.ts, 881, 46)) +>overflow : Symbol(overflow, Decl(temporal.ts, 881, 62)) + + // => throws +} + +{ + const one = Temporal.PlainTime.from("03:24"); +>one : Symbol(one, Decl(temporal.ts, 886, 9)) +>Temporal.PlainTime.from : Symbol(Temporal.PlainTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainTime : Symbol(Temporal.PlainTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainTime : Symbol(Temporal.PlainTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.PlainTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) + + const two = Temporal.PlainTime.from("01:24"); +>two : Symbol(two, Decl(temporal.ts, 887, 9)) +>Temporal.PlainTime.from : Symbol(Temporal.PlainTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainTime : Symbol(Temporal.PlainTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainTime : Symbol(Temporal.PlainTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.PlainTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) + + const three = Temporal.PlainTime.from("01:24:05"); +>three : Symbol(three, Decl(temporal.ts, 888, 9)) +>Temporal.PlainTime.from : Symbol(Temporal.PlainTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainTime : Symbol(Temporal.PlainTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainTime : Symbol(Temporal.PlainTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.PlainTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) + + const sorted = [one, two, three].sort(Temporal.PlainTime.compare); +>sorted : Symbol(sorted, Decl(temporal.ts, 889, 9)) +>[one, two, three].sort : Symbol(Array.sort, Decl(lib.es5.d.ts, --, --)) +>one : Symbol(one, Decl(temporal.ts, 886, 9)) +>two : Symbol(two, Decl(temporal.ts, 887, 9)) +>three : Symbol(three, Decl(temporal.ts, 888, 9)) +>sort : Symbol(Array.sort, Decl(lib.es5.d.ts, --, --)) +>Temporal.PlainTime.compare : Symbol(Temporal.PlainTimeConstructor.compare, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainTime : Symbol(Temporal.PlainTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainTime : Symbol(Temporal.PlainTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>compare : Symbol(Temporal.PlainTimeConstructor.compare, Decl(lib.esnext.temporal.d.ts, --, --)) + + sorted.join(" "); // => '01:24:00 01:24:05 03:24:00' +>sorted.join : Symbol(Array.join, Decl(lib.es5.d.ts, --, --)) +>sorted : Symbol(sorted, Decl(temporal.ts, 889, 9)) +>join : Symbol(Array.join, Decl(lib.es5.d.ts, --, --)) +} + +{ + // Backward transitions will repeat clock times + const zdtDst = Temporal.ZonedDateTime.from("2020-11-01T01:45-07:00[America/Los_Angeles]"); +>zdtDst : Symbol(zdtDst, Decl(temporal.ts, 895, 9)) +>Temporal.ZonedDateTime.from : Symbol(Temporal.ZonedDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.ZonedDateTime : Symbol(Temporal.ZonedDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>ZonedDateTime : Symbol(Temporal.ZonedDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.ZonedDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) + + const zdtStandard = Temporal.ZonedDateTime.from("2020-11-01T01:30-08:00[America/Los_Angeles]"); +>zdtStandard : Symbol(zdtStandard, Decl(temporal.ts, 896, 9)) +>Temporal.ZonedDateTime.from : Symbol(Temporal.ZonedDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.ZonedDateTime : Symbol(Temporal.ZonedDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>ZonedDateTime : Symbol(Temporal.ZonedDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.ZonedDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) + + // The "first" 1:45 (in Daylight Time) is earlier than the "second" 1:30 (in Standard Time) + Temporal.ZonedDateTime.compare(zdtDst, zdtStandard); // => -1 +>Temporal.ZonedDateTime.compare : Symbol(Temporal.ZonedDateTimeConstructor.compare, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.ZonedDateTime : Symbol(Temporal.ZonedDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>ZonedDateTime : Symbol(Temporal.ZonedDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>compare : Symbol(Temporal.ZonedDateTimeConstructor.compare, Decl(lib.esnext.temporal.d.ts, --, --)) +>zdtDst : Symbol(zdtDst, Decl(temporal.ts, 895, 9)) +>zdtStandard : Symbol(zdtStandard, Decl(temporal.ts, 896, 9)) + + // 1:45 is later than 1:30 when looking at a wall clock + Temporal.PlainTime.compare(zdtDst, zdtStandard); // => 1 +>Temporal.PlainTime.compare : Symbol(Temporal.PlainTimeConstructor.compare, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainTime : Symbol(Temporal.PlainTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainTime : Symbol(Temporal.PlainTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>compare : Symbol(Temporal.PlainTimeConstructor.compare, Decl(lib.esnext.temporal.d.ts, --, --)) +>zdtDst : Symbol(zdtDst, Decl(temporal.ts, 895, 9)) +>zdtStandard : Symbol(zdtStandard, Decl(temporal.ts, 896, 9)) + + // Forward transitions will skip clock times. Skipped times will be disambiguated. + const zdtBase = Temporal.ZonedDateTime.from("2020-03-08[America/Los_Angeles]"); +>zdtBase : Symbol(zdtBase, Decl(temporal.ts, 903, 9)) +>Temporal.ZonedDateTime.from : Symbol(Temporal.ZonedDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.ZonedDateTime : Symbol(Temporal.ZonedDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>ZonedDateTime : Symbol(Temporal.ZonedDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.ZonedDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) + + const timeSkipped = Temporal.PlainTime.from("02:30"); +>timeSkipped : Symbol(timeSkipped, Decl(temporal.ts, 904, 9)) +>Temporal.PlainTime.from : Symbol(Temporal.PlainTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainTime : Symbol(Temporal.PlainTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainTime : Symbol(Temporal.PlainTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.PlainTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) + + const timeValid = Temporal.PlainTime.from("03:30"); +>timeValid : Symbol(timeValid, Decl(temporal.ts, 905, 9)) +>Temporal.PlainTime.from : Symbol(Temporal.PlainTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainTime : Symbol(Temporal.PlainTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainTime : Symbol(Temporal.PlainTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.PlainTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) + + const zdtSkipped = zdtBase.withPlainTime(timeSkipped); +>zdtSkipped : Symbol(zdtSkipped, Decl(temporal.ts, 906, 9)) +>zdtBase.withPlainTime : Symbol(Temporal.ZonedDateTime.withPlainTime, Decl(lib.esnext.temporal.d.ts, --, --)) +>zdtBase : Symbol(zdtBase, Decl(temporal.ts, 903, 9)) +>withPlainTime : Symbol(Temporal.ZonedDateTime.withPlainTime, Decl(lib.esnext.temporal.d.ts, --, --)) +>timeSkipped : Symbol(timeSkipped, Decl(temporal.ts, 904, 9)) + + const zdtValid = zdtBase.withPlainTime(timeValid); +>zdtValid : Symbol(zdtValid, Decl(temporal.ts, 907, 9)) +>zdtBase.withPlainTime : Symbol(Temporal.ZonedDateTime.withPlainTime, Decl(lib.esnext.temporal.d.ts, --, --)) +>zdtBase : Symbol(zdtBase, Decl(temporal.ts, 903, 9)) +>withPlainTime : Symbol(Temporal.ZonedDateTime.withPlainTime, Decl(lib.esnext.temporal.d.ts, --, --)) +>timeValid : Symbol(timeValid, Decl(temporal.ts, 905, 9)) + + // The skipped time 2:30AM is disambiguated to 3:30AM, so the instants are equal + Temporal.ZonedDateTime.compare(zdtSkipped, zdtValid); // => 0 +>Temporal.ZonedDateTime.compare : Symbol(Temporal.ZonedDateTimeConstructor.compare, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.ZonedDateTime : Symbol(Temporal.ZonedDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>ZonedDateTime : Symbol(Temporal.ZonedDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>compare : Symbol(Temporal.ZonedDateTimeConstructor.compare, Decl(lib.esnext.temporal.d.ts, --, --)) +>zdtSkipped : Symbol(zdtSkipped, Decl(temporal.ts, 906, 9)) +>zdtValid : Symbol(zdtValid, Decl(temporal.ts, 907, 9)) + + // 2:30 is earlier than 3:30 on a wall clock + Temporal.PlainTime.compare(timeSkipped, timeValid); // => -1 +>Temporal.PlainTime.compare : Symbol(Temporal.PlainTimeConstructor.compare, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainTime : Symbol(Temporal.PlainTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainTime : Symbol(Temporal.PlainTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>compare : Symbol(Temporal.PlainTimeConstructor.compare, Decl(lib.esnext.temporal.d.ts, --, --)) +>timeSkipped : Symbol(timeSkipped, Decl(temporal.ts, 904, 9)) +>timeValid : Symbol(timeValid, Decl(temporal.ts, 905, 9)) +} + +{ + const time = Temporal.PlainTime.from("19:39:09.068346205"); +>time : Symbol(time, Decl(temporal.ts, 915, 9)) +>Temporal.PlainTime.from : Symbol(Temporal.PlainTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainTime : Symbol(Temporal.PlainTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainTime : Symbol(Temporal.PlainTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.PlainTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) + + time.hour; // => 19 +>time.hour : Symbol(Temporal.PlainTime.hour, Decl(lib.esnext.temporal.d.ts, --, --)) +>time : Symbol(time, Decl(temporal.ts, 915, 9)) +>hour : Symbol(Temporal.PlainTime.hour, Decl(lib.esnext.temporal.d.ts, --, --)) + + time.minute; // => 39 +>time.minute : Symbol(Temporal.PlainTime.minute, Decl(lib.esnext.temporal.d.ts, --, --)) +>time : Symbol(time, Decl(temporal.ts, 915, 9)) +>minute : Symbol(Temporal.PlainTime.minute, Decl(lib.esnext.temporal.d.ts, --, --)) + + time.second; // => 9 +>time.second : Symbol(Temporal.PlainTime.second, Decl(lib.esnext.temporal.d.ts, --, --)) +>time : Symbol(time, Decl(temporal.ts, 915, 9)) +>second : Symbol(Temporal.PlainTime.second, Decl(lib.esnext.temporal.d.ts, --, --)) + + time.millisecond; // => 68 +>time.millisecond : Symbol(Temporal.PlainTime.millisecond, Decl(lib.esnext.temporal.d.ts, --, --)) +>time : Symbol(time, Decl(temporal.ts, 915, 9)) +>millisecond : Symbol(Temporal.PlainTime.millisecond, Decl(lib.esnext.temporal.d.ts, --, --)) + + time.microsecond; // => 346 +>time.microsecond : Symbol(Temporal.PlainTime.microsecond, Decl(lib.esnext.temporal.d.ts, --, --)) +>time : Symbol(time, Decl(temporal.ts, 915, 9)) +>microsecond : Symbol(Temporal.PlainTime.microsecond, Decl(lib.esnext.temporal.d.ts, --, --)) + + time.nanosecond; // => 205 +>time.nanosecond : Symbol(Temporal.PlainTime.nanosecond, Decl(lib.esnext.temporal.d.ts, --, --)) +>time : Symbol(time, Decl(temporal.ts, 915, 9)) +>nanosecond : Symbol(Temporal.PlainTime.nanosecond, Decl(lib.esnext.temporal.d.ts, --, --)) +} + +{ + const time = Temporal.PlainTime.from("19:39:09.068346205"); +>time : Symbol(time, Decl(temporal.ts, 925, 9)) +>Temporal.PlainTime.from : Symbol(Temporal.PlainTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainTime : Symbol(Temporal.PlainTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainTime : Symbol(Temporal.PlainTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.PlainTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) + + // What's the top of the next hour? + time.add({ hours: 1 }).with({ +>time.add({ hours: 1 }).with : Symbol(Temporal.PlainTime.with, Decl(lib.esnext.temporal.d.ts, --, --)) +>time.add : Symbol(Temporal.PlainTime.add, Decl(lib.esnext.temporal.d.ts, --, --)) +>time : Symbol(time, Decl(temporal.ts, 925, 9)) +>add : Symbol(Temporal.PlainTime.add, Decl(lib.esnext.temporal.d.ts, --, --)) +>hours : Symbol(hours, Decl(temporal.ts, 927, 14)) +>with : Symbol(Temporal.PlainTime.with, Decl(lib.esnext.temporal.d.ts, --, --)) + + minute: 0, +>minute : Symbol(minute, Decl(temporal.ts, 927, 33)) + + second: 0, +>second : Symbol(second, Decl(temporal.ts, 928, 18)) + + millisecond: 0, +>millisecond : Symbol(millisecond, Decl(temporal.ts, 929, 18)) + + microsecond: 0, +>microsecond : Symbol(microsecond, Decl(temporal.ts, 930, 23)) + + nanosecond: 0, +>nanosecond : Symbol(nanosecond, Decl(temporal.ts, 931, 23)) + + }); // => 20:00:00 +} + +{ + const time = Temporal.PlainTime.from("19:39:09.068346205"); +>time : Symbol(time, Decl(temporal.ts, 937, 9)) +>Temporal.PlainTime.from : Symbol(Temporal.PlainTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainTime : Symbol(Temporal.PlainTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainTime : Symbol(Temporal.PlainTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.PlainTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) + + time.add({ minutes: 5, nanoseconds: 800 }); // => 19:44:09.068347005 +>time.add : Symbol(Temporal.PlainTime.add, Decl(lib.esnext.temporal.d.ts, --, --)) +>time : Symbol(time, Decl(temporal.ts, 937, 9)) +>add : Symbol(Temporal.PlainTime.add, Decl(lib.esnext.temporal.d.ts, --, --)) +>minutes : Symbol(minutes, Decl(temporal.ts, 938, 14)) +>nanoseconds : Symbol(nanoseconds, Decl(temporal.ts, 938, 26)) +} + +{ + const time = Temporal.PlainTime.from("19:39:09.068346205"); +>time : Symbol(time, Decl(temporal.ts, 942, 9)) +>Temporal.PlainTime.from : Symbol(Temporal.PlainTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainTime : Symbol(Temporal.PlainTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainTime : Symbol(Temporal.PlainTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.PlainTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) + + time.subtract({ minutes: 5, nanoseconds: 800 }); // => 19:34:09.068345405 +>time.subtract : Symbol(Temporal.PlainTime.subtract, Decl(lib.esnext.temporal.d.ts, --, --)) +>time : Symbol(time, Decl(temporal.ts, 942, 9)) +>subtract : Symbol(Temporal.PlainTime.subtract, Decl(lib.esnext.temporal.d.ts, --, --)) +>minutes : Symbol(minutes, Decl(temporal.ts, 943, 19)) +>nanoseconds : Symbol(nanoseconds, Decl(temporal.ts, 943, 31)) +} + +{ + const time = Temporal.PlainTime.from("20:13:20.971398099"); +>time : Symbol(time, Decl(temporal.ts, 947, 9)) +>Temporal.PlainTime.from : Symbol(Temporal.PlainTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainTime : Symbol(Temporal.PlainTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainTime : Symbol(Temporal.PlainTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.PlainTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) + + time.until(Temporal.PlainTime.from("22:39:09.068346205")); // => PT2H25M48.096948106S +>time.until : Symbol(Temporal.PlainTime.until, Decl(lib.esnext.temporal.d.ts, --, --)) +>time : Symbol(time, Decl(temporal.ts, 947, 9)) +>until : Symbol(Temporal.PlainTime.until, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainTime.from : Symbol(Temporal.PlainTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainTime : Symbol(Temporal.PlainTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainTime : Symbol(Temporal.PlainTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.PlainTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) + + time.until(Temporal.PlainTime.from("19:39:09.068346205")); // => -PT34M11.903051894S +>time.until : Symbol(Temporal.PlainTime.until, Decl(lib.esnext.temporal.d.ts, --, --)) +>time : Symbol(time, Decl(temporal.ts, 947, 9)) +>until : Symbol(Temporal.PlainTime.until, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainTime.from : Symbol(Temporal.PlainTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainTime : Symbol(Temporal.PlainTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainTime : Symbol(Temporal.PlainTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.PlainTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) + + // Rounding, for example if you don't care about sub-seconds + time.until(Temporal.PlainTime.from("22:39:09.068346205"), { smallestUnit: "second" }); +>time.until : Symbol(Temporal.PlainTime.until, Decl(lib.esnext.temporal.d.ts, --, --)) +>time : Symbol(time, Decl(temporal.ts, 947, 9)) +>until : Symbol(Temporal.PlainTime.until, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainTime.from : Symbol(Temporal.PlainTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainTime : Symbol(Temporal.PlainTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainTime : Symbol(Temporal.PlainTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.PlainTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>smallestUnit : Symbol(smallestUnit, Decl(temporal.ts, 952, 63)) + + // => PT2H25M48S +} + +{ + const time = Temporal.PlainTime.from("20:13:20.971398099"); +>time : Symbol(time, Decl(temporal.ts, 957, 9)) +>Temporal.PlainTime.from : Symbol(Temporal.PlainTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainTime : Symbol(Temporal.PlainTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainTime : Symbol(Temporal.PlainTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.PlainTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) + + time.since(Temporal.PlainTime.from("19:39:09.068346205")); // => PT34M11.903051894S +>time.since : Symbol(Temporal.PlainTime.since, Decl(lib.esnext.temporal.d.ts, --, --)) +>time : Symbol(time, Decl(temporal.ts, 957, 9)) +>since : Symbol(Temporal.PlainTime.since, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainTime.from : Symbol(Temporal.PlainTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainTime : Symbol(Temporal.PlainTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainTime : Symbol(Temporal.PlainTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.PlainTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) + + time.since(Temporal.PlainTime.from("22:39:09.068346205")); // => -PT2H25M48.096948106S +>time.since : Symbol(Temporal.PlainTime.since, Decl(lib.esnext.temporal.d.ts, --, --)) +>time : Symbol(time, Decl(temporal.ts, 957, 9)) +>since : Symbol(Temporal.PlainTime.since, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainTime.from : Symbol(Temporal.PlainTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainTime : Symbol(Temporal.PlainTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainTime : Symbol(Temporal.PlainTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.PlainTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +} + +{ + const time = Temporal.PlainTime.from("19:39:09.068346205"); +>time : Symbol(time, Decl(temporal.ts, 963, 9)) +>Temporal.PlainTime.from : Symbol(Temporal.PlainTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainTime : Symbol(Temporal.PlainTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainTime : Symbol(Temporal.PlainTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.PlainTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) + + // Round to a particular unit + time.round({ smallestUnit: "hour" }); // => 20:00:00 +>time.round : Symbol(Temporal.PlainTime.round, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>time : Symbol(time, Decl(temporal.ts, 963, 9)) +>round : Symbol(Temporal.PlainTime.round, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>smallestUnit : Symbol(smallestUnit, Decl(temporal.ts, 966, 16)) + + // Round to an increment of a unit, e.g. half an hour: + time.round({ roundingIncrement: 30, smallestUnit: "minute" }); +>time.round : Symbol(Temporal.PlainTime.round, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>time : Symbol(time, Decl(temporal.ts, 963, 9)) +>round : Symbol(Temporal.PlainTime.round, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>roundingIncrement : Symbol(roundingIncrement, Decl(temporal.ts, 968, 16)) +>smallestUnit : Symbol(smallestUnit, Decl(temporal.ts, 968, 39)) + + // => 19:30:00 + // Round to the same increment but round up instead: + time.round({ roundingIncrement: 30, smallestUnit: "minute", roundingMode: "ceil" }); +>time.round : Symbol(Temporal.PlainTime.round, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>time : Symbol(time, Decl(temporal.ts, 963, 9)) +>round : Symbol(Temporal.PlainTime.round, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>roundingIncrement : Symbol(roundingIncrement, Decl(temporal.ts, 971, 16)) +>smallestUnit : Symbol(smallestUnit, Decl(temporal.ts, 971, 39)) +>roundingMode : Symbol(roundingMode, Decl(temporal.ts, 971, 63)) + + // => 20:00:00 +} + +{ + const time = Temporal.PlainTime.from("19:39:09.068346205"); +>time : Symbol(time, Decl(temporal.ts, 976, 9)) +>Temporal.PlainTime.from : Symbol(Temporal.PlainTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainTime : Symbol(Temporal.PlainTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainTime : Symbol(Temporal.PlainTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.PlainTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) + + const other = Temporal.PlainTime.from("20:13:20.971398099"); +>other : Symbol(other, Decl(temporal.ts, 977, 9)) +>Temporal.PlainTime.from : Symbol(Temporal.PlainTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainTime : Symbol(Temporal.PlainTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainTime : Symbol(Temporal.PlainTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.PlainTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) + + time.equals(other); // => false +>time.equals : Symbol(Temporal.PlainTime.equals, Decl(lib.esnext.temporal.d.ts, --, --)) +>time : Symbol(time, Decl(temporal.ts, 976, 9)) +>equals : Symbol(Temporal.PlainTime.equals, Decl(lib.esnext.temporal.d.ts, --, --)) +>other : Symbol(other, Decl(temporal.ts, 977, 9)) + + time.equals(time); // => true +>time.equals : Symbol(Temporal.PlainTime.equals, Decl(lib.esnext.temporal.d.ts, --, --)) +>time : Symbol(time, Decl(temporal.ts, 976, 9)) +>equals : Symbol(Temporal.PlainTime.equals, Decl(lib.esnext.temporal.d.ts, --, --)) +>time : Symbol(time, Decl(temporal.ts, 976, 9)) +} + +{ + const time = Temporal.PlainTime.from("19:39:09.068346205"); +>time : Symbol(time, Decl(temporal.ts, 983, 9)) +>Temporal.PlainTime.from : Symbol(Temporal.PlainTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainTime : Symbol(Temporal.PlainTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainTime : Symbol(Temporal.PlainTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.PlainTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) + + time.toString(); // => '19:39:09.068346205' +>time.toString : Symbol(Temporal.PlainTime.toString, Decl(lib.esnext.temporal.d.ts, --, --)) +>time : Symbol(time, Decl(temporal.ts, 983, 9)) +>toString : Symbol(Temporal.PlainTime.toString, Decl(lib.esnext.temporal.d.ts, --, --)) + + time.toString({ smallestUnit: "minute" }); // => '19:39' +>time.toString : Symbol(Temporal.PlainTime.toString, Decl(lib.esnext.temporal.d.ts, --, --)) +>time : Symbol(time, Decl(temporal.ts, 983, 9)) +>toString : Symbol(Temporal.PlainTime.toString, Decl(lib.esnext.temporal.d.ts, --, --)) +>smallestUnit : Symbol(smallestUnit, Decl(temporal.ts, 986, 19)) + + time.toString({ fractionalSecondDigits: 0 }); // => '19:39:09' +>time.toString : Symbol(Temporal.PlainTime.toString, Decl(lib.esnext.temporal.d.ts, --, --)) +>time : Symbol(time, Decl(temporal.ts, 983, 9)) +>toString : Symbol(Temporal.PlainTime.toString, Decl(lib.esnext.temporal.d.ts, --, --)) +>fractionalSecondDigits : Symbol(fractionalSecondDigits, Decl(temporal.ts, 987, 19)) + + time.toString({ fractionalSecondDigits: 4 }); // => '19:39:09.0683' +>time.toString : Symbol(Temporal.PlainTime.toString, Decl(lib.esnext.temporal.d.ts, --, --)) +>time : Symbol(time, Decl(temporal.ts, 983, 9)) +>toString : Symbol(Temporal.PlainTime.toString, Decl(lib.esnext.temporal.d.ts, --, --)) +>fractionalSecondDigits : Symbol(fractionalSecondDigits, Decl(temporal.ts, 988, 19)) + + time.toString({ fractionalSecondDigits: 5, roundingMode: "halfExpand" }); +>time.toString : Symbol(Temporal.PlainTime.toString, Decl(lib.esnext.temporal.d.ts, --, --)) +>time : Symbol(time, Decl(temporal.ts, 983, 9)) +>toString : Symbol(Temporal.PlainTime.toString, Decl(lib.esnext.temporal.d.ts, --, --)) +>fractionalSecondDigits : Symbol(fractionalSecondDigits, Decl(temporal.ts, 989, 19)) +>roundingMode : Symbol(roundingMode, Decl(temporal.ts, 989, 46)) + + // => '19:39:09.06835' +} + +{ + const time = Temporal.PlainTime.from("19:39:09.068346205"); +>time : Symbol(time, Decl(temporal.ts, 994, 9)) +>Temporal.PlainTime.from : Symbol(Temporal.PlainTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainTime : Symbol(Temporal.PlainTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainTime : Symbol(Temporal.PlainTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.PlainTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) + + time.toLocaleString(); // example output: '7:39:09 PM' +>time.toLocaleString : Symbol(Temporal.PlainTime.toLocaleString, Decl(lib.esnext.temporal.d.ts, --, --)) +>time : Symbol(time, Decl(temporal.ts, 994, 9)) +>toLocaleString : Symbol(Temporal.PlainTime.toLocaleString, Decl(lib.esnext.temporal.d.ts, --, --)) + + time.toLocaleString("de-DE"); // example output: '19:39:09' +>time.toLocaleString : Symbol(Temporal.PlainTime.toLocaleString, Decl(lib.esnext.temporal.d.ts, --, --)) +>time : Symbol(time, Decl(temporal.ts, 994, 9)) +>toLocaleString : Symbol(Temporal.PlainTime.toLocaleString, Decl(lib.esnext.temporal.d.ts, --, --)) + + time.toLocaleString("de-DE", { timeZone: "Europe/Berlin" }); // => '19:39:09' +>time.toLocaleString : Symbol(Temporal.PlainTime.toLocaleString, Decl(lib.esnext.temporal.d.ts, --, --)) +>time : Symbol(time, Decl(temporal.ts, 994, 9)) +>toLocaleString : Symbol(Temporal.PlainTime.toLocaleString, Decl(lib.esnext.temporal.d.ts, --, --)) +>timeZone : Symbol(timeZone, Decl(temporal.ts, 997, 34)) + + time.toLocaleString("en-US-u-nu-fullwide-hc-h24"); // => '19:39:09' +>time.toLocaleString : Symbol(Temporal.PlainTime.toLocaleString, Decl(lib.esnext.temporal.d.ts, --, --)) +>time : Symbol(time, Decl(temporal.ts, 994, 9)) +>toLocaleString : Symbol(Temporal.PlainTime.toLocaleString, Decl(lib.esnext.temporal.d.ts, --, --)) +} + +{ + // Leet hour on pi day in 2020 + const datetime = new Temporal.PlainDateTime(2020, 3, 14, 13, 37); // => 2020-03-14T13:37:00 +>datetime : Symbol(datetime, Decl(temporal.ts, 1003, 9)) +>Temporal.PlainDateTime : Symbol(Temporal.PlainDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainDateTime : Symbol(Temporal.PlainDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +} + +{ + let dt: Temporal.PlainDateTime; +>dt : Symbol(dt, Decl(temporal.ts, 1007, 7)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainDateTime : Symbol(Temporal.PlainDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) + + dt = Temporal.PlainDateTime.from("1995-12-07T03:24:30"); +>dt : Symbol(dt, Decl(temporal.ts, 1007, 7)) +>Temporal.PlainDateTime.from : Symbol(Temporal.PlainDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainDateTime : Symbol(Temporal.PlainDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainDateTime : Symbol(Temporal.PlainDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.PlainDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) + + dt = Temporal.PlainDateTime.from("19951207T032430"); +>dt : Symbol(dt, Decl(temporal.ts, 1007, 7)) +>Temporal.PlainDateTime.from : Symbol(Temporal.PlainDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainDateTime : Symbol(Temporal.PlainDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainDateTime : Symbol(Temporal.PlainDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.PlainDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) + + dt = Temporal.PlainDateTime.from("1995-12-07T03:24:30+01:00[Europe/Brussels]"); +>dt : Symbol(dt, Decl(temporal.ts, 1007, 7)) +>Temporal.PlainDateTime.from : Symbol(Temporal.PlainDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainDateTime : Symbol(Temporal.PlainDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainDateTime : Symbol(Temporal.PlainDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.PlainDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) + + // => 1995-12-07T03:24:30 + // same as above; time zone is ignored + dt === Temporal.PlainDateTime.from(dt); // => false +>dt : Symbol(dt, Decl(temporal.ts, 1007, 7)) +>Temporal.PlainDateTime.from : Symbol(Temporal.PlainDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainDateTime : Symbol(Temporal.PlainDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainDateTime : Symbol(Temporal.PlainDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.PlainDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>dt : Symbol(dt, Decl(temporal.ts, 1007, 7)) + + dt = Temporal.PlainDateTime.from({ +>dt : Symbol(dt, Decl(temporal.ts, 1007, 7)) +>Temporal.PlainDateTime.from : Symbol(Temporal.PlainDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainDateTime : Symbol(Temporal.PlainDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainDateTime : Symbol(Temporal.PlainDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.PlainDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) + + year: 1995, +>year : Symbol(year, Decl(temporal.ts, 1016, 38)) + + month: 12, +>month : Symbol(month, Decl(temporal.ts, 1017, 19)) + + day: 7, +>day : Symbol(day, Decl(temporal.ts, 1018, 18)) + + hour: 3, +>hour : Symbol(hour, Decl(temporal.ts, 1019, 15)) + + minute: 24, +>minute : Symbol(minute, Decl(temporal.ts, 1020, 16)) + + second: 30, +>second : Symbol(second, Decl(temporal.ts, 1021, 19)) + + millisecond: 0, +>millisecond : Symbol(millisecond, Decl(temporal.ts, 1022, 19)) + + microsecond: 3, +>microsecond : Symbol(microsecond, Decl(temporal.ts, 1023, 23)) + + nanosecond: 500, +>nanosecond : Symbol(nanosecond, Decl(temporal.ts, 1024, 23)) + + }); // => 1995-12-07T03:24:30.0000035 + dt = Temporal.PlainDateTime.from({ year: 1995, month: 12, day: 7 }); // => 1995-12-07T00:00:00 +>dt : Symbol(dt, Decl(temporal.ts, 1007, 7)) +>Temporal.PlainDateTime.from : Symbol(Temporal.PlainDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainDateTime : Symbol(Temporal.PlainDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainDateTime : Symbol(Temporal.PlainDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.PlainDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>year : Symbol(year, Decl(temporal.ts, 1027, 38)) +>month : Symbol(month, Decl(temporal.ts, 1027, 50)) +>day : Symbol(day, Decl(temporal.ts, 1027, 61)) + + dt = Temporal.PlainDateTime.from(Temporal.PlainDate.from("1995-12-07T03:24:30")); +>dt : Symbol(dt, Decl(temporal.ts, 1007, 7)) +>Temporal.PlainDateTime.from : Symbol(Temporal.PlainDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainDateTime : Symbol(Temporal.PlainDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainDateTime : Symbol(Temporal.PlainDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.PlainDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainDate.from : Symbol(Temporal.PlainDateConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainDate : Symbol(Temporal.PlainDate, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainDate : Symbol(Temporal.PlainDate, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.PlainDateConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) + + // => 1995-12-07T00:00:00 + // same as above; Temporal.PlainDate has year, month, and day properties + + dt = Temporal.PlainDateTime.from({ year: 5756, month: 3, day: 14, hour: 3, minute: 24, second: 30, calendar: "hebrew" }); +>dt : Symbol(dt, Decl(temporal.ts, 1007, 7)) +>Temporal.PlainDateTime.from : Symbol(Temporal.PlainDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainDateTime : Symbol(Temporal.PlainDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainDateTime : Symbol(Temporal.PlainDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.PlainDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>year : Symbol(year, Decl(temporal.ts, 1032, 38)) +>month : Symbol(month, Decl(temporal.ts, 1032, 50)) +>day : Symbol(day, Decl(temporal.ts, 1032, 60)) +>hour : Symbol(hour, Decl(temporal.ts, 1032, 69)) +>minute : Symbol(minute, Decl(temporal.ts, 1032, 78)) +>second : Symbol(second, Decl(temporal.ts, 1032, 90)) +>calendar : Symbol(calendar, Decl(temporal.ts, 1032, 102)) + + // => 1995-12-07T03:24:30[u-ca=hebrew] + + // Different overflow modes + dt = Temporal.PlainDateTime.from({ year: 2001, month: 13, day: 1 }, { overflow: "constrain" }); +>dt : Symbol(dt, Decl(temporal.ts, 1007, 7)) +>Temporal.PlainDateTime.from : Symbol(Temporal.PlainDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainDateTime : Symbol(Temporal.PlainDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainDateTime : Symbol(Temporal.PlainDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.PlainDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>year : Symbol(year, Decl(temporal.ts, 1036, 38)) +>month : Symbol(month, Decl(temporal.ts, 1036, 50)) +>day : Symbol(day, Decl(temporal.ts, 1036, 61)) +>overflow : Symbol(overflow, Decl(temporal.ts, 1036, 73)) + + // => 2001-12-01T00:00:00 + dt = Temporal.PlainDateTime.from({ year: 2001, month: 1, day: 32 }, { overflow: "constrain" }); +>dt : Symbol(dt, Decl(temporal.ts, 1007, 7)) +>Temporal.PlainDateTime.from : Symbol(Temporal.PlainDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainDateTime : Symbol(Temporal.PlainDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainDateTime : Symbol(Temporal.PlainDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.PlainDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>year : Symbol(year, Decl(temporal.ts, 1038, 38)) +>month : Symbol(month, Decl(temporal.ts, 1038, 50)) +>day : Symbol(day, Decl(temporal.ts, 1038, 60)) +>overflow : Symbol(overflow, Decl(temporal.ts, 1038, 73)) + + // => 2001-01-31T00:00:00 + dt = Temporal.PlainDateTime.from({ year: 2001, month: 1, day: 1, hour: 25 }, { overflow: "constrain" }); +>dt : Symbol(dt, Decl(temporal.ts, 1007, 7)) +>Temporal.PlainDateTime.from : Symbol(Temporal.PlainDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainDateTime : Symbol(Temporal.PlainDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainDateTime : Symbol(Temporal.PlainDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.PlainDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>year : Symbol(year, Decl(temporal.ts, 1040, 38)) +>month : Symbol(month, Decl(temporal.ts, 1040, 50)) +>day : Symbol(day, Decl(temporal.ts, 1040, 60)) +>hour : Symbol(hour, Decl(temporal.ts, 1040, 68)) +>overflow : Symbol(overflow, Decl(temporal.ts, 1040, 82)) + + // => 2001-01-01T23:00:00 + dt = Temporal.PlainDateTime.from({ year: 2001, month: 1, day: 1, minute: 60 }, { overflow: "constrain" }); +>dt : Symbol(dt, Decl(temporal.ts, 1007, 7)) +>Temporal.PlainDateTime.from : Symbol(Temporal.PlainDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainDateTime : Symbol(Temporal.PlainDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainDateTime : Symbol(Temporal.PlainDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.PlainDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>year : Symbol(year, Decl(temporal.ts, 1042, 38)) +>month : Symbol(month, Decl(temporal.ts, 1042, 50)) +>day : Symbol(day, Decl(temporal.ts, 1042, 60)) +>minute : Symbol(minute, Decl(temporal.ts, 1042, 68)) +>overflow : Symbol(overflow, Decl(temporal.ts, 1042, 84)) + + // => 2001-01-01T00:59:00 + dt = Temporal.PlainDateTime.from({ year: 2001, month: 13, day: 1 }, { overflow: "reject" }); +>dt : Symbol(dt, Decl(temporal.ts, 1007, 7)) +>Temporal.PlainDateTime.from : Symbol(Temporal.PlainDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainDateTime : Symbol(Temporal.PlainDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainDateTime : Symbol(Temporal.PlainDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.PlainDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>year : Symbol(year, Decl(temporal.ts, 1044, 38)) +>month : Symbol(month, Decl(temporal.ts, 1044, 50)) +>day : Symbol(day, Decl(temporal.ts, 1044, 61)) +>overflow : Symbol(overflow, Decl(temporal.ts, 1044, 73)) + + // => throws + dt = Temporal.PlainDateTime.from({ year: 2001, month: 1, day: 32 }, { overflow: "reject" }); +>dt : Symbol(dt, Decl(temporal.ts, 1007, 7)) +>Temporal.PlainDateTime.from : Symbol(Temporal.PlainDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainDateTime : Symbol(Temporal.PlainDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainDateTime : Symbol(Temporal.PlainDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.PlainDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>year : Symbol(year, Decl(temporal.ts, 1046, 38)) +>month : Symbol(month, Decl(temporal.ts, 1046, 50)) +>day : Symbol(day, Decl(temporal.ts, 1046, 60)) +>overflow : Symbol(overflow, Decl(temporal.ts, 1046, 73)) + + // => throws + dt = Temporal.PlainDateTime.from({ year: 2001, month: 1, day: 1, hour: 25 }, { overflow: "reject" }); +>dt : Symbol(dt, Decl(temporal.ts, 1007, 7)) +>Temporal.PlainDateTime.from : Symbol(Temporal.PlainDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainDateTime : Symbol(Temporal.PlainDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainDateTime : Symbol(Temporal.PlainDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.PlainDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>year : Symbol(year, Decl(temporal.ts, 1048, 38)) +>month : Symbol(month, Decl(temporal.ts, 1048, 50)) +>day : Symbol(day, Decl(temporal.ts, 1048, 60)) +>hour : Symbol(hour, Decl(temporal.ts, 1048, 68)) +>overflow : Symbol(overflow, Decl(temporal.ts, 1048, 82)) + + // => throws + dt = Temporal.PlainDateTime.from({ year: 2001, month: 1, day: 1, minute: 60 }, { overflow: "reject" }); +>dt : Symbol(dt, Decl(temporal.ts, 1007, 7)) +>Temporal.PlainDateTime.from : Symbol(Temporal.PlainDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainDateTime : Symbol(Temporal.PlainDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainDateTime : Symbol(Temporal.PlainDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.PlainDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>year : Symbol(year, Decl(temporal.ts, 1050, 38)) +>month : Symbol(month, Decl(temporal.ts, 1050, 50)) +>day : Symbol(day, Decl(temporal.ts, 1050, 60)) +>minute : Symbol(minute, Decl(temporal.ts, 1050, 68)) +>overflow : Symbol(overflow, Decl(temporal.ts, 1050, 84)) + + // => throws +} + +{ + const one = Temporal.PlainDateTime.from("1995-12-07T03:24"); +>one : Symbol(one, Decl(temporal.ts, 1055, 9)) +>Temporal.PlainDateTime.from : Symbol(Temporal.PlainDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainDateTime : Symbol(Temporal.PlainDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainDateTime : Symbol(Temporal.PlainDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.PlainDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) + + const two = Temporal.PlainDateTime.from("1995-12-07T01:24"); +>two : Symbol(two, Decl(temporal.ts, 1056, 9)) +>Temporal.PlainDateTime.from : Symbol(Temporal.PlainDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainDateTime : Symbol(Temporal.PlainDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainDateTime : Symbol(Temporal.PlainDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.PlainDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) + + const three = Temporal.PlainDateTime.from("2015-12-07T01:24"); +>three : Symbol(three, Decl(temporal.ts, 1057, 9)) +>Temporal.PlainDateTime.from : Symbol(Temporal.PlainDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainDateTime : Symbol(Temporal.PlainDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainDateTime : Symbol(Temporal.PlainDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.PlainDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) + + const sorted = [one, two, three].sort(Temporal.PlainDateTime.compare); +>sorted : Symbol(sorted, Decl(temporal.ts, 1058, 9)) +>[one, two, three].sort : Symbol(Array.sort, Decl(lib.es5.d.ts, --, --)) +>one : Symbol(one, Decl(temporal.ts, 1055, 9)) +>two : Symbol(two, Decl(temporal.ts, 1056, 9)) +>three : Symbol(three, Decl(temporal.ts, 1057, 9)) +>sort : Symbol(Array.sort, Decl(lib.es5.d.ts, --, --)) +>Temporal.PlainDateTime.compare : Symbol(Temporal.PlainDateTimeConstructor.compare, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainDateTime : Symbol(Temporal.PlainDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainDateTime : Symbol(Temporal.PlainDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>compare : Symbol(Temporal.PlainDateTimeConstructor.compare, Decl(lib.esnext.temporal.d.ts, --, --)) + + sorted.join(" "); +>sorted.join : Symbol(Array.join, Decl(lib.es5.d.ts, --, --)) +>sorted : Symbol(sorted, Decl(temporal.ts, 1058, 9)) +>join : Symbol(Array.join, Decl(lib.es5.d.ts, --, --)) + + // => '1995-12-07T01:24:00 1995-12-07T03:24:00 2015-12-07T01:24:00' +} + +{ + let dt: Temporal.PlainDateTime; +>dt : Symbol(dt, Decl(temporal.ts, 1064, 7)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainDateTime : Symbol(Temporal.PlainDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) + + dt = Temporal.PlainDateTime.from("1995-12-07T03:24:30.000003500"); +>dt : Symbol(dt, Decl(temporal.ts, 1064, 7)) +>Temporal.PlainDateTime.from : Symbol(Temporal.PlainDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainDateTime : Symbol(Temporal.PlainDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainDateTime : Symbol(Temporal.PlainDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.PlainDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) + + dt.year; // => 1995 +>dt.year : Symbol(Temporal.PlainDateTime.year, Decl(lib.esnext.temporal.d.ts, --, --)) +>dt : Symbol(dt, Decl(temporal.ts, 1064, 7)) +>year : Symbol(Temporal.PlainDateTime.year, Decl(lib.esnext.temporal.d.ts, --, --)) + + dt.month; // => 12 +>dt.month : Symbol(Temporal.PlainDateTime.month, Decl(lib.esnext.temporal.d.ts, --, --)) +>dt : Symbol(dt, Decl(temporal.ts, 1064, 7)) +>month : Symbol(Temporal.PlainDateTime.month, Decl(lib.esnext.temporal.d.ts, --, --)) + + dt.monthCode; // => 'M12' +>dt.monthCode : Symbol(Temporal.PlainDateTime.monthCode, Decl(lib.esnext.temporal.d.ts, --, --)) +>dt : Symbol(dt, Decl(temporal.ts, 1064, 7)) +>monthCode : Symbol(Temporal.PlainDateTime.monthCode, Decl(lib.esnext.temporal.d.ts, --, --)) + + dt.day; // => 7 +>dt.day : Symbol(Temporal.PlainDateTime.day, Decl(lib.esnext.temporal.d.ts, --, --)) +>dt : Symbol(dt, Decl(temporal.ts, 1064, 7)) +>day : Symbol(Temporal.PlainDateTime.day, Decl(lib.esnext.temporal.d.ts, --, --)) + + dt.hour; // => 3 +>dt.hour : Symbol(Temporal.PlainDateTime.hour, Decl(lib.esnext.temporal.d.ts, --, --)) +>dt : Symbol(dt, Decl(temporal.ts, 1064, 7)) +>hour : Symbol(Temporal.PlainDateTime.hour, Decl(lib.esnext.temporal.d.ts, --, --)) + + dt.minute; // => 24 +>dt.minute : Symbol(Temporal.PlainDateTime.minute, Decl(lib.esnext.temporal.d.ts, --, --)) +>dt : Symbol(dt, Decl(temporal.ts, 1064, 7)) +>minute : Symbol(Temporal.PlainDateTime.minute, Decl(lib.esnext.temporal.d.ts, --, --)) + + dt.second; // => 30 +>dt.second : Symbol(Temporal.PlainDateTime.second, Decl(lib.esnext.temporal.d.ts, --, --)) +>dt : Symbol(dt, Decl(temporal.ts, 1064, 7)) +>second : Symbol(Temporal.PlainDateTime.second, Decl(lib.esnext.temporal.d.ts, --, --)) + + dt.millisecond; // => 0 +>dt.millisecond : Symbol(Temporal.PlainDateTime.millisecond, Decl(lib.esnext.temporal.d.ts, --, --)) +>dt : Symbol(dt, Decl(temporal.ts, 1064, 7)) +>millisecond : Symbol(Temporal.PlainDateTime.millisecond, Decl(lib.esnext.temporal.d.ts, --, --)) + + dt.microsecond; // => 3 +>dt.microsecond : Symbol(Temporal.PlainDateTime.microsecond, Decl(lib.esnext.temporal.d.ts, --, --)) +>dt : Symbol(dt, Decl(temporal.ts, 1064, 7)) +>microsecond : Symbol(Temporal.PlainDateTime.microsecond, Decl(lib.esnext.temporal.d.ts, --, --)) + + dt.nanosecond; // => 500 +>dt.nanosecond : Symbol(Temporal.PlainDateTime.nanosecond, Decl(lib.esnext.temporal.d.ts, --, --)) +>dt : Symbol(dt, Decl(temporal.ts, 1064, 7)) +>nanosecond : Symbol(Temporal.PlainDateTime.nanosecond, Decl(lib.esnext.temporal.d.ts, --, --)) + + dt = Temporal.PlainDateTime.from("2019-02-23T03:24:30.000003500[u-ca=hebrew]"); +>dt : Symbol(dt, Decl(temporal.ts, 1064, 7)) +>Temporal.PlainDateTime.from : Symbol(Temporal.PlainDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainDateTime : Symbol(Temporal.PlainDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainDateTime : Symbol(Temporal.PlainDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.PlainDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) + + dt.year; // => 5779 +>dt.year : Symbol(Temporal.PlainDateTime.year, Decl(lib.esnext.temporal.d.ts, --, --)) +>dt : Symbol(dt, Decl(temporal.ts, 1064, 7)) +>year : Symbol(Temporal.PlainDateTime.year, Decl(lib.esnext.temporal.d.ts, --, --)) + + dt.month; // => 6 +>dt.month : Symbol(Temporal.PlainDateTime.month, Decl(lib.esnext.temporal.d.ts, --, --)) +>dt : Symbol(dt, Decl(temporal.ts, 1064, 7)) +>month : Symbol(Temporal.PlainDateTime.month, Decl(lib.esnext.temporal.d.ts, --, --)) + + dt.monthCode; // => 'M05L' +>dt.monthCode : Symbol(Temporal.PlainDateTime.monthCode, Decl(lib.esnext.temporal.d.ts, --, --)) +>dt : Symbol(dt, Decl(temporal.ts, 1064, 7)) +>monthCode : Symbol(Temporal.PlainDateTime.monthCode, Decl(lib.esnext.temporal.d.ts, --, --)) + + dt.day; // => 18 +>dt.day : Symbol(Temporal.PlainDateTime.day, Decl(lib.esnext.temporal.d.ts, --, --)) +>dt : Symbol(dt, Decl(temporal.ts, 1064, 7)) +>day : Symbol(Temporal.PlainDateTime.day, Decl(lib.esnext.temporal.d.ts, --, --)) + + dt.hour; // => 3 +>dt.hour : Symbol(Temporal.PlainDateTime.hour, Decl(lib.esnext.temporal.d.ts, --, --)) +>dt : Symbol(dt, Decl(temporal.ts, 1064, 7)) +>hour : Symbol(Temporal.PlainDateTime.hour, Decl(lib.esnext.temporal.d.ts, --, --)) + + dt.minute; // => 24 +>dt.minute : Symbol(Temporal.PlainDateTime.minute, Decl(lib.esnext.temporal.d.ts, --, --)) +>dt : Symbol(dt, Decl(temporal.ts, 1064, 7)) +>minute : Symbol(Temporal.PlainDateTime.minute, Decl(lib.esnext.temporal.d.ts, --, --)) + + dt.second; // => 30 +>dt.second : Symbol(Temporal.PlainDateTime.second, Decl(lib.esnext.temporal.d.ts, --, --)) +>dt : Symbol(dt, Decl(temporal.ts, 1064, 7)) +>second : Symbol(Temporal.PlainDateTime.second, Decl(lib.esnext.temporal.d.ts, --, --)) + + dt.millisecond; // => 0 +>dt.millisecond : Symbol(Temporal.PlainDateTime.millisecond, Decl(lib.esnext.temporal.d.ts, --, --)) +>dt : Symbol(dt, Decl(temporal.ts, 1064, 7)) +>millisecond : Symbol(Temporal.PlainDateTime.millisecond, Decl(lib.esnext.temporal.d.ts, --, --)) + + dt.microsecond; // => 3 +>dt.microsecond : Symbol(Temporal.PlainDateTime.microsecond, Decl(lib.esnext.temporal.d.ts, --, --)) +>dt : Symbol(dt, Decl(temporal.ts, 1064, 7)) +>microsecond : Symbol(Temporal.PlainDateTime.microsecond, Decl(lib.esnext.temporal.d.ts, --, --)) + + dt.nanosecond; // => 500 +>dt.nanosecond : Symbol(Temporal.PlainDateTime.nanosecond, Decl(lib.esnext.temporal.d.ts, --, --)) +>dt : Symbol(dt, Decl(temporal.ts, 1064, 7)) +>nanosecond : Symbol(Temporal.PlainDateTime.nanosecond, Decl(lib.esnext.temporal.d.ts, --, --)) +} + +{ + const date = Temporal.PlainDateTime.from("-000015-01-01T12:30[u-ca=gregory]"); +>date : Symbol(date, Decl(temporal.ts, 1092, 9)) +>Temporal.PlainDateTime.from : Symbol(Temporal.PlainDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainDateTime : Symbol(Temporal.PlainDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainDateTime : Symbol(Temporal.PlainDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.PlainDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) + + date.era; +>date.era : Symbol(Temporal.PlainDateTime.era, Decl(lib.esnext.temporal.d.ts, --, --)) +>date : Symbol(date, Decl(temporal.ts, 1092, 9)) +>era : Symbol(Temporal.PlainDateTime.era, Decl(lib.esnext.temporal.d.ts, --, --)) + + // => 'bce' + date.eraYear; +>date.eraYear : Symbol(Temporal.PlainDateTime.eraYear, Decl(lib.esnext.temporal.d.ts, --, --)) +>date : Symbol(date, Decl(temporal.ts, 1092, 9)) +>eraYear : Symbol(Temporal.PlainDateTime.eraYear, Decl(lib.esnext.temporal.d.ts, --, --)) + + // => 16 + date.year; +>date.year : Symbol(Temporal.PlainDateTime.year, Decl(lib.esnext.temporal.d.ts, --, --)) +>date : Symbol(date, Decl(temporal.ts, 1092, 9)) +>year : Symbol(Temporal.PlainDateTime.year, Decl(lib.esnext.temporal.d.ts, --, --)) + + // => -15 +} + +{ + const dt = Temporal.PlainDateTime.from("1995-12-07T03:24:30.000003500"); +>dt : Symbol(dt, Decl(temporal.ts, 1102, 9)) +>Temporal.PlainDateTime.from : Symbol(Temporal.PlainDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainDateTime : Symbol(Temporal.PlainDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainDateTime : Symbol(Temporal.PlainDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.PlainDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) + + ["MON", "TUE", "WED", "THU", "FRI", "SAT", "SUN"][dt.dayOfWeek - 1]; // => 'THU' +>dt.dayOfWeek : Symbol(Temporal.PlainDateTime.dayOfWeek, Decl(lib.esnext.temporal.d.ts, --, --)) +>dt : Symbol(dt, Decl(temporal.ts, 1102, 9)) +>dayOfWeek : Symbol(Temporal.PlainDateTime.dayOfWeek, Decl(lib.esnext.temporal.d.ts, --, --)) +} + +{ + const dt = Temporal.PlainDateTime.from("1995-12-07T03:24:30.000003500"); +>dt : Symbol(dt, Decl(temporal.ts, 1107, 9)) +>Temporal.PlainDateTime.from : Symbol(Temporal.PlainDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainDateTime : Symbol(Temporal.PlainDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainDateTime : Symbol(Temporal.PlainDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.PlainDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) + + // ISO ordinal date + console.log(dt.year, dt.dayOfYear); // => '1995 341' +>console.log : Symbol(Console.log, Decl(lib.dom.d.ts, --, --)) +>console : Symbol(console, Decl(lib.dom.d.ts, --, --)) +>log : Symbol(Console.log, Decl(lib.dom.d.ts, --, --)) +>dt.year : Symbol(Temporal.PlainDateTime.year, Decl(lib.esnext.temporal.d.ts, --, --)) +>dt : Symbol(dt, Decl(temporal.ts, 1107, 9)) +>year : Symbol(Temporal.PlainDateTime.year, Decl(lib.esnext.temporal.d.ts, --, --)) +>dt.dayOfYear : Symbol(Temporal.PlainDateTime.dayOfYear, Decl(lib.esnext.temporal.d.ts, --, --)) +>dt : Symbol(dt, Decl(temporal.ts, 1107, 9)) +>dayOfYear : Symbol(Temporal.PlainDateTime.dayOfYear, Decl(lib.esnext.temporal.d.ts, --, --)) +} + +{ + const dt = Temporal.PlainDateTime.from("2022-01-01T03:24:30.000003500"); +>dt : Symbol(dt, Decl(temporal.ts, 1113, 9)) +>Temporal.PlainDateTime.from : Symbol(Temporal.PlainDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainDateTime : Symbol(Temporal.PlainDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainDateTime : Symbol(Temporal.PlainDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.PlainDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) + + // ISO week date + console.log(dt.yearOfWeek, dt.weekOfYear, dt.dayOfWeek); // => '2021 52 6' +>console.log : Symbol(Console.log, Decl(lib.dom.d.ts, --, --)) +>console : Symbol(console, Decl(lib.dom.d.ts, --, --)) +>log : Symbol(Console.log, Decl(lib.dom.d.ts, --, --)) +>dt.yearOfWeek : Symbol(Temporal.PlainDateTime.yearOfWeek, Decl(lib.esnext.temporal.d.ts, --, --)) +>dt : Symbol(dt, Decl(temporal.ts, 1113, 9)) +>yearOfWeek : Symbol(Temporal.PlainDateTime.yearOfWeek, Decl(lib.esnext.temporal.d.ts, --, --)) +>dt.weekOfYear : Symbol(Temporal.PlainDateTime.weekOfYear, Decl(lib.esnext.temporal.d.ts, --, --)) +>dt : Symbol(dt, Decl(temporal.ts, 1113, 9)) +>weekOfYear : Symbol(Temporal.PlainDateTime.weekOfYear, Decl(lib.esnext.temporal.d.ts, --, --)) +>dt.dayOfWeek : Symbol(Temporal.PlainDateTime.dayOfWeek, Decl(lib.esnext.temporal.d.ts, --, --)) +>dt : Symbol(dt, Decl(temporal.ts, 1113, 9)) +>dayOfWeek : Symbol(Temporal.PlainDateTime.dayOfWeek, Decl(lib.esnext.temporal.d.ts, --, --)) +} + +{ + const dt = Temporal.PlainDateTime.from("1995-12-07T03:24:30.000003500"); +>dt : Symbol(dt, Decl(temporal.ts, 1119, 9)) +>Temporal.PlainDateTime.from : Symbol(Temporal.PlainDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainDateTime : Symbol(Temporal.PlainDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainDateTime : Symbol(Temporal.PlainDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.PlainDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) + + dt.daysInWeek; // => 7 +>dt.daysInWeek : Symbol(Temporal.PlainDateTime.daysInWeek, Decl(lib.esnext.temporal.d.ts, --, --)) +>dt : Symbol(dt, Decl(temporal.ts, 1119, 9)) +>daysInWeek : Symbol(Temporal.PlainDateTime.daysInWeek, Decl(lib.esnext.temporal.d.ts, --, --)) +} + +{ + // Attempt to write some mnemonic poetry + const monthsByDays: Record = {}; +>monthsByDays : Symbol(monthsByDays, Decl(temporal.ts, 1125, 9)) +>Record : Symbol(Record, Decl(lib.es5.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainDateTime : Symbol(Temporal.PlainDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) + + for (let month = 1; month <= 12; month++) { +>month : Symbol(month, Decl(temporal.ts, 1126, 12)) +>month : Symbol(month, Decl(temporal.ts, 1126, 12)) +>month : Symbol(month, Decl(temporal.ts, 1126, 12)) + + const dt = Temporal.Now.plainDateTimeISO().with({ month }); +>dt : Symbol(dt, Decl(temporal.ts, 1127, 13)) +>Temporal.Now.plainDateTimeISO().with : Symbol(Temporal.PlainDateTime.with, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.Now.plainDateTimeISO : Symbol(Temporal.Now.plainDateTimeISO, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.Now : Symbol(Temporal.Now, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>Now : Symbol(Temporal.Now, Decl(lib.esnext.temporal.d.ts, --, --)) +>plainDateTimeISO : Symbol(Temporal.Now.plainDateTimeISO, Decl(lib.esnext.temporal.d.ts, --, --)) +>with : Symbol(Temporal.PlainDateTime.with, Decl(lib.esnext.temporal.d.ts, --, --)) +>month : Symbol(month, Decl(temporal.ts, 1127, 57)) + + monthsByDays[dt.daysInMonth] = (monthsByDays[dt.daysInMonth] || []).concat(dt); +>monthsByDays : Symbol(monthsByDays, Decl(temporal.ts, 1125, 9)) +>dt.daysInMonth : Symbol(Temporal.PlainDateTime.daysInMonth, Decl(lib.esnext.temporal.d.ts, --, --)) +>dt : Symbol(dt, Decl(temporal.ts, 1127, 13)) +>daysInMonth : Symbol(Temporal.PlainDateTime.daysInMonth, Decl(lib.esnext.temporal.d.ts, --, --)) +>(monthsByDays[dt.daysInMonth] || []).concat : Symbol(Array.concat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>monthsByDays : Symbol(monthsByDays, Decl(temporal.ts, 1125, 9)) +>dt.daysInMonth : Symbol(Temporal.PlainDateTime.daysInMonth, Decl(lib.esnext.temporal.d.ts, --, --)) +>dt : Symbol(dt, Decl(temporal.ts, 1127, 13)) +>daysInMonth : Symbol(Temporal.PlainDateTime.daysInMonth, Decl(lib.esnext.temporal.d.ts, --, --)) +>concat : Symbol(Array.concat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>dt : Symbol(dt, Decl(temporal.ts, 1127, 13)) + } + + const strings = monthsByDays[30].map(dt => dt.toLocaleString("en", { month: "long" })); +>strings : Symbol(strings, Decl(temporal.ts, 1131, 9)) +>monthsByDays[30].map : Symbol(Array.map, Decl(lib.es5.d.ts, --, --)) +>monthsByDays : Symbol(monthsByDays, Decl(temporal.ts, 1125, 9)) +>map : Symbol(Array.map, Decl(lib.es5.d.ts, --, --)) +>dt : Symbol(dt, Decl(temporal.ts, 1131, 41)) +>dt.toLocaleString : Symbol(Temporal.PlainDateTime.toLocaleString, Decl(lib.esnext.temporal.d.ts, --, --)) +>dt : Symbol(dt, Decl(temporal.ts, 1131, 41)) +>toLocaleString : Symbol(Temporal.PlainDateTime.toLocaleString, Decl(lib.esnext.temporal.d.ts, --, --)) +>month : Symbol(month, Decl(temporal.ts, 1131, 72)) + + // Shuffle to improve poem as determined empirically + strings.unshift(strings.pop()!); +>strings.unshift : Symbol(Array.unshift, Decl(lib.es5.d.ts, --, --)) +>strings : Symbol(strings, Decl(temporal.ts, 1131, 9)) +>unshift : Symbol(Array.unshift, Decl(lib.es5.d.ts, --, --)) +>strings.pop : Symbol(Array.pop, Decl(lib.es5.d.ts, --, --)) +>strings : Symbol(strings, Decl(temporal.ts, 1131, 9)) +>pop : Symbol(Array.pop, Decl(lib.es5.d.ts, --, --)) + + const format = new Intl.ListFormat("en"); +>format : Symbol(format, Decl(temporal.ts, 1134, 9)) +>Intl.ListFormat : Symbol(Intl.ListFormat, Decl(lib.es2021.intl.d.ts, --, --), Decl(lib.es2021.intl.d.ts, --, --)) +>Intl : Symbol(Intl, Decl(lib.es5.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2020.intl.d.ts, --, --), Decl(lib.es2021.intl.d.ts, --, --), Decl(lib.es2025.intl.d.ts, --, --) ... and 1 more) +>ListFormat : Symbol(Intl.ListFormat, Decl(lib.es2021.intl.d.ts, --, --), Decl(lib.es2021.intl.d.ts, --, --)) + + const poem = `Thirty days hath ${format.format(strings)}`; +>poem : Symbol(poem, Decl(temporal.ts, 1135, 9)) +>format.format : Symbol(Intl.ListFormat.format, Decl(lib.es2021.intl.d.ts, --, --)) +>format : Symbol(format, Decl(temporal.ts, 1134, 9)) +>format : Symbol(Intl.ListFormat.format, Decl(lib.es2021.intl.d.ts, --, --)) +>strings : Symbol(strings, Decl(temporal.ts, 1131, 9)) + + console.log(poem); +>console.log : Symbol(Console.log, Decl(lib.dom.d.ts, --, --)) +>console : Symbol(console, Decl(lib.dom.d.ts, --, --)) +>log : Symbol(Console.log, Decl(lib.dom.d.ts, --, --)) +>poem : Symbol(poem, Decl(temporal.ts, 1135, 9)) +} + +{ + const dt = Temporal.Now.plainDateTimeISO(); +>dt : Symbol(dt, Decl(temporal.ts, 1141, 9)) +>Temporal.Now.plainDateTimeISO : Symbol(Temporal.Now.plainDateTimeISO, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.Now : Symbol(Temporal.Now, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>Now : Symbol(Temporal.Now, Decl(lib.esnext.temporal.d.ts, --, --)) +>plainDateTimeISO : Symbol(Temporal.Now.plainDateTimeISO, Decl(lib.esnext.temporal.d.ts, --, --)) + + const percent = dt.dayOfYear / dt.daysInYear; +>percent : Symbol(percent, Decl(temporal.ts, 1142, 9)) +>dt.dayOfYear : Symbol(Temporal.PlainDateTime.dayOfYear, Decl(lib.esnext.temporal.d.ts, --, --)) +>dt : Symbol(dt, Decl(temporal.ts, 1141, 9)) +>dayOfYear : Symbol(Temporal.PlainDateTime.dayOfYear, Decl(lib.esnext.temporal.d.ts, --, --)) +>dt.daysInYear : Symbol(Temporal.PlainDateTime.daysInYear, Decl(lib.esnext.temporal.d.ts, --, --)) +>dt : Symbol(dt, Decl(temporal.ts, 1141, 9)) +>daysInYear : Symbol(Temporal.PlainDateTime.daysInYear, Decl(lib.esnext.temporal.d.ts, --, --)) + + `The year is ${percent.toLocaleString("en", { style: "percent" })} over!`; +>percent.toLocaleString : Symbol(Number.toLocaleString, Decl(lib.es5.d.ts, --, --)) +>percent : Symbol(percent, Decl(temporal.ts, 1142, 9)) +>toLocaleString : Symbol(Number.toLocaleString, Decl(lib.es5.d.ts, --, --)) +>style : Symbol(style, Decl(temporal.ts, 1143, 49)) + + // example output: "The year is 10% over!" +} + +{ + const dt = Temporal.PlainDate.from("1900-01-01T12:00"); +>dt : Symbol(dt, Decl(temporal.ts, 1148, 9)) +>Temporal.PlainDate.from : Symbol(Temporal.PlainDateConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainDate : Symbol(Temporal.PlainDate, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainDate : Symbol(Temporal.PlainDate, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.PlainDateConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) + + dt.monthsInYear; // => 12 +>dt.monthsInYear : Symbol(Temporal.PlainDate.monthsInYear, Decl(lib.esnext.temporal.d.ts, --, --)) +>dt : Symbol(dt, Decl(temporal.ts, 1148, 9)) +>monthsInYear : Symbol(Temporal.PlainDate.monthsInYear, Decl(lib.esnext.temporal.d.ts, --, --)) +} + +{ + // Is this year a leap year? + const dt = Temporal.Now.plainDateTimeISO(); +>dt : Symbol(dt, Decl(temporal.ts, 1154, 9)) +>Temporal.Now.plainDateTimeISO : Symbol(Temporal.Now.plainDateTimeISO, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.Now : Symbol(Temporal.Now, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>Now : Symbol(Temporal.Now, Decl(lib.esnext.temporal.d.ts, --, --)) +>plainDateTimeISO : Symbol(Temporal.Now.plainDateTimeISO, Decl(lib.esnext.temporal.d.ts, --, --)) + + dt.inLeapYear; // example output: true +>dt.inLeapYear : Symbol(Temporal.PlainDateTime.inLeapYear, Decl(lib.esnext.temporal.d.ts, --, --)) +>dt : Symbol(dt, Decl(temporal.ts, 1154, 9)) +>inLeapYear : Symbol(Temporal.PlainDateTime.inLeapYear, Decl(lib.esnext.temporal.d.ts, --, --)) + + // Is 2100 a leap year? (no, because it's divisible by 100 and not 400) + dt.with({ year: 2100 }).inLeapYear; // => false +>dt.with({ year: 2100 }).inLeapYear : Symbol(Temporal.PlainDateTime.inLeapYear, Decl(lib.esnext.temporal.d.ts, --, --)) +>dt.with : Symbol(Temporal.PlainDateTime.with, Decl(lib.esnext.temporal.d.ts, --, --)) +>dt : Symbol(dt, Decl(temporal.ts, 1154, 9)) +>with : Symbol(Temporal.PlainDateTime.with, Decl(lib.esnext.temporal.d.ts, --, --)) +>year : Symbol(year, Decl(temporal.ts, 1157, 13)) +>inLeapYear : Symbol(Temporal.PlainDateTime.inLeapYear, Decl(lib.esnext.temporal.d.ts, --, --)) +} + +{ + const dt = Temporal.PlainDateTime.from("1995-12-07T03:24:30.000003500"); +>dt : Symbol(dt, Decl(temporal.ts, 1161, 9)) +>Temporal.PlainDateTime.from : Symbol(Temporal.PlainDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainDateTime : Symbol(Temporal.PlainDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainDateTime : Symbol(Temporal.PlainDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.PlainDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) + + dt.with({ year: 2015, second: 31 }); // => 2015-12-07T03:24:31.0000035 +>dt.with : Symbol(Temporal.PlainDateTime.with, Decl(lib.esnext.temporal.d.ts, --, --)) +>dt : Symbol(dt, Decl(temporal.ts, 1161, 9)) +>with : Symbol(Temporal.PlainDateTime.with, Decl(lib.esnext.temporal.d.ts, --, --)) +>year : Symbol(year, Decl(temporal.ts, 1162, 13)) +>second : Symbol(second, Decl(temporal.ts, 1162, 25)) +} + +{ + const dt = Temporal.PlainDateTime.from("2015-12-07T03:24:30.000003500"); +>dt : Symbol(dt, Decl(temporal.ts, 1166, 9)) +>Temporal.PlainDateTime.from : Symbol(Temporal.PlainDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainDateTime : Symbol(Temporal.PlainDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainDateTime : Symbol(Temporal.PlainDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.PlainDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) + + dt.withPlainTime({ hour: 10 }); // => 2015-12-07T10:00:00 +>dt.withPlainTime : Symbol(Temporal.PlainDateTime.withPlainTime, Decl(lib.esnext.temporal.d.ts, --, --)) +>dt : Symbol(dt, Decl(temporal.ts, 1166, 9)) +>withPlainTime : Symbol(Temporal.PlainDateTime.withPlainTime, Decl(lib.esnext.temporal.d.ts, --, --)) +>hour : Symbol(hour, Decl(temporal.ts, 1167, 22)) + + const time = Temporal.PlainTime.from("11:22"); +>time : Symbol(time, Decl(temporal.ts, 1168, 9)) +>Temporal.PlainTime.from : Symbol(Temporal.PlainTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainTime : Symbol(Temporal.PlainTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainTime : Symbol(Temporal.PlainTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.PlainTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) + + dt.withPlainTime(time); // => 2015-12-07T11:22:00 +>dt.withPlainTime : Symbol(Temporal.PlainDateTime.withPlainTime, Decl(lib.esnext.temporal.d.ts, --, --)) +>dt : Symbol(dt, Decl(temporal.ts, 1166, 9)) +>withPlainTime : Symbol(Temporal.PlainDateTime.withPlainTime, Decl(lib.esnext.temporal.d.ts, --, --)) +>time : Symbol(time, Decl(temporal.ts, 1168, 9)) + + dt.withPlainTime("12:34"); // => 2015-12-07T12:34:00 +>dt.withPlainTime : Symbol(Temporal.PlainDateTime.withPlainTime, Decl(lib.esnext.temporal.d.ts, --, --)) +>dt : Symbol(dt, Decl(temporal.ts, 1166, 9)) +>withPlainTime : Symbol(Temporal.PlainDateTime.withPlainTime, Decl(lib.esnext.temporal.d.ts, --, --)) + + // easier for chaining + dt.add({ days: 2, hours: 22 }).withPlainTime("00:00"); // => 2015-12-10T00:00:00 +>dt.add({ days: 2, hours: 22 }).withPlainTime : Symbol(Temporal.PlainDateTime.withPlainTime, Decl(lib.esnext.temporal.d.ts, --, --)) +>dt.add : Symbol(Temporal.PlainDateTime.add, Decl(lib.esnext.temporal.d.ts, --, --)) +>dt : Symbol(dt, Decl(temporal.ts, 1166, 9)) +>add : Symbol(Temporal.PlainDateTime.add, Decl(lib.esnext.temporal.d.ts, --, --)) +>days : Symbol(days, Decl(temporal.ts, 1173, 12)) +>hours : Symbol(hours, Decl(temporal.ts, 1173, 21)) +>withPlainTime : Symbol(Temporal.PlainDateTime.withPlainTime, Decl(lib.esnext.temporal.d.ts, --, --)) +} + +{ + const dt = Temporal.PlainDateTime.from("1995-12-07T03:24:30.000003500[u-ca=japanese]"); +>dt : Symbol(dt, Decl(temporal.ts, 1177, 9)) +>Temporal.PlainDateTime.from : Symbol(Temporal.PlainDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainDateTime : Symbol(Temporal.PlainDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainDateTime : Symbol(Temporal.PlainDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.PlainDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) + + dt.withCalendar("iso8601"); // => 1995-12-07T03:24:30.0000035 +>dt.withCalendar : Symbol(Temporal.PlainDateTime.withCalendar, Decl(lib.esnext.temporal.d.ts, --, --)) +>dt : Symbol(dt, Decl(temporal.ts, 1177, 9)) +>withCalendar : Symbol(Temporal.PlainDateTime.withCalendar, Decl(lib.esnext.temporal.d.ts, --, --)) +} + +{ + let dt: Temporal.PlainDateTime; +>dt : Symbol(dt, Decl(temporal.ts, 1182, 7)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainDateTime : Symbol(Temporal.PlainDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) + + dt = Temporal.PlainDateTime.from("1995-12-07T03:24:30.000003500"); +>dt : Symbol(dt, Decl(temporal.ts, 1182, 7)) +>Temporal.PlainDateTime.from : Symbol(Temporal.PlainDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainDateTime : Symbol(Temporal.PlainDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainDateTime : Symbol(Temporal.PlainDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.PlainDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) + + dt.add({ years: 20, months: 4, nanoseconds: 500 }); // => 2016-04-07T03:24:30.000004 +>dt.add : Symbol(Temporal.PlainDateTime.add, Decl(lib.esnext.temporal.d.ts, --, --)) +>dt : Symbol(dt, Decl(temporal.ts, 1182, 7)) +>add : Symbol(Temporal.PlainDateTime.add, Decl(lib.esnext.temporal.d.ts, --, --)) +>years : Symbol(years, Decl(temporal.ts, 1185, 12)) +>months : Symbol(months, Decl(temporal.ts, 1185, 23)) +>nanoseconds : Symbol(nanoseconds, Decl(temporal.ts, 1185, 34)) + + dt = Temporal.PlainDateTime.from("2019-01-31T15:30"); +>dt : Symbol(dt, Decl(temporal.ts, 1182, 7)) +>Temporal.PlainDateTime.from : Symbol(Temporal.PlainDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainDateTime : Symbol(Temporal.PlainDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainDateTime : Symbol(Temporal.PlainDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.PlainDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) + + dt.add({ months: 1 }); // => 2019-02-28T15:30:00 +>dt.add : Symbol(Temporal.PlainDateTime.add, Decl(lib.esnext.temporal.d.ts, --, --)) +>dt : Symbol(dt, Decl(temporal.ts, 1182, 7)) +>add : Symbol(Temporal.PlainDateTime.add, Decl(lib.esnext.temporal.d.ts, --, --)) +>months : Symbol(months, Decl(temporal.ts, 1188, 12)) + + dt.add({ months: 1 }, { overflow: "reject" }); // => throws +>dt.add : Symbol(Temporal.PlainDateTime.add, Decl(lib.esnext.temporal.d.ts, --, --)) +>dt : Symbol(dt, Decl(temporal.ts, 1182, 7)) +>add : Symbol(Temporal.PlainDateTime.add, Decl(lib.esnext.temporal.d.ts, --, --)) +>months : Symbol(months, Decl(temporal.ts, 1189, 12)) +>overflow : Symbol(overflow, Decl(temporal.ts, 1189, 27)) +} + +{ + let dt: Temporal.PlainDateTime; +>dt : Symbol(dt, Decl(temporal.ts, 1193, 7)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainDateTime : Symbol(Temporal.PlainDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) + + dt = Temporal.PlainDateTime.from("1995-12-07T03:24:30.000003500"); +>dt : Symbol(dt, Decl(temporal.ts, 1193, 7)) +>Temporal.PlainDateTime.from : Symbol(Temporal.PlainDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainDateTime : Symbol(Temporal.PlainDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainDateTime : Symbol(Temporal.PlainDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.PlainDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) + + dt.subtract({ years: 20, months: 4, nanoseconds: 500 }); // => 1975-08-07T03:24:30.000003 +>dt.subtract : Symbol(Temporal.PlainDateTime.subtract, Decl(lib.esnext.temporal.d.ts, --, --)) +>dt : Symbol(dt, Decl(temporal.ts, 1193, 7)) +>subtract : Symbol(Temporal.PlainDateTime.subtract, Decl(lib.esnext.temporal.d.ts, --, --)) +>years : Symbol(years, Decl(temporal.ts, 1196, 17)) +>months : Symbol(months, Decl(temporal.ts, 1196, 28)) +>nanoseconds : Symbol(nanoseconds, Decl(temporal.ts, 1196, 39)) + + dt = Temporal.PlainDateTime.from("2019-03-31T15:30"); +>dt : Symbol(dt, Decl(temporal.ts, 1193, 7)) +>Temporal.PlainDateTime.from : Symbol(Temporal.PlainDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainDateTime : Symbol(Temporal.PlainDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainDateTime : Symbol(Temporal.PlainDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.PlainDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) + + dt.subtract({ months: 1 }); // => 2019-02-28T15:30:00 +>dt.subtract : Symbol(Temporal.PlainDateTime.subtract, Decl(lib.esnext.temporal.d.ts, --, --)) +>dt : Symbol(dt, Decl(temporal.ts, 1193, 7)) +>subtract : Symbol(Temporal.PlainDateTime.subtract, Decl(lib.esnext.temporal.d.ts, --, --)) +>months : Symbol(months, Decl(temporal.ts, 1199, 17)) + + dt.subtract({ months: 1 }, { overflow: "reject" }); // => throws +>dt.subtract : Symbol(Temporal.PlainDateTime.subtract, Decl(lib.esnext.temporal.d.ts, --, --)) +>dt : Symbol(dt, Decl(temporal.ts, 1193, 7)) +>subtract : Symbol(Temporal.PlainDateTime.subtract, Decl(lib.esnext.temporal.d.ts, --, --)) +>months : Symbol(months, Decl(temporal.ts, 1200, 17)) +>overflow : Symbol(overflow, Decl(temporal.ts, 1200, 32)) +} + +{ + const dt1 = Temporal.PlainDateTime.from("1995-12-07T03:24:30.000003500"); +>dt1 : Symbol(dt1, Decl(temporal.ts, 1204, 9)) +>Temporal.PlainDateTime.from : Symbol(Temporal.PlainDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainDateTime : Symbol(Temporal.PlainDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainDateTime : Symbol(Temporal.PlainDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.PlainDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) + + const dt2 = Temporal.PlainDateTime.from("2019-01-31T15:30"); +>dt2 : Symbol(dt2, Decl(temporal.ts, 1205, 9)) +>Temporal.PlainDateTime.from : Symbol(Temporal.PlainDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainDateTime : Symbol(Temporal.PlainDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainDateTime : Symbol(Temporal.PlainDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.PlainDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) + + dt1.until(dt2); +>dt1.until : Symbol(Temporal.PlainDateTime.until, Decl(lib.esnext.temporal.d.ts, --, --)) +>dt1 : Symbol(dt1, Decl(temporal.ts, 1204, 9)) +>until : Symbol(Temporal.PlainDateTime.until, Decl(lib.esnext.temporal.d.ts, --, --)) +>dt2 : Symbol(dt2, Decl(temporal.ts, 1205, 9)) + + // => P8456DT12H5M29.9999965S + dt1.until(dt2, { largestUnit: "year" }); +>dt1.until : Symbol(Temporal.PlainDateTime.until, Decl(lib.esnext.temporal.d.ts, --, --)) +>dt1 : Symbol(dt1, Decl(temporal.ts, 1204, 9)) +>until : Symbol(Temporal.PlainDateTime.until, Decl(lib.esnext.temporal.d.ts, --, --)) +>dt2 : Symbol(dt2, Decl(temporal.ts, 1205, 9)) +>largestUnit : Symbol(largestUnit, Decl(temporal.ts, 1208, 20)) + + // => P23Y1M24DT12H5M29.9999965S + dt2.until(dt1, { largestUnit: "year" }); +>dt2.until : Symbol(Temporal.PlainDateTime.until, Decl(lib.esnext.temporal.d.ts, --, --)) +>dt2 : Symbol(dt2, Decl(temporal.ts, 1205, 9)) +>until : Symbol(Temporal.PlainDateTime.until, Decl(lib.esnext.temporal.d.ts, --, --)) +>dt1 : Symbol(dt1, Decl(temporal.ts, 1204, 9)) +>largestUnit : Symbol(largestUnit, Decl(temporal.ts, 1210, 20)) + + // => -P23Y1M24DT12H5M29.9999965S + dt1.until(dt2, { largestUnit: "nanosecond" }); +>dt1.until : Symbol(Temporal.PlainDateTime.until, Decl(lib.esnext.temporal.d.ts, --, --)) +>dt1 : Symbol(dt1, Decl(temporal.ts, 1204, 9)) +>until : Symbol(Temporal.PlainDateTime.until, Decl(lib.esnext.temporal.d.ts, --, --)) +>dt2 : Symbol(dt2, Decl(temporal.ts, 1205, 9)) +>largestUnit : Symbol(largestUnit, Decl(temporal.ts, 1212, 20)) + + // => PT730641929.999996544S + // (precision lost) + + // Rounding, for example if you don't care about sub-seconds + dt1.until(dt2, { smallestUnit: "second" }); +>dt1.until : Symbol(Temporal.PlainDateTime.until, Decl(lib.esnext.temporal.d.ts, --, --)) +>dt1 : Symbol(dt1, Decl(temporal.ts, 1204, 9)) +>until : Symbol(Temporal.PlainDateTime.until, Decl(lib.esnext.temporal.d.ts, --, --)) +>dt2 : Symbol(dt2, Decl(temporal.ts, 1205, 9)) +>smallestUnit : Symbol(smallestUnit, Decl(temporal.ts, 1217, 20)) + + // => P8456DT12H5M29S + + // Months and years can be different lengths + const [jan1, feb1, mar1] = [1, 2, 3].map(month => Temporal.PlainDateTime.from({ year: 2020, month, day: 1 })); +>jan1 : Symbol(jan1, Decl(temporal.ts, 1221, 11)) +>feb1 : Symbol(feb1, Decl(temporal.ts, 1221, 16)) +>mar1 : Symbol(mar1, Decl(temporal.ts, 1221, 22)) +>[1, 2, 3].map : Symbol(Array.map, Decl(lib.es5.d.ts, --, --)) +>map : Symbol(Array.map, Decl(lib.es5.d.ts, --, --)) +>month : Symbol(month, Decl(temporal.ts, 1221, 45)) +>Temporal.PlainDateTime.from : Symbol(Temporal.PlainDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainDateTime : Symbol(Temporal.PlainDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainDateTime : Symbol(Temporal.PlainDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.PlainDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>year : Symbol(year, Decl(temporal.ts, 1221, 83)) +>month : Symbol(month, Decl(temporal.ts, 1221, 95)) +>day : Symbol(day, Decl(temporal.ts, 1221, 102)) + + jan1.until(feb1); // => P31D +>jan1.until : Symbol(Temporal.PlainDateTime.until, Decl(lib.esnext.temporal.d.ts, --, --)) +>jan1 : Symbol(jan1, Decl(temporal.ts, 1221, 11)) +>until : Symbol(Temporal.PlainDateTime.until, Decl(lib.esnext.temporal.d.ts, --, --)) +>feb1 : Symbol(feb1, Decl(temporal.ts, 1221, 16)) + + jan1.until(feb1, { largestUnit: "month" }); // => P1M +>jan1.until : Symbol(Temporal.PlainDateTime.until, Decl(lib.esnext.temporal.d.ts, --, --)) +>jan1 : Symbol(jan1, Decl(temporal.ts, 1221, 11)) +>until : Symbol(Temporal.PlainDateTime.until, Decl(lib.esnext.temporal.d.ts, --, --)) +>feb1 : Symbol(feb1, Decl(temporal.ts, 1221, 16)) +>largestUnit : Symbol(largestUnit, Decl(temporal.ts, 1223, 22)) + + feb1.until(mar1); // => P29D +>feb1.until : Symbol(Temporal.PlainDateTime.until, Decl(lib.esnext.temporal.d.ts, --, --)) +>feb1 : Symbol(feb1, Decl(temporal.ts, 1221, 16)) +>until : Symbol(Temporal.PlainDateTime.until, Decl(lib.esnext.temporal.d.ts, --, --)) +>mar1 : Symbol(mar1, Decl(temporal.ts, 1221, 22)) + + feb1.until(mar1, { largestUnit: "month" }); // => P1M +>feb1.until : Symbol(Temporal.PlainDateTime.until, Decl(lib.esnext.temporal.d.ts, --, --)) +>feb1 : Symbol(feb1, Decl(temporal.ts, 1221, 16)) +>until : Symbol(Temporal.PlainDateTime.until, Decl(lib.esnext.temporal.d.ts, --, --)) +>mar1 : Symbol(mar1, Decl(temporal.ts, 1221, 22)) +>largestUnit : Symbol(largestUnit, Decl(temporal.ts, 1225, 22)) + + jan1.until(mar1); // => P60D +>jan1.until : Symbol(Temporal.PlainDateTime.until, Decl(lib.esnext.temporal.d.ts, --, --)) +>jan1 : Symbol(jan1, Decl(temporal.ts, 1221, 11)) +>until : Symbol(Temporal.PlainDateTime.until, Decl(lib.esnext.temporal.d.ts, --, --)) +>mar1 : Symbol(mar1, Decl(temporal.ts, 1221, 22)) +} + +{ + const dt1 = Temporal.PlainDateTime.from("1995-12-07T03:24:30.000003500"); +>dt1 : Symbol(dt1, Decl(temporal.ts, 1230, 9)) +>Temporal.PlainDateTime.from : Symbol(Temporal.PlainDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainDateTime : Symbol(Temporal.PlainDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainDateTime : Symbol(Temporal.PlainDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.PlainDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) + + const dt2 = Temporal.PlainDateTime.from("2019-01-31T15:30"); +>dt2 : Symbol(dt2, Decl(temporal.ts, 1231, 9)) +>Temporal.PlainDateTime.from : Symbol(Temporal.PlainDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainDateTime : Symbol(Temporal.PlainDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainDateTime : Symbol(Temporal.PlainDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.PlainDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) + + dt2.since(dt1); // => P8456DT12H5M29.9999965S +>dt2.since : Symbol(Temporal.PlainDateTime.since, Decl(lib.esnext.temporal.d.ts, --, --)) +>dt2 : Symbol(dt2, Decl(temporal.ts, 1231, 9)) +>since : Symbol(Temporal.PlainDateTime.since, Decl(lib.esnext.temporal.d.ts, --, --)) +>dt1 : Symbol(dt1, Decl(temporal.ts, 1230, 9)) +} + +{ + const dt = Temporal.PlainDateTime.from("1995-12-07T03:24:30.000003500"); +>dt : Symbol(dt, Decl(temporal.ts, 1236, 9)) +>Temporal.PlainDateTime.from : Symbol(Temporal.PlainDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainDateTime : Symbol(Temporal.PlainDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainDateTime : Symbol(Temporal.PlainDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.PlainDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) + + // Round to a particular unit + dt.round({ smallestUnit: "hour" }); // => 1995-12-07T03:00:00 +>dt.round : Symbol(Temporal.PlainDateTime.round, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>dt : Symbol(dt, Decl(temporal.ts, 1236, 9)) +>round : Symbol(Temporal.PlainDateTime.round, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>smallestUnit : Symbol(smallestUnit, Decl(temporal.ts, 1239, 14)) + + // Round to an increment of a unit, e.g. half an hour: + dt.round({ roundingIncrement: 30, smallestUnit: "minute" }); +>dt.round : Symbol(Temporal.PlainDateTime.round, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>dt : Symbol(dt, Decl(temporal.ts, 1236, 9)) +>round : Symbol(Temporal.PlainDateTime.round, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>roundingIncrement : Symbol(roundingIncrement, Decl(temporal.ts, 1241, 14)) +>smallestUnit : Symbol(smallestUnit, Decl(temporal.ts, 1241, 37)) + + // => 1995-12-07T03:30:00 + // Round to the same increment but round down instead: + dt.round({ roundingIncrement: 30, smallestUnit: "minute", roundingMode: "floor" }); +>dt.round : Symbol(Temporal.PlainDateTime.round, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>dt : Symbol(dt, Decl(temporal.ts, 1236, 9)) +>round : Symbol(Temporal.PlainDateTime.round, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>roundingIncrement : Symbol(roundingIncrement, Decl(temporal.ts, 1244, 14)) +>smallestUnit : Symbol(smallestUnit, Decl(temporal.ts, 1244, 37)) +>roundingMode : Symbol(roundingMode, Decl(temporal.ts, 1244, 61)) + + // => 1995-12-07T03:00:00 +} + +{ + const dt1 = Temporal.PlainDateTime.from("1995-12-07T03:24:30.000003500"); +>dt1 : Symbol(dt1, Decl(temporal.ts, 1249, 9)) +>Temporal.PlainDateTime.from : Symbol(Temporal.PlainDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainDateTime : Symbol(Temporal.PlainDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainDateTime : Symbol(Temporal.PlainDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.PlainDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) + + const dt2 = Temporal.PlainDateTime.from("2019-01-31T15:30"); +>dt2 : Symbol(dt2, Decl(temporal.ts, 1250, 9)) +>Temporal.PlainDateTime.from : Symbol(Temporal.PlainDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainDateTime : Symbol(Temporal.PlainDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainDateTime : Symbol(Temporal.PlainDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.PlainDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) + + dt1.equals(dt2); // => false +>dt1.equals : Symbol(Temporal.PlainDateTime.equals, Decl(lib.esnext.temporal.d.ts, --, --)) +>dt1 : Symbol(dt1, Decl(temporal.ts, 1249, 9)) +>equals : Symbol(Temporal.PlainDateTime.equals, Decl(lib.esnext.temporal.d.ts, --, --)) +>dt2 : Symbol(dt2, Decl(temporal.ts, 1250, 9)) + + dt1.equals(dt1); // => true +>dt1.equals : Symbol(Temporal.PlainDateTime.equals, Decl(lib.esnext.temporal.d.ts, --, --)) +>dt1 : Symbol(dt1, Decl(temporal.ts, 1249, 9)) +>equals : Symbol(Temporal.PlainDateTime.equals, Decl(lib.esnext.temporal.d.ts, --, --)) +>dt1 : Symbol(dt1, Decl(temporal.ts, 1249, 9)) +} + +{ + const dt = Temporal.PlainDateTime.from({ +>dt : Symbol(dt, Decl(temporal.ts, 1256, 9)) +>Temporal.PlainDateTime.from : Symbol(Temporal.PlainDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainDateTime : Symbol(Temporal.PlainDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainDateTime : Symbol(Temporal.PlainDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.PlainDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) + + year: 1999, +>year : Symbol(year, Decl(temporal.ts, 1256, 44)) + + month: 12, +>month : Symbol(month, Decl(temporal.ts, 1257, 19)) + + day: 31, +>day : Symbol(day, Decl(temporal.ts, 1258, 18)) + + hour: 23, +>hour : Symbol(hour, Decl(temporal.ts, 1259, 16)) + + minute: 59, +>minute : Symbol(minute, Decl(temporal.ts, 1260, 17)) + + second: 59, +>second : Symbol(second, Decl(temporal.ts, 1261, 19)) + + millisecond: 999, +>millisecond : Symbol(millisecond, Decl(temporal.ts, 1262, 19)) + + microsecond: 999, +>microsecond : Symbol(microsecond, Decl(temporal.ts, 1263, 25)) + + nanosecond: 999, +>nanosecond : Symbol(nanosecond, Decl(temporal.ts, 1264, 25)) + + }); + dt.toString(); // => '1999-12-31T23:59:59.999999999' +>dt.toString : Symbol(Temporal.PlainDateTime.toString, Decl(lib.esnext.temporal.d.ts, --, --)) +>dt : Symbol(dt, Decl(temporal.ts, 1256, 9)) +>toString : Symbol(Temporal.PlainDateTime.toString, Decl(lib.esnext.temporal.d.ts, --, --)) + + dt.toString({ smallestUnit: "minute" }); // => '1999-12-31T23:59' +>dt.toString : Symbol(Temporal.PlainDateTime.toString, Decl(lib.esnext.temporal.d.ts, --, --)) +>dt : Symbol(dt, Decl(temporal.ts, 1256, 9)) +>toString : Symbol(Temporal.PlainDateTime.toString, Decl(lib.esnext.temporal.d.ts, --, --)) +>smallestUnit : Symbol(smallestUnit, Decl(temporal.ts, 1269, 17)) + + dt.toString({ fractionalSecondDigits: 0 }); // => '1999-12-31T23:59:59' +>dt.toString : Symbol(Temporal.PlainDateTime.toString, Decl(lib.esnext.temporal.d.ts, --, --)) +>dt : Symbol(dt, Decl(temporal.ts, 1256, 9)) +>toString : Symbol(Temporal.PlainDateTime.toString, Decl(lib.esnext.temporal.d.ts, --, --)) +>fractionalSecondDigits : Symbol(fractionalSecondDigits, Decl(temporal.ts, 1270, 17)) + + dt.toString({ fractionalSecondDigits: 4 }); // => '1999-12-31T23:59:59.9999' +>dt.toString : Symbol(Temporal.PlainDateTime.toString, Decl(lib.esnext.temporal.d.ts, --, --)) +>dt : Symbol(dt, Decl(temporal.ts, 1256, 9)) +>toString : Symbol(Temporal.PlainDateTime.toString, Decl(lib.esnext.temporal.d.ts, --, --)) +>fractionalSecondDigits : Symbol(fractionalSecondDigits, Decl(temporal.ts, 1271, 17)) + + dt.toString({ fractionalSecondDigits: 8, roundingMode: "halfExpand" }); +>dt.toString : Symbol(Temporal.PlainDateTime.toString, Decl(lib.esnext.temporal.d.ts, --, --)) +>dt : Symbol(dt, Decl(temporal.ts, 1256, 9)) +>toString : Symbol(Temporal.PlainDateTime.toString, Decl(lib.esnext.temporal.d.ts, --, --)) +>fractionalSecondDigits : Symbol(fractionalSecondDigits, Decl(temporal.ts, 1272, 17)) +>roundingMode : Symbol(roundingMode, Decl(temporal.ts, 1272, 44)) + + // => '2000-01-01T00:00:00.00000000' +} + +{ + const dt = Temporal.PlainDateTime.from("1995-12-07T03:24:30.000003500"); +>dt : Symbol(dt, Decl(temporal.ts, 1277, 9)) +>Temporal.PlainDateTime.from : Symbol(Temporal.PlainDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainDateTime : Symbol(Temporal.PlainDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainDateTime : Symbol(Temporal.PlainDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.PlainDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) + + dt.toLocaleString(); // example output: 1995-12-07, 3:24:30 a.m. +>dt.toLocaleString : Symbol(Temporal.PlainDateTime.toLocaleString, Decl(lib.esnext.temporal.d.ts, --, --)) +>dt : Symbol(dt, Decl(temporal.ts, 1277, 9)) +>toLocaleString : Symbol(Temporal.PlainDateTime.toLocaleString, Decl(lib.esnext.temporal.d.ts, --, --)) + + dt.toLocaleString("de-DE"); // example output: 7.12.1995, 03:24:30 +>dt.toLocaleString : Symbol(Temporal.PlainDateTime.toLocaleString, Decl(lib.esnext.temporal.d.ts, --, --)) +>dt : Symbol(dt, Decl(temporal.ts, 1277, 9)) +>toLocaleString : Symbol(Temporal.PlainDateTime.toLocaleString, Decl(lib.esnext.temporal.d.ts, --, --)) + + dt.toLocaleString("de-DE", { timeZone: "Europe/Berlin", weekday: "long" }); // => 'Donnerstag' +>dt.toLocaleString : Symbol(Temporal.PlainDateTime.toLocaleString, Decl(lib.esnext.temporal.d.ts, --, --)) +>dt : Symbol(dt, Decl(temporal.ts, 1277, 9)) +>toLocaleString : Symbol(Temporal.PlainDateTime.toLocaleString, Decl(lib.esnext.temporal.d.ts, --, --)) +>timeZone : Symbol(timeZone, Decl(temporal.ts, 1280, 32)) +>weekday : Symbol(weekday, Decl(temporal.ts, 1280, 59)) + + dt.toLocaleString("en-US-u-nu-fullwide-hc-h12"); // => '12/7/1995, 3:24:30 AM' +>dt.toLocaleString : Symbol(Temporal.PlainDateTime.toLocaleString, Decl(lib.esnext.temporal.d.ts, --, --)) +>dt : Symbol(dt, Decl(temporal.ts, 1277, 9)) +>toLocaleString : Symbol(Temporal.PlainDateTime.toLocaleString, Decl(lib.esnext.temporal.d.ts, --, --)) +} + +{ + const dt = Temporal.PlainDateTime.from("1995-12-07T03:24:30.000003500"); +>dt : Symbol(dt, Decl(temporal.ts, 1285, 9)) +>Temporal.PlainDateTime.from : Symbol(Temporal.PlainDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainDateTime : Symbol(Temporal.PlainDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainDateTime : Symbol(Temporal.PlainDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.PlainDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) + + dt.toPlainDate(); // => 1995-12-07 +>dt.toPlainDate : Symbol(Temporal.PlainDateTime.toPlainDate, Decl(lib.esnext.temporal.d.ts, --, --)) +>dt : Symbol(dt, Decl(temporal.ts, 1285, 9)) +>toPlainDate : Symbol(Temporal.PlainDateTime.toPlainDate, Decl(lib.esnext.temporal.d.ts, --, --)) + + dt.toPlainTime(); // => 03:24:30.0000035 +>dt.toPlainTime : Symbol(Temporal.PlainDateTime.toPlainTime, Decl(lib.esnext.temporal.d.ts, --, --)) +>dt : Symbol(dt, Decl(temporal.ts, 1285, 9)) +>toPlainTime : Symbol(Temporal.PlainDateTime.toPlainTime, Decl(lib.esnext.temporal.d.ts, --, --)) + + dt.toPlainDate().toPlainYearMonth(); // => 1995-12 +>dt.toPlainDate().toPlainYearMonth : Symbol(Temporal.PlainDate.toPlainYearMonth, Decl(lib.esnext.temporal.d.ts, --, --)) +>dt.toPlainDate : Symbol(Temporal.PlainDateTime.toPlainDate, Decl(lib.esnext.temporal.d.ts, --, --)) +>dt : Symbol(dt, Decl(temporal.ts, 1285, 9)) +>toPlainDate : Symbol(Temporal.PlainDateTime.toPlainDate, Decl(lib.esnext.temporal.d.ts, --, --)) +>toPlainYearMonth : Symbol(Temporal.PlainDate.toPlainYearMonth, Decl(lib.esnext.temporal.d.ts, --, --)) + + dt.toPlainDate().toPlainMonthDay(); // => 12-07 +>dt.toPlainDate().toPlainMonthDay : Symbol(Temporal.PlainDate.toPlainMonthDay, Decl(lib.esnext.temporal.d.ts, --, --)) +>dt.toPlainDate : Symbol(Temporal.PlainDateTime.toPlainDate, Decl(lib.esnext.temporal.d.ts, --, --)) +>dt : Symbol(dt, Decl(temporal.ts, 1285, 9)) +>toPlainDate : Symbol(Temporal.PlainDateTime.toPlainDate, Decl(lib.esnext.temporal.d.ts, --, --)) +>toPlainMonthDay : Symbol(Temporal.PlainDate.toPlainMonthDay, Decl(lib.esnext.temporal.d.ts, --, --)) +} + +{ + // The June 2019 meeting + const ym = new Temporal.PlainYearMonth(2019, 6); +>ym : Symbol(ym, Decl(temporal.ts, 1294, 9)) +>Temporal.PlainYearMonth : Symbol(Temporal.PlainYearMonth, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainYearMonth : Symbol(Temporal.PlainYearMonth, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) + + // => 2019-06 +} + +{ + let ym: Temporal.PlainYearMonth; +>ym : Symbol(ym, Decl(temporal.ts, 1299, 7)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainYearMonth : Symbol(Temporal.PlainYearMonth, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) + + ym = Temporal.PlainYearMonth.from("2019-06"); // => 2019-06 +>ym : Symbol(ym, Decl(temporal.ts, 1299, 7)) +>Temporal.PlainYearMonth.from : Symbol(Temporal.PlainYearMonthConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainYearMonth : Symbol(Temporal.PlainYearMonth, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainYearMonth : Symbol(Temporal.PlainYearMonth, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.PlainYearMonthConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) + + ym = Temporal.PlainYearMonth.from("2019-06-24"); // => 2019-06 +>ym : Symbol(ym, Decl(temporal.ts, 1299, 7)) +>Temporal.PlainYearMonth.from : Symbol(Temporal.PlainYearMonthConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainYearMonth : Symbol(Temporal.PlainYearMonth, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainYearMonth : Symbol(Temporal.PlainYearMonth, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.PlainYearMonthConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) + + ym = Temporal.PlainYearMonth.from("2019-06-24T15:43:27"); // => 2019-06 +>ym : Symbol(ym, Decl(temporal.ts, 1299, 7)) +>Temporal.PlainYearMonth.from : Symbol(Temporal.PlainYearMonthConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainYearMonth : Symbol(Temporal.PlainYearMonth, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainYearMonth : Symbol(Temporal.PlainYearMonth, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.PlainYearMonthConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) + + ym = Temporal.PlainYearMonth.from("2019-06-24T15:43:27+01:00[Europe/Brussels]"); +>ym : Symbol(ym, Decl(temporal.ts, 1299, 7)) +>Temporal.PlainYearMonth.from : Symbol(Temporal.PlainYearMonthConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainYearMonth : Symbol(Temporal.PlainYearMonth, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainYearMonth : Symbol(Temporal.PlainYearMonth, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.PlainYearMonthConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) + + // => 2019-06 + ym === Temporal.PlainYearMonth.from(ym); // => false +>ym : Symbol(ym, Decl(temporal.ts, 1299, 7)) +>Temporal.PlainYearMonth.from : Symbol(Temporal.PlainYearMonthConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainYearMonth : Symbol(Temporal.PlainYearMonth, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainYearMonth : Symbol(Temporal.PlainYearMonth, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.PlainYearMonthConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>ym : Symbol(ym, Decl(temporal.ts, 1299, 7)) + + ym = Temporal.PlainYearMonth.from({ year: 2019, month: 6 }); // => 2019-06 +>ym : Symbol(ym, Decl(temporal.ts, 1299, 7)) +>Temporal.PlainYearMonth.from : Symbol(Temporal.PlainYearMonthConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainYearMonth : Symbol(Temporal.PlainYearMonth, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainYearMonth : Symbol(Temporal.PlainYearMonth, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.PlainYearMonthConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>year : Symbol(year, Decl(temporal.ts, 1308, 39)) +>month : Symbol(month, Decl(temporal.ts, 1308, 51)) + + ym = Temporal.PlainYearMonth.from(Temporal.PlainDate.from("2019-06-24")); +>ym : Symbol(ym, Decl(temporal.ts, 1299, 7)) +>Temporal.PlainYearMonth.from : Symbol(Temporal.PlainYearMonthConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainYearMonth : Symbol(Temporal.PlainYearMonth, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainYearMonth : Symbol(Temporal.PlainYearMonth, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.PlainYearMonthConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainDate.from : Symbol(Temporal.PlainDateConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainDate : Symbol(Temporal.PlainDate, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainDate : Symbol(Temporal.PlainDate, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.PlainDateConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) + + // => 2019-06 + // (same as above; Temporal.PlainDate has year and month properties) + + // Different overflow modes + ym = Temporal.PlainYearMonth.from({ year: 2001, month: 13 }, { overflow: "constrain" }); +>ym : Symbol(ym, Decl(temporal.ts, 1299, 7)) +>Temporal.PlainYearMonth.from : Symbol(Temporal.PlainYearMonthConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainYearMonth : Symbol(Temporal.PlainYearMonth, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainYearMonth : Symbol(Temporal.PlainYearMonth, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.PlainYearMonthConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>year : Symbol(year, Decl(temporal.ts, 1314, 39)) +>month : Symbol(month, Decl(temporal.ts, 1314, 51)) +>overflow : Symbol(overflow, Decl(temporal.ts, 1314, 66)) + + // => 2001-12 + ym = Temporal.PlainYearMonth.from({ year: 2001, month: 13 }, { overflow: "reject" }); +>ym : Symbol(ym, Decl(temporal.ts, 1299, 7)) +>Temporal.PlainYearMonth.from : Symbol(Temporal.PlainYearMonthConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainYearMonth : Symbol(Temporal.PlainYearMonth, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainYearMonth : Symbol(Temporal.PlainYearMonth, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.PlainYearMonthConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>year : Symbol(year, Decl(temporal.ts, 1316, 39)) +>month : Symbol(month, Decl(temporal.ts, 1316, 51)) +>overflow : Symbol(overflow, Decl(temporal.ts, 1316, 66)) + + // => throws +} + +{ + const one = Temporal.PlainYearMonth.from("2006-08"); +>one : Symbol(one, Decl(temporal.ts, 1321, 9)) +>Temporal.PlainYearMonth.from : Symbol(Temporal.PlainYearMonthConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainYearMonth : Symbol(Temporal.PlainYearMonth, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainYearMonth : Symbol(Temporal.PlainYearMonth, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.PlainYearMonthConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) + + const two = Temporal.PlainYearMonth.from("2015-07"); +>two : Symbol(two, Decl(temporal.ts, 1322, 9)) +>Temporal.PlainYearMonth.from : Symbol(Temporal.PlainYearMonthConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainYearMonth : Symbol(Temporal.PlainYearMonth, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainYearMonth : Symbol(Temporal.PlainYearMonth, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.PlainYearMonthConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) + + const three = Temporal.PlainYearMonth.from("1930-02"); +>three : Symbol(three, Decl(temporal.ts, 1323, 9)) +>Temporal.PlainYearMonth.from : Symbol(Temporal.PlainYearMonthConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainYearMonth : Symbol(Temporal.PlainYearMonth, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainYearMonth : Symbol(Temporal.PlainYearMonth, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.PlainYearMonthConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) + + const sorted = [one, two, three].sort(Temporal.PlainYearMonth.compare); +>sorted : Symbol(sorted, Decl(temporal.ts, 1324, 9)) +>[one, two, three].sort : Symbol(Array.sort, Decl(lib.es5.d.ts, --, --)) +>one : Symbol(one, Decl(temporal.ts, 1321, 9)) +>two : Symbol(two, Decl(temporal.ts, 1322, 9)) +>three : Symbol(three, Decl(temporal.ts, 1323, 9)) +>sort : Symbol(Array.sort, Decl(lib.es5.d.ts, --, --)) +>Temporal.PlainYearMonth.compare : Symbol(Temporal.PlainYearMonthConstructor.compare, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainYearMonth : Symbol(Temporal.PlainYearMonth, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainYearMonth : Symbol(Temporal.PlainYearMonth, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>compare : Symbol(Temporal.PlainYearMonthConstructor.compare, Decl(lib.esnext.temporal.d.ts, --, --)) + + sorted.join(" "); // => '1930-02 2006-08 2015-07' +>sorted.join : Symbol(Array.join, Decl(lib.es5.d.ts, --, --)) +>sorted : Symbol(sorted, Decl(temporal.ts, 1324, 9)) +>join : Symbol(Array.join, Decl(lib.es5.d.ts, --, --)) +} + +{ + let ym: Temporal.PlainYearMonth; +>ym : Symbol(ym, Decl(temporal.ts, 1329, 7)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainYearMonth : Symbol(Temporal.PlainYearMonth, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) + + ym = Temporal.PlainYearMonth.from("2019-06"); +>ym : Symbol(ym, Decl(temporal.ts, 1329, 7)) +>Temporal.PlainYearMonth.from : Symbol(Temporal.PlainYearMonthConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainYearMonth : Symbol(Temporal.PlainYearMonth, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainYearMonth : Symbol(Temporal.PlainYearMonth, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.PlainYearMonthConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) + + ym.year; // => 2019 +>ym.year : Symbol(Temporal.PlainYearMonth.year, Decl(lib.esnext.temporal.d.ts, --, --)) +>ym : Symbol(ym, Decl(temporal.ts, 1329, 7)) +>year : Symbol(Temporal.PlainYearMonth.year, Decl(lib.esnext.temporal.d.ts, --, --)) + + ym.month; // => 6 +>ym.month : Symbol(Temporal.PlainYearMonth.month, Decl(lib.esnext.temporal.d.ts, --, --)) +>ym : Symbol(ym, Decl(temporal.ts, 1329, 7)) +>month : Symbol(Temporal.PlainYearMonth.month, Decl(lib.esnext.temporal.d.ts, --, --)) + + ym.monthCode; // => 'M06' +>ym.monthCode : Symbol(Temporal.PlainYearMonth.monthCode, Decl(lib.esnext.temporal.d.ts, --, --)) +>ym : Symbol(ym, Decl(temporal.ts, 1329, 7)) +>monthCode : Symbol(Temporal.PlainYearMonth.monthCode, Decl(lib.esnext.temporal.d.ts, --, --)) + + ym = Temporal.PlainYearMonth.from("2019-02-23[u-ca=hebrew]"); +>ym : Symbol(ym, Decl(temporal.ts, 1329, 7)) +>Temporal.PlainYearMonth.from : Symbol(Temporal.PlainYearMonthConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainYearMonth : Symbol(Temporal.PlainYearMonth, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainYearMonth : Symbol(Temporal.PlainYearMonth, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.PlainYearMonthConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) + + ym.year; // => 5779 +>ym.year : Symbol(Temporal.PlainYearMonth.year, Decl(lib.esnext.temporal.d.ts, --, --)) +>ym : Symbol(ym, Decl(temporal.ts, 1329, 7)) +>year : Symbol(Temporal.PlainYearMonth.year, Decl(lib.esnext.temporal.d.ts, --, --)) + + ym.month; // => 6 +>ym.month : Symbol(Temporal.PlainYearMonth.month, Decl(lib.esnext.temporal.d.ts, --, --)) +>ym : Symbol(ym, Decl(temporal.ts, 1329, 7)) +>month : Symbol(Temporal.PlainYearMonth.month, Decl(lib.esnext.temporal.d.ts, --, --)) + + ym.monthCode; // => 'M05L' +>ym.monthCode : Symbol(Temporal.PlainYearMonth.monthCode, Decl(lib.esnext.temporal.d.ts, --, --)) +>ym : Symbol(ym, Decl(temporal.ts, 1329, 7)) +>monthCode : Symbol(Temporal.PlainYearMonth.monthCode, Decl(lib.esnext.temporal.d.ts, --, --)) +} + +{ + const ym = Temporal.PlainYearMonth.from("-000015-01-01[u-ca=gregory]"); +>ym : Symbol(ym, Decl(temporal.ts, 1343, 9)) +>Temporal.PlainYearMonth.from : Symbol(Temporal.PlainYearMonthConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainYearMonth : Symbol(Temporal.PlainYearMonth, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainYearMonth : Symbol(Temporal.PlainYearMonth, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.PlainYearMonthConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) + + ym.era; +>ym.era : Symbol(Temporal.PlainYearMonth.era, Decl(lib.esnext.temporal.d.ts, --, --)) +>ym : Symbol(ym, Decl(temporal.ts, 1343, 9)) +>era : Symbol(Temporal.PlainYearMonth.era, Decl(lib.esnext.temporal.d.ts, --, --)) + + // => 'bce' + ym.eraYear; +>ym.eraYear : Symbol(Temporal.PlainYearMonth.eraYear, Decl(lib.esnext.temporal.d.ts, --, --)) +>ym : Symbol(ym, Decl(temporal.ts, 1343, 9)) +>eraYear : Symbol(Temporal.PlainYearMonth.eraYear, Decl(lib.esnext.temporal.d.ts, --, --)) + + // => 16 + ym.year; +>ym.year : Symbol(Temporal.PlainYearMonth.year, Decl(lib.esnext.temporal.d.ts, --, --)) +>ym : Symbol(ym, Decl(temporal.ts, 1343, 9)) +>year : Symbol(Temporal.PlainYearMonth.year, Decl(lib.esnext.temporal.d.ts, --, --)) + + // => -15 +} + +{ + // Attempt to write some mnemonic poetry + const monthsByDays: Record = {}; +>monthsByDays : Symbol(monthsByDays, Decl(temporal.ts, 1354, 9)) +>Record : Symbol(Record, Decl(lib.es5.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainYearMonth : Symbol(Temporal.PlainYearMonth, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) + + for (let month = 1; month <= 12; month++) { +>month : Symbol(month, Decl(temporal.ts, 1355, 12)) +>month : Symbol(month, Decl(temporal.ts, 1355, 12)) +>month : Symbol(month, Decl(temporal.ts, 1355, 12)) + + const ym = Temporal.PlainYearMonth.from({ year: 2020, calendar: "iso8601", month }); +>ym : Symbol(ym, Decl(temporal.ts, 1356, 13)) +>Temporal.PlainYearMonth.from : Symbol(Temporal.PlainYearMonthConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainYearMonth : Symbol(Temporal.PlainYearMonth, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainYearMonth : Symbol(Temporal.PlainYearMonth, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.PlainYearMonthConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>year : Symbol(year, Decl(temporal.ts, 1356, 49)) +>calendar : Symbol(calendar, Decl(temporal.ts, 1356, 61)) +>month : Symbol(month, Decl(temporal.ts, 1356, 82)) + + monthsByDays[ym.daysInMonth] = (monthsByDays[ym.daysInMonth] || []).concat(ym); +>monthsByDays : Symbol(monthsByDays, Decl(temporal.ts, 1354, 9)) +>ym.daysInMonth : Symbol(Temporal.PlainYearMonth.daysInMonth, Decl(lib.esnext.temporal.d.ts, --, --)) +>ym : Symbol(ym, Decl(temporal.ts, 1356, 13)) +>daysInMonth : Symbol(Temporal.PlainYearMonth.daysInMonth, Decl(lib.esnext.temporal.d.ts, --, --)) +>(monthsByDays[ym.daysInMonth] || []).concat : Symbol(Array.concat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>monthsByDays : Symbol(monthsByDays, Decl(temporal.ts, 1354, 9)) +>ym.daysInMonth : Symbol(Temporal.PlainYearMonth.daysInMonth, Decl(lib.esnext.temporal.d.ts, --, --)) +>ym : Symbol(ym, Decl(temporal.ts, 1356, 13)) +>daysInMonth : Symbol(Temporal.PlainYearMonth.daysInMonth, Decl(lib.esnext.temporal.d.ts, --, --)) +>concat : Symbol(Array.concat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>ym : Symbol(ym, Decl(temporal.ts, 1356, 13)) + } + + const strings = monthsByDays[30].map(ym => ym.toLocaleString("en", { month: "long", calendar: "iso8601" })); +>strings : Symbol(strings, Decl(temporal.ts, 1360, 9)) +>monthsByDays[30].map : Symbol(Array.map, Decl(lib.es5.d.ts, --, --)) +>monthsByDays : Symbol(monthsByDays, Decl(temporal.ts, 1354, 9)) +>map : Symbol(Array.map, Decl(lib.es5.d.ts, --, --)) +>ym : Symbol(ym, Decl(temporal.ts, 1360, 41)) +>ym.toLocaleString : Symbol(Temporal.PlainYearMonth.toLocaleString, Decl(lib.esnext.temporal.d.ts, --, --)) +>ym : Symbol(ym, Decl(temporal.ts, 1360, 41)) +>toLocaleString : Symbol(Temporal.PlainYearMonth.toLocaleString, Decl(lib.esnext.temporal.d.ts, --, --)) +>month : Symbol(month, Decl(temporal.ts, 1360, 72)) +>calendar : Symbol(calendar, Decl(temporal.ts, 1360, 87)) + + // Shuffle to improve poem as determined empirically + strings.unshift(strings.pop()!); +>strings.unshift : Symbol(Array.unshift, Decl(lib.es5.d.ts, --, --)) +>strings : Symbol(strings, Decl(temporal.ts, 1360, 9)) +>unshift : Symbol(Array.unshift, Decl(lib.es5.d.ts, --, --)) +>strings.pop : Symbol(Array.pop, Decl(lib.es5.d.ts, --, --)) +>strings : Symbol(strings, Decl(temporal.ts, 1360, 9)) +>pop : Symbol(Array.pop, Decl(lib.es5.d.ts, --, --)) + + const format = new Intl.ListFormat("en"); +>format : Symbol(format, Decl(temporal.ts, 1363, 9)) +>Intl.ListFormat : Symbol(Intl.ListFormat, Decl(lib.es2021.intl.d.ts, --, --), Decl(lib.es2021.intl.d.ts, --, --)) +>Intl : Symbol(Intl, Decl(lib.es5.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2020.intl.d.ts, --, --), Decl(lib.es2021.intl.d.ts, --, --), Decl(lib.es2025.intl.d.ts, --, --) ... and 1 more) +>ListFormat : Symbol(Intl.ListFormat, Decl(lib.es2021.intl.d.ts, --, --), Decl(lib.es2021.intl.d.ts, --, --)) + + const poem = `Thirty days hath ${format.format(strings)}`; +>poem : Symbol(poem, Decl(temporal.ts, 1364, 9)) +>format.format : Symbol(Intl.ListFormat.format, Decl(lib.es2021.intl.d.ts, --, --)) +>format : Symbol(format, Decl(temporal.ts, 1363, 9)) +>format : Symbol(Intl.ListFormat.format, Decl(lib.es2021.intl.d.ts, --, --)) +>strings : Symbol(strings, Decl(temporal.ts, 1360, 9)) + + console.log(poem); +>console.log : Symbol(Console.log, Decl(lib.dom.d.ts, --, --)) +>console : Symbol(console, Decl(lib.dom.d.ts, --, --)) +>log : Symbol(Console.log, Decl(lib.dom.d.ts, --, --)) +>poem : Symbol(poem, Decl(temporal.ts, 1364, 9)) +} + +{ + const ym = Temporal.PlainYearMonth.from({ year: 2019, month: 6, calendar: "iso8601" }); +>ym : Symbol(ym, Decl(temporal.ts, 1370, 9)) +>Temporal.PlainYearMonth.from : Symbol(Temporal.PlainYearMonthConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainYearMonth : Symbol(Temporal.PlainYearMonth, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainYearMonth : Symbol(Temporal.PlainYearMonth, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.PlainYearMonthConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>year : Symbol(year, Decl(temporal.ts, 1370, 45)) +>month : Symbol(month, Decl(temporal.ts, 1370, 57)) +>calendar : Symbol(calendar, Decl(temporal.ts, 1370, 67)) + + const percent = ym.daysInMonth / ym.daysInYear; +>percent : Symbol(percent, Decl(temporal.ts, 1371, 9)) +>ym.daysInMonth : Symbol(Temporal.PlainYearMonth.daysInMonth, Decl(lib.esnext.temporal.d.ts, --, --)) +>ym : Symbol(ym, Decl(temporal.ts, 1370, 9)) +>daysInMonth : Symbol(Temporal.PlainYearMonth.daysInMonth, Decl(lib.esnext.temporal.d.ts, --, --)) +>ym.daysInYear : Symbol(Temporal.PlainYearMonth.daysInYear, Decl(lib.esnext.temporal.d.ts, --, --)) +>ym : Symbol(ym, Decl(temporal.ts, 1370, 9)) +>daysInYear : Symbol(Temporal.PlainYearMonth.daysInYear, Decl(lib.esnext.temporal.d.ts, --, --)) + + `${ym.toLocaleString("en", { month: "long", year: "numeric", calendar: "iso8601" })} was ${percent.toLocaleString("en", { style: "percent" })} of the year!`; +>ym.toLocaleString : Symbol(Temporal.PlainYearMonth.toLocaleString, Decl(lib.esnext.temporal.d.ts, --, --)) +>ym : Symbol(ym, Decl(temporal.ts, 1370, 9)) +>toLocaleString : Symbol(Temporal.PlainYearMonth.toLocaleString, Decl(lib.esnext.temporal.d.ts, --, --)) +>month : Symbol(month, Decl(temporal.ts, 1372, 32)) +>year : Symbol(year, Decl(temporal.ts, 1372, 47)) +>calendar : Symbol(calendar, Decl(temporal.ts, 1372, 64)) +>percent.toLocaleString : Symbol(Number.toLocaleString, Decl(lib.es5.d.ts, --, --)) +>percent : Symbol(percent, Decl(temporal.ts, 1371, 9)) +>toLocaleString : Symbol(Number.toLocaleString, Decl(lib.es5.d.ts, --, --)) +>style : Symbol(style, Decl(temporal.ts, 1372, 125)) + + // => 'June 2019 was 8% of the year!' +} + +{ + const ym = Temporal.PlainYearMonth.from("1900-01"); +>ym : Symbol(ym, Decl(temporal.ts, 1377, 9)) +>Temporal.PlainYearMonth.from : Symbol(Temporal.PlainYearMonthConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainYearMonth : Symbol(Temporal.PlainYearMonth, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainYearMonth : Symbol(Temporal.PlainYearMonth, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.PlainYearMonthConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) + + ym.monthsInYear; // => 12 +>ym.monthsInYear : Symbol(Temporal.PlainYearMonth.monthsInYear, Decl(lib.esnext.temporal.d.ts, --, --)) +>ym : Symbol(ym, Decl(temporal.ts, 1377, 9)) +>monthsInYear : Symbol(Temporal.PlainYearMonth.monthsInYear, Decl(lib.esnext.temporal.d.ts, --, --)) +} + +{ + // Was June 2019 in a leap year? + const ym = Temporal.PlainYearMonth.from("2019-06"); +>ym : Symbol(ym, Decl(temporal.ts, 1383, 9)) +>Temporal.PlainYearMonth.from : Symbol(Temporal.PlainYearMonthConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainYearMonth : Symbol(Temporal.PlainYearMonth, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainYearMonth : Symbol(Temporal.PlainYearMonth, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.PlainYearMonthConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) + + ym.inLeapYear; // => false +>ym.inLeapYear : Symbol(Temporal.PlainYearMonth.inLeapYear, Decl(lib.esnext.temporal.d.ts, --, --)) +>ym : Symbol(ym, Decl(temporal.ts, 1383, 9)) +>inLeapYear : Symbol(Temporal.PlainYearMonth.inLeapYear, Decl(lib.esnext.temporal.d.ts, --, --)) + + // Is 2100 a leap year? (no, because it's divisible by 100 and not 400) + ym.with({ year: 2100 }).inLeapYear; // => false +>ym.with({ year: 2100 }).inLeapYear : Symbol(Temporal.PlainYearMonth.inLeapYear, Decl(lib.esnext.temporal.d.ts, --, --)) +>ym.with : Symbol(Temporal.PlainYearMonth.with, Decl(lib.esnext.temporal.d.ts, --, --)) +>ym : Symbol(ym, Decl(temporal.ts, 1383, 9)) +>with : Symbol(Temporal.PlainYearMonth.with, Decl(lib.esnext.temporal.d.ts, --, --)) +>year : Symbol(year, Decl(temporal.ts, 1386, 13)) +>inLeapYear : Symbol(Temporal.PlainYearMonth.inLeapYear, Decl(lib.esnext.temporal.d.ts, --, --)) +} + +{ + const ym = Temporal.PlainYearMonth.from("2019-06"); +>ym : Symbol(ym, Decl(temporal.ts, 1390, 9)) +>Temporal.PlainYearMonth.from : Symbol(Temporal.PlainYearMonthConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainYearMonth : Symbol(Temporal.PlainYearMonth, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainYearMonth : Symbol(Temporal.PlainYearMonth, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.PlainYearMonthConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) + + // Get December of that year + ym.with({ month: 12 }); // => 2019-12 +>ym.with : Symbol(Temporal.PlainYearMonth.with, Decl(lib.esnext.temporal.d.ts, --, --)) +>ym : Symbol(ym, Decl(temporal.ts, 1390, 9)) +>with : Symbol(Temporal.PlainYearMonth.with, Decl(lib.esnext.temporal.d.ts, --, --)) +>month : Symbol(month, Decl(temporal.ts, 1392, 13)) +} + +{ + const ym = Temporal.PlainYearMonth.from("2019-06"); +>ym : Symbol(ym, Decl(temporal.ts, 1396, 9)) +>Temporal.PlainYearMonth.from : Symbol(Temporal.PlainYearMonthConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainYearMonth : Symbol(Temporal.PlainYearMonth, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainYearMonth : Symbol(Temporal.PlainYearMonth, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.PlainYearMonthConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) + + ym.add({ years: 20, months: 4 }); // => 2039-10 +>ym.add : Symbol(Temporal.PlainYearMonth.add, Decl(lib.esnext.temporal.d.ts, --, --)) +>ym : Symbol(ym, Decl(temporal.ts, 1396, 9)) +>add : Symbol(Temporal.PlainYearMonth.add, Decl(lib.esnext.temporal.d.ts, --, --)) +>years : Symbol(years, Decl(temporal.ts, 1397, 12)) +>months : Symbol(months, Decl(temporal.ts, 1397, 23)) +} + +{ + const ym = Temporal.PlainYearMonth.from("2019-06"); +>ym : Symbol(ym, Decl(temporal.ts, 1401, 9)) +>Temporal.PlainYearMonth.from : Symbol(Temporal.PlainYearMonthConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainYearMonth : Symbol(Temporal.PlainYearMonth, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainYearMonth : Symbol(Temporal.PlainYearMonth, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.PlainYearMonthConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) + + ym.subtract({ years: 20, months: 4 }); // => 1999-02 +>ym.subtract : Symbol(Temporal.PlainYearMonth.subtract, Decl(lib.esnext.temporal.d.ts, --, --)) +>ym : Symbol(ym, Decl(temporal.ts, 1401, 9)) +>subtract : Symbol(Temporal.PlainYearMonth.subtract, Decl(lib.esnext.temporal.d.ts, --, --)) +>years : Symbol(years, Decl(temporal.ts, 1402, 17)) +>months : Symbol(months, Decl(temporal.ts, 1402, 28)) +} + +{ + const ym = Temporal.PlainYearMonth.from("2006-08"); +>ym : Symbol(ym, Decl(temporal.ts, 1406, 9)) +>Temporal.PlainYearMonth.from : Symbol(Temporal.PlainYearMonthConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainYearMonth : Symbol(Temporal.PlainYearMonth, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainYearMonth : Symbol(Temporal.PlainYearMonth, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.PlainYearMonthConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) + + const other = Temporal.PlainYearMonth.from("2019-06"); +>other : Symbol(other, Decl(temporal.ts, 1407, 9)) +>Temporal.PlainYearMonth.from : Symbol(Temporal.PlainYearMonthConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainYearMonth : Symbol(Temporal.PlainYearMonth, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainYearMonth : Symbol(Temporal.PlainYearMonth, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.PlainYearMonthConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) + + ym.until(other); // => P12Y10M +>ym.until : Symbol(Temporal.PlainYearMonth.until, Decl(lib.esnext.temporal.d.ts, --, --)) +>ym : Symbol(ym, Decl(temporal.ts, 1406, 9)) +>until : Symbol(Temporal.PlainYearMonth.until, Decl(lib.esnext.temporal.d.ts, --, --)) +>other : Symbol(other, Decl(temporal.ts, 1407, 9)) + + ym.until(other, { largestUnit: "month" }); // => P154M +>ym.until : Symbol(Temporal.PlainYearMonth.until, Decl(lib.esnext.temporal.d.ts, --, --)) +>ym : Symbol(ym, Decl(temporal.ts, 1406, 9)) +>until : Symbol(Temporal.PlainYearMonth.until, Decl(lib.esnext.temporal.d.ts, --, --)) +>other : Symbol(other, Decl(temporal.ts, 1407, 9)) +>largestUnit : Symbol(largestUnit, Decl(temporal.ts, 1409, 21)) + + other.until(ym, { largestUnit: "month" }); // => -P154M +>other.until : Symbol(Temporal.PlainYearMonth.until, Decl(lib.esnext.temporal.d.ts, --, --)) +>other : Symbol(other, Decl(temporal.ts, 1407, 9)) +>until : Symbol(Temporal.PlainYearMonth.until, Decl(lib.esnext.temporal.d.ts, --, --)) +>ym : Symbol(ym, Decl(temporal.ts, 1406, 9)) +>largestUnit : Symbol(largestUnit, Decl(temporal.ts, 1410, 21)) + + // If you really need to calculate the difference between two YearMonths + // in days, you can eliminate the ambiguity by explicitly choosing the + // day of the month (and if applicable, the time of that day) from which + // you want to reckon the difference. For example, using the first of + // the month to calculate a number of days: + ym.toPlainDate({ day: 1 }).until(other.toPlainDate({ day: 1 }), { largestUnit: "day" }); // => P4687D +>ym.toPlainDate({ day: 1 }).until : Symbol(Temporal.PlainDate.until, Decl(lib.esnext.temporal.d.ts, --, --)) +>ym.toPlainDate : Symbol(Temporal.PlainYearMonth.toPlainDate, Decl(lib.esnext.temporal.d.ts, --, --)) +>ym : Symbol(ym, Decl(temporal.ts, 1406, 9)) +>toPlainDate : Symbol(Temporal.PlainYearMonth.toPlainDate, Decl(lib.esnext.temporal.d.ts, --, --)) +>day : Symbol(day, Decl(temporal.ts, 1417, 20)) +>until : Symbol(Temporal.PlainDate.until, Decl(lib.esnext.temporal.d.ts, --, --)) +>other.toPlainDate : Symbol(Temporal.PlainYearMonth.toPlainDate, Decl(lib.esnext.temporal.d.ts, --, --)) +>other : Symbol(other, Decl(temporal.ts, 1407, 9)) +>toPlainDate : Symbol(Temporal.PlainYearMonth.toPlainDate, Decl(lib.esnext.temporal.d.ts, --, --)) +>day : Symbol(day, Decl(temporal.ts, 1417, 56)) +>largestUnit : Symbol(largestUnit, Decl(temporal.ts, 1417, 69)) +} + +{ + const ym = Temporal.PlainYearMonth.from("2019-06"); +>ym : Symbol(ym, Decl(temporal.ts, 1421, 9)) +>Temporal.PlainYearMonth.from : Symbol(Temporal.PlainYearMonthConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainYearMonth : Symbol(Temporal.PlainYearMonth, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainYearMonth : Symbol(Temporal.PlainYearMonth, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.PlainYearMonthConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) + + const other = Temporal.PlainYearMonth.from("2006-08"); +>other : Symbol(other, Decl(temporal.ts, 1422, 9)) +>Temporal.PlainYearMonth.from : Symbol(Temporal.PlainYearMonthConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainYearMonth : Symbol(Temporal.PlainYearMonth, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainYearMonth : Symbol(Temporal.PlainYearMonth, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.PlainYearMonthConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) + + ym.since(other); // => P12Y10M +>ym.since : Symbol(Temporal.PlainYearMonth.since, Decl(lib.esnext.temporal.d.ts, --, --)) +>ym : Symbol(ym, Decl(temporal.ts, 1421, 9)) +>since : Symbol(Temporal.PlainYearMonth.since, Decl(lib.esnext.temporal.d.ts, --, --)) +>other : Symbol(other, Decl(temporal.ts, 1422, 9)) +} + +{ + const ym = Temporal.PlainYearMonth.from("2019-06"); +>ym : Symbol(ym, Decl(temporal.ts, 1427, 9)) +>Temporal.PlainYearMonth.from : Symbol(Temporal.PlainYearMonthConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainYearMonth : Symbol(Temporal.PlainYearMonth, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainYearMonth : Symbol(Temporal.PlainYearMonth, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.PlainYearMonthConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) + + const other = Temporal.PlainYearMonth.from("2006-08"); +>other : Symbol(other, Decl(temporal.ts, 1428, 9)) +>Temporal.PlainYearMonth.from : Symbol(Temporal.PlainYearMonthConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainYearMonth : Symbol(Temporal.PlainYearMonth, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainYearMonth : Symbol(Temporal.PlainYearMonth, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.PlainYearMonthConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) + + ym.equals(other); // => false +>ym.equals : Symbol(Temporal.PlainYearMonth.equals, Decl(lib.esnext.temporal.d.ts, --, --)) +>ym : Symbol(ym, Decl(temporal.ts, 1427, 9)) +>equals : Symbol(Temporal.PlainYearMonth.equals, Decl(lib.esnext.temporal.d.ts, --, --)) +>other : Symbol(other, Decl(temporal.ts, 1428, 9)) + + ym.equals(ym); // => true +>ym.equals : Symbol(Temporal.PlainYearMonth.equals, Decl(lib.esnext.temporal.d.ts, --, --)) +>ym : Symbol(ym, Decl(temporal.ts, 1427, 9)) +>equals : Symbol(Temporal.PlainYearMonth.equals, Decl(lib.esnext.temporal.d.ts, --, --)) +>ym : Symbol(ym, Decl(temporal.ts, 1427, 9)) +} + +{ + const ym = Temporal.PlainYearMonth.from("2019-06"); +>ym : Symbol(ym, Decl(temporal.ts, 1434, 9)) +>Temporal.PlainYearMonth.from : Symbol(Temporal.PlainYearMonthConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainYearMonth : Symbol(Temporal.PlainYearMonth, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainYearMonth : Symbol(Temporal.PlainYearMonth, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.PlainYearMonthConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) + + ym.toString(); // => '2019-06' +>ym.toString : Symbol(Temporal.PlainYearMonth.toString, Decl(lib.esnext.temporal.d.ts, --, --)) +>ym : Symbol(ym, Decl(temporal.ts, 1434, 9)) +>toString : Symbol(Temporal.PlainYearMonth.toString, Decl(lib.esnext.temporal.d.ts, --, --)) +} + +{ + const { calendar } = new Intl.DateTimeFormat().resolvedOptions(); +>calendar : Symbol(calendar, Decl(temporal.ts, 1439, 11)) +>new Intl.DateTimeFormat().resolvedOptions : Symbol(Intl.DateTimeFormat.resolvedOptions, Decl(lib.es5.d.ts, --, --)) +>Intl.DateTimeFormat : Symbol(Intl.DateTimeFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2021.intl.d.ts, --, --), Decl(lib.esnext.intl.d.ts, --, --)) +>Intl : Symbol(Intl, Decl(lib.es5.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2020.intl.d.ts, --, --), Decl(lib.es2021.intl.d.ts, --, --), Decl(lib.es2025.intl.d.ts, --, --) ... and 1 more) +>DateTimeFormat : Symbol(Intl.DateTimeFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2021.intl.d.ts, --, --), Decl(lib.esnext.intl.d.ts, --, --)) +>resolvedOptions : Symbol(Intl.DateTimeFormat.resolvedOptions, Decl(lib.es5.d.ts, --, --)) + + const ym = Temporal.PlainYearMonth.from({ year: 2019, month: 6, calendar }); +>ym : Symbol(ym, Decl(temporal.ts, 1440, 9)) +>Temporal.PlainYearMonth.from : Symbol(Temporal.PlainYearMonthConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainYearMonth : Symbol(Temporal.PlainYearMonth, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainYearMonth : Symbol(Temporal.PlainYearMonth, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.PlainYearMonthConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>year : Symbol(year, Decl(temporal.ts, 1440, 45)) +>month : Symbol(month, Decl(temporal.ts, 1440, 57)) +>calendar : Symbol(calendar, Decl(temporal.ts, 1440, 67)) + + ym.toLocaleString(); // example output: '6/2019' +>ym.toLocaleString : Symbol(Temporal.PlainYearMonth.toLocaleString, Decl(lib.esnext.temporal.d.ts, --, --)) +>ym : Symbol(ym, Decl(temporal.ts, 1440, 9)) +>toLocaleString : Symbol(Temporal.PlainYearMonth.toLocaleString, Decl(lib.esnext.temporal.d.ts, --, --)) + + // Same as above, but explicitly specifying the calendar: + ym.toLocaleString(undefined, { calendar }); +>ym.toLocaleString : Symbol(Temporal.PlainYearMonth.toLocaleString, Decl(lib.esnext.temporal.d.ts, --, --)) +>ym : Symbol(ym, Decl(temporal.ts, 1440, 9)) +>toLocaleString : Symbol(Temporal.PlainYearMonth.toLocaleString, Decl(lib.esnext.temporal.d.ts, --, --)) +>undefined : Symbol(undefined) +>calendar : Symbol(calendar, Decl(temporal.ts, 1443, 34)) + + ym.toLocaleString("de-DE", { calendar }); // example output: '6.2019' +>ym.toLocaleString : Symbol(Temporal.PlainYearMonth.toLocaleString, Decl(lib.esnext.temporal.d.ts, --, --)) +>ym : Symbol(ym, Decl(temporal.ts, 1440, 9)) +>toLocaleString : Symbol(Temporal.PlainYearMonth.toLocaleString, Decl(lib.esnext.temporal.d.ts, --, --)) +>calendar : Symbol(calendar, Decl(temporal.ts, 1445, 32)) + + ym.toLocaleString("de-DE", { month: "long", year: "numeric", calendar }); // => 'Juni 2019' +>ym.toLocaleString : Symbol(Temporal.PlainYearMonth.toLocaleString, Decl(lib.esnext.temporal.d.ts, --, --)) +>ym : Symbol(ym, Decl(temporal.ts, 1440, 9)) +>toLocaleString : Symbol(Temporal.PlainYearMonth.toLocaleString, Decl(lib.esnext.temporal.d.ts, --, --)) +>month : Symbol(month, Decl(temporal.ts, 1446, 32)) +>year : Symbol(year, Decl(temporal.ts, 1446, 47)) +>calendar : Symbol(calendar, Decl(temporal.ts, 1446, 64)) + + ym.toLocaleString(`en-US-u-nu-fullwide-ca-${calendar}`); // => '6/2019' +>ym.toLocaleString : Symbol(Temporal.PlainYearMonth.toLocaleString, Decl(lib.esnext.temporal.d.ts, --, --)) +>ym : Symbol(ym, Decl(temporal.ts, 1440, 9)) +>toLocaleString : Symbol(Temporal.PlainYearMonth.toLocaleString, Decl(lib.esnext.temporal.d.ts, --, --)) +>calendar : Symbol(calendar, Decl(temporal.ts, 1439, 11)) +} + +{ + const ym = Temporal.PlainYearMonth.from("2019-06"); +>ym : Symbol(ym, Decl(temporal.ts, 1451, 9)) +>Temporal.PlainYearMonth.from : Symbol(Temporal.PlainYearMonthConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainYearMonth : Symbol(Temporal.PlainYearMonth, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainYearMonth : Symbol(Temporal.PlainYearMonth, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.PlainYearMonthConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) + + ym.toPlainDate({ day: 24 }); // => 2019-06-24 +>ym.toPlainDate : Symbol(Temporal.PlainYearMonth.toPlainDate, Decl(lib.esnext.temporal.d.ts, --, --)) +>ym : Symbol(ym, Decl(temporal.ts, 1451, 9)) +>toPlainDate : Symbol(Temporal.PlainYearMonth.toPlainDate, Decl(lib.esnext.temporal.d.ts, --, --)) +>day : Symbol(day, Decl(temporal.ts, 1452, 20)) +} + +{ + let md: Temporal.PlainMonthDay; +>md : Symbol(md, Decl(temporal.ts, 1456, 7)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainMonthDay : Symbol(Temporal.PlainMonthDay, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) + + // Pi day + md = new Temporal.PlainMonthDay(3, 14); // => 03-14 +>md : Symbol(md, Decl(temporal.ts, 1456, 7)) +>Temporal.PlainMonthDay : Symbol(Temporal.PlainMonthDay, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainMonthDay : Symbol(Temporal.PlainMonthDay, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) + + // Leap day + md = new Temporal.PlainMonthDay(2, 29); // => 02-29 +>md : Symbol(md, Decl(temporal.ts, 1456, 7)) +>Temporal.PlainMonthDay : Symbol(Temporal.PlainMonthDay, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainMonthDay : Symbol(Temporal.PlainMonthDay, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +} + +{ + let md: Temporal.PlainMonthDay; +>md : Symbol(md, Decl(temporal.ts, 1465, 7)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainMonthDay : Symbol(Temporal.PlainMonthDay, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) + + md = Temporal.PlainMonthDay.from("08-24"); // => 08-24 +>md : Symbol(md, Decl(temporal.ts, 1465, 7)) +>Temporal.PlainMonthDay.from : Symbol(Temporal.PlainMonthDayConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainMonthDay : Symbol(Temporal.PlainMonthDay, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainMonthDay : Symbol(Temporal.PlainMonthDay, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.PlainMonthDayConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) + + md = Temporal.PlainMonthDay.from("0824"); // => 08-24 +>md : Symbol(md, Decl(temporal.ts, 1465, 7)) +>Temporal.PlainMonthDay.from : Symbol(Temporal.PlainMonthDayConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainMonthDay : Symbol(Temporal.PlainMonthDay, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainMonthDay : Symbol(Temporal.PlainMonthDay, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.PlainMonthDayConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) + + md = Temporal.PlainMonthDay.from("2006-08-24"); // => 08-24 +>md : Symbol(md, Decl(temporal.ts, 1465, 7)) +>Temporal.PlainMonthDay.from : Symbol(Temporal.PlainMonthDayConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainMonthDay : Symbol(Temporal.PlainMonthDay, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainMonthDay : Symbol(Temporal.PlainMonthDay, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.PlainMonthDayConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) + + md = Temporal.PlainMonthDay.from("2006-08-24T15:43:27"); // => 08-24 +>md : Symbol(md, Decl(temporal.ts, 1465, 7)) +>Temporal.PlainMonthDay.from : Symbol(Temporal.PlainMonthDayConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainMonthDay : Symbol(Temporal.PlainMonthDay, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainMonthDay : Symbol(Temporal.PlainMonthDay, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.PlainMonthDayConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) + + md = Temporal.PlainMonthDay.from("2006-08-24T15:43:27+01:00[Europe/Brussels]"); +>md : Symbol(md, Decl(temporal.ts, 1465, 7)) +>Temporal.PlainMonthDay.from : Symbol(Temporal.PlainMonthDayConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainMonthDay : Symbol(Temporal.PlainMonthDay, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainMonthDay : Symbol(Temporal.PlainMonthDay, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.PlainMonthDayConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) + + // => 08-24 + md === Temporal.PlainMonthDay.from(md); // => false +>md : Symbol(md, Decl(temporal.ts, 1465, 7)) +>Temporal.PlainMonthDay.from : Symbol(Temporal.PlainMonthDayConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainMonthDay : Symbol(Temporal.PlainMonthDay, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainMonthDay : Symbol(Temporal.PlainMonthDay, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.PlainMonthDayConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>md : Symbol(md, Decl(temporal.ts, 1465, 7)) + + md = Temporal.PlainMonthDay.from({ monthCode: "M08", day: 24 }); // => 08-24 +>md : Symbol(md, Decl(temporal.ts, 1465, 7)) +>Temporal.PlainMonthDay.from : Symbol(Temporal.PlainMonthDayConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainMonthDay : Symbol(Temporal.PlainMonthDay, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainMonthDay : Symbol(Temporal.PlainMonthDay, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.PlainMonthDayConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>monthCode : Symbol(monthCode, Decl(temporal.ts, 1475, 38)) +>day : Symbol(day, Decl(temporal.ts, 1475, 56)) + + md = Temporal.PlainMonthDay.from(Temporal.PlainDate.from("2006-08-24")); +>md : Symbol(md, Decl(temporal.ts, 1465, 7)) +>Temporal.PlainMonthDay.from : Symbol(Temporal.PlainMonthDayConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainMonthDay : Symbol(Temporal.PlainMonthDay, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainMonthDay : Symbol(Temporal.PlainMonthDay, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.PlainMonthDayConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainDate.from : Symbol(Temporal.PlainDateConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainDate : Symbol(Temporal.PlainDate, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainDate : Symbol(Temporal.PlainDate, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.PlainDateConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) + + // => 08-24 + // (same as above; Temporal.PlainDate has month and day properties) + + // Different overflow modes + md = Temporal.PlainMonthDay.from({ month: 13, day: 1, year: 2000 }, { overflow: "constrain" }); +>md : Symbol(md, Decl(temporal.ts, 1465, 7)) +>Temporal.PlainMonthDay.from : Symbol(Temporal.PlainMonthDayConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainMonthDay : Symbol(Temporal.PlainMonthDay, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainMonthDay : Symbol(Temporal.PlainMonthDay, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.PlainMonthDayConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>month : Symbol(month, Decl(temporal.ts, 1481, 38)) +>day : Symbol(day, Decl(temporal.ts, 1481, 49)) +>year : Symbol(year, Decl(temporal.ts, 1481, 57)) +>overflow : Symbol(overflow, Decl(temporal.ts, 1481, 73)) + + // => 12-01 + md = Temporal.PlainMonthDay.from({ month: 1, day: 32, year: 2000 }, { overflow: "constrain" }); +>md : Symbol(md, Decl(temporal.ts, 1465, 7)) +>Temporal.PlainMonthDay.from : Symbol(Temporal.PlainMonthDayConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainMonthDay : Symbol(Temporal.PlainMonthDay, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainMonthDay : Symbol(Temporal.PlainMonthDay, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.PlainMonthDayConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>month : Symbol(month, Decl(temporal.ts, 1483, 38)) +>day : Symbol(day, Decl(temporal.ts, 1483, 48)) +>year : Symbol(year, Decl(temporal.ts, 1483, 57)) +>overflow : Symbol(overflow, Decl(temporal.ts, 1483, 73)) + + // => 01-31 + md = Temporal.PlainMonthDay.from({ month: 13, day: 1, year: 2000 }, { overflow: "reject" }); +>md : Symbol(md, Decl(temporal.ts, 1465, 7)) +>Temporal.PlainMonthDay.from : Symbol(Temporal.PlainMonthDayConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainMonthDay : Symbol(Temporal.PlainMonthDay, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainMonthDay : Symbol(Temporal.PlainMonthDay, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.PlainMonthDayConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>month : Symbol(month, Decl(temporal.ts, 1485, 38)) +>day : Symbol(day, Decl(temporal.ts, 1485, 49)) +>year : Symbol(year, Decl(temporal.ts, 1485, 57)) +>overflow : Symbol(overflow, Decl(temporal.ts, 1485, 73)) + + // => throws + md = Temporal.PlainMonthDay.from({ month: 1, day: 32, year: 2000 }, { overflow: "reject" }); +>md : Symbol(md, Decl(temporal.ts, 1465, 7)) +>Temporal.PlainMonthDay.from : Symbol(Temporal.PlainMonthDayConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainMonthDay : Symbol(Temporal.PlainMonthDay, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainMonthDay : Symbol(Temporal.PlainMonthDay, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.PlainMonthDayConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>month : Symbol(month, Decl(temporal.ts, 1487, 38)) +>day : Symbol(day, Decl(temporal.ts, 1487, 48)) +>year : Symbol(year, Decl(temporal.ts, 1487, 57)) +>overflow : Symbol(overflow, Decl(temporal.ts, 1487, 73)) + + // => throws + md = Temporal.PlainMonthDay.from({ month: 2, day: 29, year: 2001 }, { overflow: "reject" }); +>md : Symbol(md, Decl(temporal.ts, 1465, 7)) +>Temporal.PlainMonthDay.from : Symbol(Temporal.PlainMonthDayConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainMonthDay : Symbol(Temporal.PlainMonthDay, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainMonthDay : Symbol(Temporal.PlainMonthDay, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.PlainMonthDayConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>month : Symbol(month, Decl(temporal.ts, 1489, 38)) +>day : Symbol(day, Decl(temporal.ts, 1489, 48)) +>year : Symbol(year, Decl(temporal.ts, 1489, 57)) +>overflow : Symbol(overflow, Decl(temporal.ts, 1489, 73)) + + // => throws (this year is not a leap year in the ISO 8601 calendar) + + // non-ISO calendars + md = Temporal.PlainMonthDay.from({ monthCode: "M05L", day: 15, calendar: "hebrew" }); +>md : Symbol(md, Decl(temporal.ts, 1465, 7)) +>Temporal.PlainMonthDay.from : Symbol(Temporal.PlainMonthDayConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainMonthDay : Symbol(Temporal.PlainMonthDay, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainMonthDay : Symbol(Temporal.PlainMonthDay, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.PlainMonthDayConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>monthCode : Symbol(monthCode, Decl(temporal.ts, 1493, 38)) +>day : Symbol(day, Decl(temporal.ts, 1493, 57)) +>calendar : Symbol(calendar, Decl(temporal.ts, 1493, 66)) + + // => 1970-02-21[u-ca=hebrew] + md = Temporal.PlainMonthDay.from({ month: 6, day: 15, year: 5779, calendar: "hebrew" }); +>md : Symbol(md, Decl(temporal.ts, 1465, 7)) +>Temporal.PlainMonthDay.from : Symbol(Temporal.PlainMonthDayConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainMonthDay : Symbol(Temporal.PlainMonthDay, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainMonthDay : Symbol(Temporal.PlainMonthDay, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.PlainMonthDayConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>month : Symbol(month, Decl(temporal.ts, 1495, 38)) +>day : Symbol(day, Decl(temporal.ts, 1495, 48)) +>year : Symbol(year, Decl(temporal.ts, 1495, 57)) +>calendar : Symbol(calendar, Decl(temporal.ts, 1495, 69)) + + // => 1970-02-21[u-ca=hebrew] + /* WRONG */ md = Temporal.PlainMonthDay.from({ month: 6, day: 15, calendar: "hebrew" }); +>md : Symbol(md, Decl(temporal.ts, 1465, 7)) +>Temporal.PlainMonthDay.from : Symbol(Temporal.PlainMonthDayConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainMonthDay : Symbol(Temporal.PlainMonthDay, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainMonthDay : Symbol(Temporal.PlainMonthDay, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.PlainMonthDayConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>month : Symbol(month, Decl(temporal.ts, 1497, 50)) +>day : Symbol(day, Decl(temporal.ts, 1497, 60)) +>calendar : Symbol(calendar, Decl(temporal.ts, 1497, 69)) + + // => throws (either year or monthCode is required) + md = Temporal.PlainMonthDay.from("2019-02-20[u-ca=hebrew]"); +>md : Symbol(md, Decl(temporal.ts, 1465, 7)) +>Temporal.PlainMonthDay.from : Symbol(Temporal.PlainMonthDayConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainMonthDay : Symbol(Temporal.PlainMonthDay, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainMonthDay : Symbol(Temporal.PlainMonthDay, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.PlainMonthDayConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) + + md.monthCode; // => 'M05L' +>md.monthCode : Symbol(Temporal.PlainMonthDay.monthCode, Decl(lib.esnext.temporal.d.ts, --, --)) +>md : Symbol(md, Decl(temporal.ts, 1465, 7)) +>monthCode : Symbol(Temporal.PlainMonthDay.monthCode, Decl(lib.esnext.temporal.d.ts, --, --)) + + md.day; // => 15 +>md.day : Symbol(Temporal.PlainMonthDay.day, Decl(lib.esnext.temporal.d.ts, --, --)) +>md : Symbol(md, Decl(temporal.ts, 1465, 7)) +>day : Symbol(Temporal.PlainMonthDay.day, Decl(lib.esnext.temporal.d.ts, --, --)) + + md.month; // undefined +>md : Symbol(md, Decl(temporal.ts, 1465, 7)) + + // (month property is not present in this type; use monthCode instead) +} + +{ + let md: Temporal.PlainMonthDay; +>md : Symbol(md, Decl(temporal.ts, 1507, 7)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainMonthDay : Symbol(Temporal.PlainMonthDay, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) + + md = Temporal.PlainMonthDay.from("08-24"); +>md : Symbol(md, Decl(temporal.ts, 1507, 7)) +>Temporal.PlainMonthDay.from : Symbol(Temporal.PlainMonthDayConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainMonthDay : Symbol(Temporal.PlainMonthDay, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainMonthDay : Symbol(Temporal.PlainMonthDay, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.PlainMonthDayConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) + + md.monthCode; // => 'M08' +>md.monthCode : Symbol(Temporal.PlainMonthDay.monthCode, Decl(lib.esnext.temporal.d.ts, --, --)) +>md : Symbol(md, Decl(temporal.ts, 1507, 7)) +>monthCode : Symbol(Temporal.PlainMonthDay.monthCode, Decl(lib.esnext.temporal.d.ts, --, --)) + + md.day; // => 24 +>md.day : Symbol(Temporal.PlainMonthDay.day, Decl(lib.esnext.temporal.d.ts, --, --)) +>md : Symbol(md, Decl(temporal.ts, 1507, 7)) +>day : Symbol(Temporal.PlainMonthDay.day, Decl(lib.esnext.temporal.d.ts, --, --)) + + md.month; // => undefined +>md : Symbol(md, Decl(temporal.ts, 1507, 7)) + + // (no `month` property; use `monthCode` instead) + + md = Temporal.PlainMonthDay.from("2019-02-20[u-ca=hebrew]"); +>md : Symbol(md, Decl(temporal.ts, 1507, 7)) +>Temporal.PlainMonthDay.from : Symbol(Temporal.PlainMonthDayConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainMonthDay : Symbol(Temporal.PlainMonthDay, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainMonthDay : Symbol(Temporal.PlainMonthDay, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.PlainMonthDayConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) + + md.monthCode; // => 'M05L' +>md.monthCode : Symbol(Temporal.PlainMonthDay.monthCode, Decl(lib.esnext.temporal.d.ts, --, --)) +>md : Symbol(md, Decl(temporal.ts, 1507, 7)) +>monthCode : Symbol(Temporal.PlainMonthDay.monthCode, Decl(lib.esnext.temporal.d.ts, --, --)) + + md.day; // => 15 +>md.day : Symbol(Temporal.PlainMonthDay.day, Decl(lib.esnext.temporal.d.ts, --, --)) +>md : Symbol(md, Decl(temporal.ts, 1507, 7)) +>day : Symbol(Temporal.PlainMonthDay.day, Decl(lib.esnext.temporal.d.ts, --, --)) + + md.month; // => undefined +>md : Symbol(md, Decl(temporal.ts, 1507, 7)) + + // (no `month` property; use `monthCode` instead) +} + +{ + const md = Temporal.PlainMonthDay.from("11-15"); +>md : Symbol(md, Decl(temporal.ts, 1523, 9)) +>Temporal.PlainMonthDay.from : Symbol(Temporal.PlainMonthDayConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainMonthDay : Symbol(Temporal.PlainMonthDay, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainMonthDay : Symbol(Temporal.PlainMonthDay, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.PlainMonthDayConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) + + // What's the last day of that month? + md.with({ day: 31 }); // => 11-30 +>md.with : Symbol(Temporal.PlainMonthDay.with, Decl(lib.esnext.temporal.d.ts, --, --)) +>md : Symbol(md, Decl(temporal.ts, 1523, 9)) +>with : Symbol(Temporal.PlainMonthDay.with, Decl(lib.esnext.temporal.d.ts, --, --)) +>day : Symbol(day, Decl(temporal.ts, 1525, 13)) + + Temporal.PlainMonthDay.from("02-01").with({ day: 31 }); // => 02-29 +>Temporal.PlainMonthDay.from("02-01").with : Symbol(Temporal.PlainMonthDay.with, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainMonthDay.from : Symbol(Temporal.PlainMonthDayConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainMonthDay : Symbol(Temporal.PlainMonthDay, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainMonthDay : Symbol(Temporal.PlainMonthDay, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.PlainMonthDayConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>with : Symbol(Temporal.PlainMonthDay.with, Decl(lib.esnext.temporal.d.ts, --, --)) +>day : Symbol(day, Decl(temporal.ts, 1526, 47)) +} + +{ + const md1 = Temporal.PlainMonthDay.from("02-28"); +>md1 : Symbol(md1, Decl(temporal.ts, 1530, 9)) +>Temporal.PlainMonthDay.from : Symbol(Temporal.PlainMonthDayConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainMonthDay : Symbol(Temporal.PlainMonthDay, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainMonthDay : Symbol(Temporal.PlainMonthDay, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.PlainMonthDayConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) + + const md2 = Temporal.PlainMonthDay.from("02-29"); +>md2 : Symbol(md2, Decl(temporal.ts, 1531, 9)) +>Temporal.PlainMonthDay.from : Symbol(Temporal.PlainMonthDayConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainMonthDay : Symbol(Temporal.PlainMonthDay, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainMonthDay : Symbol(Temporal.PlainMonthDay, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.PlainMonthDayConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) + + md1.equals(md2); // => false +>md1.equals : Symbol(Temporal.PlainMonthDay.equals, Decl(lib.esnext.temporal.d.ts, --, --)) +>md1 : Symbol(md1, Decl(temporal.ts, 1530, 9)) +>equals : Symbol(Temporal.PlainMonthDay.equals, Decl(lib.esnext.temporal.d.ts, --, --)) +>md2 : Symbol(md2, Decl(temporal.ts, 1531, 9)) + + md1.equals("02-29"); // => false +>md1.equals : Symbol(Temporal.PlainMonthDay.equals, Decl(lib.esnext.temporal.d.ts, --, --)) +>md1 : Symbol(md1, Decl(temporal.ts, 1530, 9)) +>equals : Symbol(Temporal.PlainMonthDay.equals, Decl(lib.esnext.temporal.d.ts, --, --)) + + md1.equals({ monthCode: "M02", day: 29 }); // => false +>md1.equals : Symbol(Temporal.PlainMonthDay.equals, Decl(lib.esnext.temporal.d.ts, --, --)) +>md1 : Symbol(md1, Decl(temporal.ts, 1530, 9)) +>equals : Symbol(Temporal.PlainMonthDay.equals, Decl(lib.esnext.temporal.d.ts, --, --)) +>monthCode : Symbol(monthCode, Decl(temporal.ts, 1534, 16)) +>day : Symbol(day, Decl(temporal.ts, 1534, 34)) + + md2.equals(md2); // => true +>md2.equals : Symbol(Temporal.PlainMonthDay.equals, Decl(lib.esnext.temporal.d.ts, --, --)) +>md2 : Symbol(md2, Decl(temporal.ts, 1531, 9)) +>equals : Symbol(Temporal.PlainMonthDay.equals, Decl(lib.esnext.temporal.d.ts, --, --)) +>md2 : Symbol(md2, Decl(temporal.ts, 1531, 9)) + + md2.equals("02-29"); // => true +>md2.equals : Symbol(Temporal.PlainMonthDay.equals, Decl(lib.esnext.temporal.d.ts, --, --)) +>md2 : Symbol(md2, Decl(temporal.ts, 1531, 9)) +>equals : Symbol(Temporal.PlainMonthDay.equals, Decl(lib.esnext.temporal.d.ts, --, --)) + + md2.equals({ monthCode: "M02", day: 29 }); // => true +>md2.equals : Symbol(Temporal.PlainMonthDay.equals, Decl(lib.esnext.temporal.d.ts, --, --)) +>md2 : Symbol(md2, Decl(temporal.ts, 1531, 9)) +>equals : Symbol(Temporal.PlainMonthDay.equals, Decl(lib.esnext.temporal.d.ts, --, --)) +>monthCode : Symbol(monthCode, Decl(temporal.ts, 1537, 16)) +>day : Symbol(day, Decl(temporal.ts, 1537, 34)) +} + +{ + const md = Temporal.PlainMonthDay.from("08-24"); +>md : Symbol(md, Decl(temporal.ts, 1541, 9)) +>Temporal.PlainMonthDay.from : Symbol(Temporal.PlainMonthDayConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainMonthDay : Symbol(Temporal.PlainMonthDay, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainMonthDay : Symbol(Temporal.PlainMonthDay, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.PlainMonthDayConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) + + md.toString(); // => '08-24' +>md.toString : Symbol(Temporal.PlainMonthDay.toString, Decl(lib.esnext.temporal.d.ts, --, --)) +>md : Symbol(md, Decl(temporal.ts, 1541, 9)) +>toString : Symbol(Temporal.PlainMonthDay.toString, Decl(lib.esnext.temporal.d.ts, --, --)) +} + +{ + const { calendar } = new Intl.DateTimeFormat().resolvedOptions(); +>calendar : Symbol(calendar, Decl(temporal.ts, 1546, 11)) +>new Intl.DateTimeFormat().resolvedOptions : Symbol(Intl.DateTimeFormat.resolvedOptions, Decl(lib.es5.d.ts, --, --)) +>Intl.DateTimeFormat : Symbol(Intl.DateTimeFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2021.intl.d.ts, --, --), Decl(lib.esnext.intl.d.ts, --, --)) +>Intl : Symbol(Intl, Decl(lib.es5.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2020.intl.d.ts, --, --), Decl(lib.es2021.intl.d.ts, --, --), Decl(lib.es2025.intl.d.ts, --, --) ... and 1 more) +>DateTimeFormat : Symbol(Intl.DateTimeFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2021.intl.d.ts, --, --), Decl(lib.esnext.intl.d.ts, --, --)) +>resolvedOptions : Symbol(Intl.DateTimeFormat.resolvedOptions, Decl(lib.es5.d.ts, --, --)) + + const md = Temporal.PlainMonthDay.from({ monthCode: "M08", day: 24, calendar }); +>md : Symbol(md, Decl(temporal.ts, 1547, 9)) +>Temporal.PlainMonthDay.from : Symbol(Temporal.PlainMonthDayConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainMonthDay : Symbol(Temporal.PlainMonthDay, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainMonthDay : Symbol(Temporal.PlainMonthDay, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.PlainMonthDayConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>monthCode : Symbol(monthCode, Decl(temporal.ts, 1547, 44)) +>day : Symbol(day, Decl(temporal.ts, 1547, 62)) +>calendar : Symbol(calendar, Decl(temporal.ts, 1547, 71)) + + md.toLocaleString(); // example output: '8/24' +>md.toLocaleString : Symbol(Temporal.PlainMonthDay.toLocaleString, Decl(lib.esnext.temporal.d.ts, --, --)) +>md : Symbol(md, Decl(temporal.ts, 1547, 9)) +>toLocaleString : Symbol(Temporal.PlainMonthDay.toLocaleString, Decl(lib.esnext.temporal.d.ts, --, --)) + + // Same as above, but explicitly specifying the calendar: + md.toLocaleString(undefined, { calendar }); // example output: '8/24' +>md.toLocaleString : Symbol(Temporal.PlainMonthDay.toLocaleString, Decl(lib.esnext.temporal.d.ts, --, --)) +>md : Symbol(md, Decl(temporal.ts, 1547, 9)) +>toLocaleString : Symbol(Temporal.PlainMonthDay.toLocaleString, Decl(lib.esnext.temporal.d.ts, --, --)) +>undefined : Symbol(undefined) +>calendar : Symbol(calendar, Decl(temporal.ts, 1550, 34)) + + md.toLocaleString("de-DE", { calendar }); // => '24.8.' +>md.toLocaleString : Symbol(Temporal.PlainMonthDay.toLocaleString, Decl(lib.esnext.temporal.d.ts, --, --)) +>md : Symbol(md, Decl(temporal.ts, 1547, 9)) +>toLocaleString : Symbol(Temporal.PlainMonthDay.toLocaleString, Decl(lib.esnext.temporal.d.ts, --, --)) +>calendar : Symbol(calendar, Decl(temporal.ts, 1552, 32)) + + md.toLocaleString("de-DE", { month: "long", day: "numeric", calendar }); // => '24. August' +>md.toLocaleString : Symbol(Temporal.PlainMonthDay.toLocaleString, Decl(lib.esnext.temporal.d.ts, --, --)) +>md : Symbol(md, Decl(temporal.ts, 1547, 9)) +>toLocaleString : Symbol(Temporal.PlainMonthDay.toLocaleString, Decl(lib.esnext.temporal.d.ts, --, --)) +>month : Symbol(month, Decl(temporal.ts, 1553, 32)) +>day : Symbol(day, Decl(temporal.ts, 1553, 47)) +>calendar : Symbol(calendar, Decl(temporal.ts, 1553, 63)) + + md.toLocaleString(`en-US-u-nu-fullwide-ca-${calendar}`); // => '8/24' +>md.toLocaleString : Symbol(Temporal.PlainMonthDay.toLocaleString, Decl(lib.esnext.temporal.d.ts, --, --)) +>md : Symbol(md, Decl(temporal.ts, 1547, 9)) +>toLocaleString : Symbol(Temporal.PlainMonthDay.toLocaleString, Decl(lib.esnext.temporal.d.ts, --, --)) +>calendar : Symbol(calendar, Decl(temporal.ts, 1546, 11)) +} + +{ + const md = Temporal.PlainMonthDay.from({ +>md : Symbol(md, Decl(temporal.ts, 1558, 9)) +>Temporal.PlainMonthDay.from : Symbol(Temporal.PlainMonthDayConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainMonthDay : Symbol(Temporal.PlainMonthDay, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainMonthDay : Symbol(Temporal.PlainMonthDay, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.PlainMonthDayConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) + + calendar: "japanese", +>calendar : Symbol(calendar, Decl(temporal.ts, 1558, 44)) + + monthCode: "M01", +>monthCode : Symbol(monthCode, Decl(temporal.ts, 1559, 29)) + + day: 1, +>day : Symbol(day, Decl(temporal.ts, 1560, 25)) + + }); + + const date = md.toPlainDate({ era: "reiwa", eraYear: 2 }); // => 2020-01-01[u-ca=japanese] +>date : Symbol(date, Decl(temporal.ts, 1564, 9)) +>md.toPlainDate : Symbol(Temporal.PlainMonthDay.toPlainDate, Decl(lib.esnext.temporal.d.ts, --, --)) +>md : Symbol(md, Decl(temporal.ts, 1558, 9)) +>toPlainDate : Symbol(Temporal.PlainMonthDay.toPlainDate, Decl(lib.esnext.temporal.d.ts, --, --)) +>era : Symbol(era, Decl(temporal.ts, 1564, 33)) +>eraYear : Symbol(eraYear, Decl(temporal.ts, 1564, 47)) +} + +{ + new Temporal.Duration(1, 2, 3, 4, 5, 6, 7, 987, 654, 321); // => P1Y2M3W4DT5H6M7.987654321S +>Temporal.Duration : Symbol(Temporal.Duration, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>Duration : Symbol(Temporal.Duration, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) + + new Temporal.Duration(0, 0, 0, 40); // => P40D +>Temporal.Duration : Symbol(Temporal.Duration, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>Duration : Symbol(Temporal.Duration, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) + + new Temporal.Duration(undefined, undefined, undefined, 40); // => P40D +>Temporal.Duration : Symbol(Temporal.Duration, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>Duration : Symbol(Temporal.Duration, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>undefined : Symbol(undefined) +>undefined : Symbol(undefined) +>undefined : Symbol(undefined) + + new Temporal.Duration(); // => PT0S +>Temporal.Duration : Symbol(Temporal.Duration, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>Duration : Symbol(Temporal.Duration, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +} + +{ + let d: Temporal.Duration; +>d : Symbol(d, Decl(temporal.ts, 1575, 7)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>Duration : Symbol(Temporal.Duration, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) + + d = Temporal.Duration.from({ years: 1, days: 1 }); // => P1Y1D +>d : Symbol(d, Decl(temporal.ts, 1575, 7)) +>Temporal.Duration.from : Symbol(Temporal.DurationConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.Duration : Symbol(Temporal.Duration, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>Duration : Symbol(Temporal.Duration, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.DurationConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>years : Symbol(years, Decl(temporal.ts, 1577, 32)) +>days : Symbol(days, Decl(temporal.ts, 1577, 42)) + + d = Temporal.Duration.from({ days: -2, hours: -12 }); // => -P2DT12H +>d : Symbol(d, Decl(temporal.ts, 1575, 7)) +>Temporal.Duration.from : Symbol(Temporal.DurationConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.Duration : Symbol(Temporal.Duration, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>Duration : Symbol(Temporal.Duration, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.DurationConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>days : Symbol(days, Decl(temporal.ts, 1578, 32)) +>hours : Symbol(hours, Decl(temporal.ts, 1578, 42)) + + Temporal.Duration.from(d) === d; // => false +>Temporal.Duration.from : Symbol(Temporal.DurationConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.Duration : Symbol(Temporal.Duration, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>Duration : Symbol(Temporal.Duration, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.DurationConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>d : Symbol(d, Decl(temporal.ts, 1575, 7)) +>d : Symbol(d, Decl(temporal.ts, 1575, 7)) + + d = Temporal.Duration.from("P1Y1D"); // => P1Y1D +>d : Symbol(d, Decl(temporal.ts, 1575, 7)) +>Temporal.Duration.from : Symbol(Temporal.DurationConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.Duration : Symbol(Temporal.Duration, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>Duration : Symbol(Temporal.Duration, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.DurationConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) + + d = Temporal.Duration.from("-P2DT12H"); // => -P2DT12H +>d : Symbol(d, Decl(temporal.ts, 1575, 7)) +>Temporal.Duration.from : Symbol(Temporal.DurationConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.Duration : Symbol(Temporal.Duration, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>Duration : Symbol(Temporal.Duration, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.DurationConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) + + d = Temporal.Duration.from("P0D"); // => PT0S +>d : Symbol(d, Decl(temporal.ts, 1575, 7)) +>Temporal.Duration.from : Symbol(Temporal.DurationConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.Duration : Symbol(Temporal.Duration, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>Duration : Symbol(Temporal.Duration, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.DurationConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +} + +{ + const one = Temporal.Duration.from({ hours: 79, minutes: 10 }); +>one : Symbol(one, Decl(temporal.ts, 1588, 9)) +>Temporal.Duration.from : Symbol(Temporal.DurationConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.Duration : Symbol(Temporal.Duration, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>Duration : Symbol(Temporal.Duration, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.DurationConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>hours : Symbol(hours, Decl(temporal.ts, 1588, 40)) +>minutes : Symbol(minutes, Decl(temporal.ts, 1588, 51)) + + const two = Temporal.Duration.from({ days: 3, hours: 7, seconds: 630 }); +>two : Symbol(two, Decl(temporal.ts, 1589, 9)) +>Temporal.Duration.from : Symbol(Temporal.DurationConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.Duration : Symbol(Temporal.Duration, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>Duration : Symbol(Temporal.Duration, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.DurationConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>days : Symbol(days, Decl(temporal.ts, 1589, 40)) +>hours : Symbol(hours, Decl(temporal.ts, 1589, 49)) +>seconds : Symbol(seconds, Decl(temporal.ts, 1589, 59)) + + const three = Temporal.Duration.from({ days: 3, hours: 6, minutes: 50 }); +>three : Symbol(three, Decl(temporal.ts, 1590, 9)) +>Temporal.Duration.from : Symbol(Temporal.DurationConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.Duration : Symbol(Temporal.Duration, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>Duration : Symbol(Temporal.Duration, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.DurationConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>days : Symbol(days, Decl(temporal.ts, 1590, 42)) +>hours : Symbol(hours, Decl(temporal.ts, 1590, 51)) +>minutes : Symbol(minutes, Decl(temporal.ts, 1590, 61)) + + const sorted1 = [one, two, three].sort(Temporal.Duration.compare); +>sorted1 : Symbol(sorted1, Decl(temporal.ts, 1591, 9)) +>[one, two, three].sort : Symbol(Array.sort, Decl(lib.es5.d.ts, --, --)) +>one : Symbol(one, Decl(temporal.ts, 1588, 9)) +>two : Symbol(two, Decl(temporal.ts, 1589, 9)) +>three : Symbol(three, Decl(temporal.ts, 1590, 9)) +>sort : Symbol(Array.sort, Decl(lib.es5.d.ts, --, --)) +>Temporal.Duration.compare : Symbol(Temporal.DurationConstructor.compare, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.Duration : Symbol(Temporal.Duration, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>Duration : Symbol(Temporal.Duration, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>compare : Symbol(Temporal.DurationConstructor.compare, Decl(lib.esnext.temporal.d.ts, --, --)) + + sorted1.join(" "); +>sorted1.join : Symbol(Array.join, Decl(lib.es5.d.ts, --, --)) +>sorted1 : Symbol(sorted1, Decl(temporal.ts, 1591, 9)) +>join : Symbol(Array.join, Decl(lib.es5.d.ts, --, --)) + + // => 'P3DT6H50M PT79H10M P3DT7H630S' + + // Sorting relative to a date, taking DST changes into account: + const relativeTo = Temporal.ZonedDateTime.from("2020-11-01T00:00-07:00[America/Los_Angeles]"); +>relativeTo : Symbol(relativeTo, Decl(temporal.ts, 1596, 9)) +>Temporal.ZonedDateTime.from : Symbol(Temporal.ZonedDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.ZonedDateTime : Symbol(Temporal.ZonedDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>ZonedDateTime : Symbol(Temporal.ZonedDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.ZonedDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) + + const sorted2 = [one, two, three].sort((one, two) => Temporal.Duration.compare(one, two, { relativeTo })); +>sorted2 : Symbol(sorted2, Decl(temporal.ts, 1597, 9)) +>[one, two, three].sort : Symbol(Array.sort, Decl(lib.es5.d.ts, --, --)) +>one : Symbol(one, Decl(temporal.ts, 1588, 9)) +>two : Symbol(two, Decl(temporal.ts, 1589, 9)) +>three : Symbol(three, Decl(temporal.ts, 1590, 9)) +>sort : Symbol(Array.sort, Decl(lib.es5.d.ts, --, --)) +>one : Symbol(one, Decl(temporal.ts, 1597, 44)) +>two : Symbol(two, Decl(temporal.ts, 1597, 48)) +>Temporal.Duration.compare : Symbol(Temporal.DurationConstructor.compare, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.Duration : Symbol(Temporal.Duration, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>Duration : Symbol(Temporal.Duration, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>compare : Symbol(Temporal.DurationConstructor.compare, Decl(lib.esnext.temporal.d.ts, --, --)) +>one : Symbol(one, Decl(temporal.ts, 1597, 44)) +>two : Symbol(two, Decl(temporal.ts, 1597, 48)) +>relativeTo : Symbol(relativeTo, Decl(temporal.ts, 1597, 94)) + + sorted2.join(" "); +>sorted2.join : Symbol(Array.join, Decl(lib.es5.d.ts, --, --)) +>sorted2 : Symbol(sorted2, Decl(temporal.ts, 1597, 9)) +>join : Symbol(Array.join, Decl(lib.es5.d.ts, --, --)) + + // => 'PT79H10M P3DT6H50M P3DT7H630S' +} + +{ + const d = Temporal.Duration.from("P1Y2M3W4DT5H6M7.987654321S"); +>d : Symbol(d, Decl(temporal.ts, 1603, 9)) +>Temporal.Duration.from : Symbol(Temporal.DurationConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.Duration : Symbol(Temporal.Duration, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>Duration : Symbol(Temporal.Duration, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.DurationConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) + + d.years; // => 1 +>d.years : Symbol(Temporal.Duration.years, Decl(lib.esnext.temporal.d.ts, --, --)) +>d : Symbol(d, Decl(temporal.ts, 1603, 9)) +>years : Symbol(Temporal.Duration.years, Decl(lib.esnext.temporal.d.ts, --, --)) + + d.months; // => 2 +>d.months : Symbol(Temporal.Duration.months, Decl(lib.esnext.temporal.d.ts, --, --)) +>d : Symbol(d, Decl(temporal.ts, 1603, 9)) +>months : Symbol(Temporal.Duration.months, Decl(lib.esnext.temporal.d.ts, --, --)) + + d.weeks; // => 3 +>d.weeks : Symbol(Temporal.Duration.weeks, Decl(lib.esnext.temporal.d.ts, --, --)) +>d : Symbol(d, Decl(temporal.ts, 1603, 9)) +>weeks : Symbol(Temporal.Duration.weeks, Decl(lib.esnext.temporal.d.ts, --, --)) + + d.days; // => 4 +>d.days : Symbol(Temporal.Duration.days, Decl(lib.esnext.temporal.d.ts, --, --)) +>d : Symbol(d, Decl(temporal.ts, 1603, 9)) +>days : Symbol(Temporal.Duration.days, Decl(lib.esnext.temporal.d.ts, --, --)) + + d.hours; // => 5 +>d.hours : Symbol(Temporal.Duration.hours, Decl(lib.esnext.temporal.d.ts, --, --)) +>d : Symbol(d, Decl(temporal.ts, 1603, 9)) +>hours : Symbol(Temporal.Duration.hours, Decl(lib.esnext.temporal.d.ts, --, --)) + + d.minutes; // => 6 +>d.minutes : Symbol(Temporal.Duration.minutes, Decl(lib.esnext.temporal.d.ts, --, --)) +>d : Symbol(d, Decl(temporal.ts, 1603, 9)) +>minutes : Symbol(Temporal.Duration.minutes, Decl(lib.esnext.temporal.d.ts, --, --)) + + d.seconds; // => 7 +>d.seconds : Symbol(Temporal.Duration.seconds, Decl(lib.esnext.temporal.d.ts, --, --)) +>d : Symbol(d, Decl(temporal.ts, 1603, 9)) +>seconds : Symbol(Temporal.Duration.seconds, Decl(lib.esnext.temporal.d.ts, --, --)) + + d.milliseconds; // => 987 +>d.milliseconds : Symbol(Temporal.Duration.milliseconds, Decl(lib.esnext.temporal.d.ts, --, --)) +>d : Symbol(d, Decl(temporal.ts, 1603, 9)) +>milliseconds : Symbol(Temporal.Duration.milliseconds, Decl(lib.esnext.temporal.d.ts, --, --)) + + d.microseconds; // => 654 +>d.microseconds : Symbol(Temporal.Duration.microseconds, Decl(lib.esnext.temporal.d.ts, --, --)) +>d : Symbol(d, Decl(temporal.ts, 1603, 9)) +>microseconds : Symbol(Temporal.Duration.microseconds, Decl(lib.esnext.temporal.d.ts, --, --)) + + d.nanoseconds; // => 321 +>d.nanoseconds : Symbol(Temporal.Duration.nanoseconds, Decl(lib.esnext.temporal.d.ts, --, --)) +>d : Symbol(d, Decl(temporal.ts, 1603, 9)) +>nanoseconds : Symbol(Temporal.Duration.nanoseconds, Decl(lib.esnext.temporal.d.ts, --, --)) +} + +{ + let d: Temporal.Duration; +>d : Symbol(d, Decl(temporal.ts, 1617, 7)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>Duration : Symbol(Temporal.Duration, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) + + d = Temporal.Duration.from("PT0S"); +>d : Symbol(d, Decl(temporal.ts, 1617, 7)) +>Temporal.Duration.from : Symbol(Temporal.DurationConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.Duration : Symbol(Temporal.Duration, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>Duration : Symbol(Temporal.Duration, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.DurationConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) + + d.blank; // => true +>d.blank : Symbol(Temporal.Duration.blank, Decl(lib.esnext.temporal.d.ts, --, --)) +>d : Symbol(d, Decl(temporal.ts, 1617, 7)) +>blank : Symbol(Temporal.Duration.blank, Decl(lib.esnext.temporal.d.ts, --, --)) + + d = Temporal.Duration.from({ days: 0, hours: 0, minutes: 0 }); +>d : Symbol(d, Decl(temporal.ts, 1617, 7)) +>Temporal.Duration.from : Symbol(Temporal.DurationConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.Duration : Symbol(Temporal.Duration, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>Duration : Symbol(Temporal.Duration, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.DurationConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>days : Symbol(days, Decl(temporal.ts, 1622, 32)) +>hours : Symbol(hours, Decl(temporal.ts, 1622, 41)) +>minutes : Symbol(minutes, Decl(temporal.ts, 1622, 51)) + + d.blank; // => true +>d.blank : Symbol(Temporal.Duration.blank, Decl(lib.esnext.temporal.d.ts, --, --)) +>d : Symbol(d, Decl(temporal.ts, 1617, 7)) +>blank : Symbol(Temporal.Duration.blank, Decl(lib.esnext.temporal.d.ts, --, --)) +} + +{ + let duration: Temporal.Duration; +>duration : Symbol(duration, Decl(temporal.ts, 1627, 7)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>Duration : Symbol(Temporal.Duration, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) + + duration = Temporal.Duration.from({ months: 50, days: 50, hours: 50, minutes: 100 }); +>duration : Symbol(duration, Decl(temporal.ts, 1627, 7)) +>Temporal.Duration.from : Symbol(Temporal.DurationConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.Duration : Symbol(Temporal.Duration, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>Duration : Symbol(Temporal.Duration, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.DurationConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>months : Symbol(months, Decl(temporal.ts, 1629, 39)) +>days : Symbol(days, Decl(temporal.ts, 1629, 51)) +>hours : Symbol(hours, Decl(temporal.ts, 1629, 61)) +>minutes : Symbol(minutes, Decl(temporal.ts, 1629, 72)) + + // Perform a balance operation using additional ISO 8601 calendar rules: + let { years, months } = duration; +>years : Symbol(years, Decl(temporal.ts, 1631, 9)) +>months : Symbol(months, Decl(temporal.ts, 1631, 16)) +>duration : Symbol(duration, Decl(temporal.ts, 1627, 7)) + + years += Math.floor(months / 12); +>years : Symbol(years, Decl(temporal.ts, 1631, 9)) +>Math.floor : Symbol(Math.floor, Decl(lib.es5.d.ts, --, --)) +>Math : Symbol(Math, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) +>floor : Symbol(Math.floor, Decl(lib.es5.d.ts, --, --)) +>months : Symbol(months, Decl(temporal.ts, 1631, 16)) + + months %= 12; +>months : Symbol(months, Decl(temporal.ts, 1631, 16)) + + duration = duration.with({ years, months }); +>duration : Symbol(duration, Decl(temporal.ts, 1627, 7)) +>duration.with : Symbol(Temporal.Duration.with, Decl(lib.esnext.temporal.d.ts, --, --)) +>duration : Symbol(duration, Decl(temporal.ts, 1627, 7)) +>with : Symbol(Temporal.Duration.with, Decl(lib.esnext.temporal.d.ts, --, --)) +>years : Symbol(years, Decl(temporal.ts, 1634, 30)) +>months : Symbol(months, Decl(temporal.ts, 1634, 37)) + + // => P4Y2M50DT50H100M +} + +{ + const hour = Temporal.Duration.from("PT1H"); +>hour : Symbol(hour, Decl(temporal.ts, 1639, 9)) +>Temporal.Duration.from : Symbol(Temporal.DurationConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.Duration : Symbol(Temporal.Duration, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>Duration : Symbol(Temporal.Duration, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.DurationConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) + + hour.add({ minutes: 30 }); // => PT1H30M +>hour.add : Symbol(Temporal.Duration.add, Decl(lib.esnext.temporal.d.ts, --, --)) +>hour : Symbol(hour, Decl(temporal.ts, 1639, 9)) +>add : Symbol(Temporal.Duration.add, Decl(lib.esnext.temporal.d.ts, --, --)) +>minutes : Symbol(minutes, Decl(temporal.ts, 1640, 14)) + + // Examples of balancing: + const one = Temporal.Duration.from({ hours: 1, minutes: 30 }); +>one : Symbol(one, Decl(temporal.ts, 1643, 9)) +>Temporal.Duration.from : Symbol(Temporal.DurationConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.Duration : Symbol(Temporal.Duration, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>Duration : Symbol(Temporal.Duration, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.DurationConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>hours : Symbol(hours, Decl(temporal.ts, 1643, 40)) +>minutes : Symbol(minutes, Decl(temporal.ts, 1643, 50)) + + const two = Temporal.Duration.from({ hours: 2, minutes: 45 }); +>two : Symbol(two, Decl(temporal.ts, 1644, 9)) +>Temporal.Duration.from : Symbol(Temporal.DurationConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.Duration : Symbol(Temporal.Duration, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>Duration : Symbol(Temporal.Duration, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.DurationConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>hours : Symbol(hours, Decl(temporal.ts, 1644, 40)) +>minutes : Symbol(minutes, Decl(temporal.ts, 1644, 50)) + + const result = one.add(two); // => PT4H15M +>result : Symbol(result, Decl(temporal.ts, 1645, 9)) +>one.add : Symbol(Temporal.Duration.add, Decl(lib.esnext.temporal.d.ts, --, --)) +>one : Symbol(one, Decl(temporal.ts, 1643, 9)) +>add : Symbol(Temporal.Duration.add, Decl(lib.esnext.temporal.d.ts, --, --)) +>two : Symbol(two, Decl(temporal.ts, 1644, 9)) + + // Example of adding calendar units + const oneAndAHalfMonth = Temporal.Duration.from({ months: 1, days: 16 }); +>oneAndAHalfMonth : Symbol(oneAndAHalfMonth, Decl(temporal.ts, 1648, 9)) +>Temporal.Duration.from : Symbol(Temporal.DurationConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.Duration : Symbol(Temporal.Duration, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>Duration : Symbol(Temporal.Duration, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.DurationConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>months : Symbol(months, Decl(temporal.ts, 1648, 53)) +>days : Symbol(days, Decl(temporal.ts, 1648, 64)) + + // To convert units, use arithmetic relative to a start date: + const startDate1 = Temporal.PlainDate.from("2000-12-01"); +>startDate1 : Symbol(startDate1, Decl(temporal.ts, 1651, 9)) +>Temporal.PlainDate.from : Symbol(Temporal.PlainDateConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainDate : Symbol(Temporal.PlainDate, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainDate : Symbol(Temporal.PlainDate, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.PlainDateConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) + + startDate1.add(oneAndAHalfMonth).add(oneAndAHalfMonth) +>startDate1.add(oneAndAHalfMonth).add(oneAndAHalfMonth) .since : Symbol(Temporal.PlainDate.since, Decl(lib.esnext.temporal.d.ts, --, --)) +>startDate1.add(oneAndAHalfMonth).add : Symbol(Temporal.PlainDate.add, Decl(lib.esnext.temporal.d.ts, --, --)) +>startDate1.add : Symbol(Temporal.PlainDate.add, Decl(lib.esnext.temporal.d.ts, --, --)) +>startDate1 : Symbol(startDate1, Decl(temporal.ts, 1651, 9)) +>add : Symbol(Temporal.PlainDate.add, Decl(lib.esnext.temporal.d.ts, --, --)) +>oneAndAHalfMonth : Symbol(oneAndAHalfMonth, Decl(temporal.ts, 1648, 9)) +>add : Symbol(Temporal.PlainDate.add, Decl(lib.esnext.temporal.d.ts, --, --)) +>oneAndAHalfMonth : Symbol(oneAndAHalfMonth, Decl(temporal.ts, 1648, 9)) + + .since(startDate1, { largestUnit: "months" }); // => P3M4D +>since : Symbol(Temporal.PlainDate.since, Decl(lib.esnext.temporal.d.ts, --, --)) +>startDate1 : Symbol(startDate1, Decl(temporal.ts, 1651, 9)) +>largestUnit : Symbol(largestUnit, Decl(temporal.ts, 1653, 28)) + + const startDate2 = Temporal.PlainDate.from("2001-01-01"); +>startDate2 : Symbol(startDate2, Decl(temporal.ts, 1655, 9)) +>Temporal.PlainDate.from : Symbol(Temporal.PlainDateConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainDate : Symbol(Temporal.PlainDate, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainDate : Symbol(Temporal.PlainDate, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.PlainDateConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) + + startDate2.add(oneAndAHalfMonth).add(oneAndAHalfMonth) +>startDate2.add(oneAndAHalfMonth).add(oneAndAHalfMonth) .since : Symbol(Temporal.PlainDate.since, Decl(lib.esnext.temporal.d.ts, --, --)) +>startDate2.add(oneAndAHalfMonth).add : Symbol(Temporal.PlainDate.add, Decl(lib.esnext.temporal.d.ts, --, --)) +>startDate2.add : Symbol(Temporal.PlainDate.add, Decl(lib.esnext.temporal.d.ts, --, --)) +>startDate2 : Symbol(startDate2, Decl(temporal.ts, 1655, 9)) +>add : Symbol(Temporal.PlainDate.add, Decl(lib.esnext.temporal.d.ts, --, --)) +>oneAndAHalfMonth : Symbol(oneAndAHalfMonth, Decl(temporal.ts, 1648, 9)) +>add : Symbol(Temporal.PlainDate.add, Decl(lib.esnext.temporal.d.ts, --, --)) +>oneAndAHalfMonth : Symbol(oneAndAHalfMonth, Decl(temporal.ts, 1648, 9)) + + .since(startDate2, { largestUnit: "months" }); // => P3M1D +>since : Symbol(Temporal.PlainDate.since, Decl(lib.esnext.temporal.d.ts, --, --)) +>startDate2 : Symbol(startDate2, Decl(temporal.ts, 1655, 9)) +>largestUnit : Symbol(largestUnit, Decl(temporal.ts, 1657, 28)) +} + +{ + const hourAndAHalf = Temporal.Duration.from("PT1H30M"); +>hourAndAHalf : Symbol(hourAndAHalf, Decl(temporal.ts, 1661, 9)) +>Temporal.Duration.from : Symbol(Temporal.DurationConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.Duration : Symbol(Temporal.Duration, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>Duration : Symbol(Temporal.Duration, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.DurationConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) + + hourAndAHalf.subtract({ hours: 1 }); // => PT30M +>hourAndAHalf.subtract : Symbol(Temporal.Duration.subtract, Decl(lib.esnext.temporal.d.ts, --, --)) +>hourAndAHalf : Symbol(hourAndAHalf, Decl(temporal.ts, 1661, 9)) +>subtract : Symbol(Temporal.Duration.subtract, Decl(lib.esnext.temporal.d.ts, --, --)) +>hours : Symbol(hours, Decl(temporal.ts, 1662, 27)) + + const one = Temporal.Duration.from({ minutes: 180 }); +>one : Symbol(one, Decl(temporal.ts, 1664, 9)) +>Temporal.Duration.from : Symbol(Temporal.DurationConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.Duration : Symbol(Temporal.Duration, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>Duration : Symbol(Temporal.Duration, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.DurationConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>minutes : Symbol(minutes, Decl(temporal.ts, 1664, 40)) + + const two = Temporal.Duration.from({ seconds: 30 }); +>two : Symbol(two, Decl(temporal.ts, 1665, 9)) +>Temporal.Duration.from : Symbol(Temporal.DurationConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.Duration : Symbol(Temporal.Duration, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>Duration : Symbol(Temporal.Duration, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.DurationConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>seconds : Symbol(seconds, Decl(temporal.ts, 1665, 40)) + + one.subtract(two); // => PT179M30S +>one.subtract : Symbol(Temporal.Duration.subtract, Decl(lib.esnext.temporal.d.ts, --, --)) +>one : Symbol(one, Decl(temporal.ts, 1664, 9)) +>subtract : Symbol(Temporal.Duration.subtract, Decl(lib.esnext.temporal.d.ts, --, --)) +>two : Symbol(two, Decl(temporal.ts, 1665, 9)) + + one.subtract(two).round({ largestUnit: "hour" }); // => PT2H59M30S +>one.subtract(two).round : Symbol(Temporal.Duration.round, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>one.subtract : Symbol(Temporal.Duration.subtract, Decl(lib.esnext.temporal.d.ts, --, --)) +>one : Symbol(one, Decl(temporal.ts, 1664, 9)) +>subtract : Symbol(Temporal.Duration.subtract, Decl(lib.esnext.temporal.d.ts, --, --)) +>two : Symbol(two, Decl(temporal.ts, 1665, 9)) +>round : Symbol(Temporal.Duration.round, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>largestUnit : Symbol(largestUnit, Decl(temporal.ts, 1667, 29)) + + // Example of subtracting calendar units; cannot be subtracted using + // subtract() because units need to be converted + const threeMonths = Temporal.Duration.from({ months: 3 }); +>threeMonths : Symbol(threeMonths, Decl(temporal.ts, 1671, 9)) +>Temporal.Duration.from : Symbol(Temporal.DurationConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.Duration : Symbol(Temporal.Duration, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>Duration : Symbol(Temporal.Duration, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.DurationConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>months : Symbol(months, Decl(temporal.ts, 1671, 48)) + + const oneAndAHalfMonth = Temporal.Duration.from({ months: 1, days: 15 }); +>oneAndAHalfMonth : Symbol(oneAndAHalfMonth, Decl(temporal.ts, 1672, 9)) +>Temporal.Duration.from : Symbol(Temporal.DurationConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.Duration : Symbol(Temporal.Duration, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>Duration : Symbol(Temporal.Duration, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.DurationConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>months : Symbol(months, Decl(temporal.ts, 1672, 53)) +>days : Symbol(days, Decl(temporal.ts, 1672, 64)) + + // To convert units, use arithmetic relative to a start date: + const startDate1 = Temporal.PlainDate.from("2001-01-01"); +>startDate1 : Symbol(startDate1, Decl(temporal.ts, 1675, 9)) +>Temporal.PlainDate.from : Symbol(Temporal.PlainDateConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainDate : Symbol(Temporal.PlainDate, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainDate : Symbol(Temporal.PlainDate, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.PlainDateConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) + + startDate1.add(threeMonths).subtract(oneAndAHalfMonth) +>startDate1.add(threeMonths).subtract(oneAndAHalfMonth) .since : Symbol(Temporal.PlainDate.since, Decl(lib.esnext.temporal.d.ts, --, --)) +>startDate1.add(threeMonths).subtract : Symbol(Temporal.PlainDate.subtract, Decl(lib.esnext.temporal.d.ts, --, --)) +>startDate1.add : Symbol(Temporal.PlainDate.add, Decl(lib.esnext.temporal.d.ts, --, --)) +>startDate1 : Symbol(startDate1, Decl(temporal.ts, 1675, 9)) +>add : Symbol(Temporal.PlainDate.add, Decl(lib.esnext.temporal.d.ts, --, --)) +>threeMonths : Symbol(threeMonths, Decl(temporal.ts, 1671, 9)) +>subtract : Symbol(Temporal.PlainDate.subtract, Decl(lib.esnext.temporal.d.ts, --, --)) +>oneAndAHalfMonth : Symbol(oneAndAHalfMonth, Decl(temporal.ts, 1672, 9)) + + .since(startDate1, { largestUnit: "months" }); // => P1M13D +>since : Symbol(Temporal.PlainDate.since, Decl(lib.esnext.temporal.d.ts, --, --)) +>startDate1 : Symbol(startDate1, Decl(temporal.ts, 1675, 9)) +>largestUnit : Symbol(largestUnit, Decl(temporal.ts, 1677, 28)) + + const startDate2 = Temporal.PlainDate.from("2001-02-01"); +>startDate2 : Symbol(startDate2, Decl(temporal.ts, 1679, 9)) +>Temporal.PlainDate.from : Symbol(Temporal.PlainDateConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainDate : Symbol(Temporal.PlainDate, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainDate : Symbol(Temporal.PlainDate, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.PlainDateConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) + + startDate2.add(threeMonths).subtract(oneAndAHalfMonth) +>startDate2.add(threeMonths).subtract(oneAndAHalfMonth) .since : Symbol(Temporal.PlainDate.since, Decl(lib.esnext.temporal.d.ts, --, --)) +>startDate2.add(threeMonths).subtract : Symbol(Temporal.PlainDate.subtract, Decl(lib.esnext.temporal.d.ts, --, --)) +>startDate2.add : Symbol(Temporal.PlainDate.add, Decl(lib.esnext.temporal.d.ts, --, --)) +>startDate2 : Symbol(startDate2, Decl(temporal.ts, 1679, 9)) +>add : Symbol(Temporal.PlainDate.add, Decl(lib.esnext.temporal.d.ts, --, --)) +>threeMonths : Symbol(threeMonths, Decl(temporal.ts, 1671, 9)) +>subtract : Symbol(Temporal.PlainDate.subtract, Decl(lib.esnext.temporal.d.ts, --, --)) +>oneAndAHalfMonth : Symbol(oneAndAHalfMonth, Decl(temporal.ts, 1672, 9)) + + .since(startDate2, { largestUnit: "months" }); // => P1M16D +>since : Symbol(Temporal.PlainDate.since, Decl(lib.esnext.temporal.d.ts, --, --)) +>startDate2 : Symbol(startDate2, Decl(temporal.ts, 1679, 9)) +>largestUnit : Symbol(largestUnit, Decl(temporal.ts, 1681, 28)) +} + +{ + const d = Temporal.Duration.from("P1Y2M3DT4H5M6.987654321S"); +>d : Symbol(d, Decl(temporal.ts, 1685, 9)) +>Temporal.Duration.from : Symbol(Temporal.DurationConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.Duration : Symbol(Temporal.Duration, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>Duration : Symbol(Temporal.Duration, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.DurationConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) + + d.sign; // 1 +>d.sign : Symbol(Temporal.Duration.sign, Decl(lib.esnext.temporal.d.ts, --, --)) +>d : Symbol(d, Decl(temporal.ts, 1685, 9)) +>sign : Symbol(Temporal.Duration.sign, Decl(lib.esnext.temporal.d.ts, --, --)) + + d.negated(); // -P1Y2M3DT4H5M6.987654321S +>d.negated : Symbol(Temporal.Duration.negated, Decl(lib.esnext.temporal.d.ts, --, --)) +>d : Symbol(d, Decl(temporal.ts, 1685, 9)) +>negated : Symbol(Temporal.Duration.negated, Decl(lib.esnext.temporal.d.ts, --, --)) + + d.negated().sign; // -1 +>d.negated().sign : Symbol(Temporal.Duration.sign, Decl(lib.esnext.temporal.d.ts, --, --)) +>d.negated : Symbol(Temporal.Duration.negated, Decl(lib.esnext.temporal.d.ts, --, --)) +>d : Symbol(d, Decl(temporal.ts, 1685, 9)) +>negated : Symbol(Temporal.Duration.negated, Decl(lib.esnext.temporal.d.ts, --, --)) +>sign : Symbol(Temporal.Duration.sign, Decl(lib.esnext.temporal.d.ts, --, --)) +} + +{ + const d = Temporal.Duration.from("-PT8H30M"); +>d : Symbol(d, Decl(temporal.ts, 1692, 9)) +>Temporal.Duration.from : Symbol(Temporal.DurationConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.Duration : Symbol(Temporal.Duration, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>Duration : Symbol(Temporal.Duration, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.DurationConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) + + d.abs(); // PT8H30M +>d.abs : Symbol(Temporal.Duration.abs, Decl(lib.esnext.temporal.d.ts, --, --)) +>d : Symbol(d, Decl(temporal.ts, 1692, 9)) +>abs : Symbol(Temporal.Duration.abs, Decl(lib.esnext.temporal.d.ts, --, --)) +} + +{ + let d: Temporal.Duration; +>d : Symbol(d, Decl(temporal.ts, 1697, 7)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>Duration : Symbol(Temporal.Duration, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) + + // Balance a duration as far as possible without knowing a starting point + d = Temporal.Duration.from({ minutes: 130 }); +>d : Symbol(d, Decl(temporal.ts, 1697, 7)) +>Temporal.Duration.from : Symbol(Temporal.DurationConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.Duration : Symbol(Temporal.Duration, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>Duration : Symbol(Temporal.Duration, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.DurationConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>minutes : Symbol(minutes, Decl(temporal.ts, 1700, 32)) + + d.round({ largestUnit: "day" }); // => PT2H10M +>d.round : Symbol(Temporal.Duration.round, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>d : Symbol(d, Decl(temporal.ts, 1697, 7)) +>round : Symbol(Temporal.Duration.round, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>largestUnit : Symbol(largestUnit, Decl(temporal.ts, 1701, 13)) + + // Round to the nearest unit + d = Temporal.Duration.from({ minutes: 10, seconds: 52 }); +>d : Symbol(d, Decl(temporal.ts, 1697, 7)) +>Temporal.Duration.from : Symbol(Temporal.DurationConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.Duration : Symbol(Temporal.Duration, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>Duration : Symbol(Temporal.Duration, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.DurationConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>minutes : Symbol(minutes, Decl(temporal.ts, 1704, 32)) +>seconds : Symbol(seconds, Decl(temporal.ts, 1704, 45)) + + d.round({ smallestUnit: "minute" }); // => PT11M +>d.round : Symbol(Temporal.Duration.round, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>d : Symbol(d, Decl(temporal.ts, 1697, 7)) +>round : Symbol(Temporal.Duration.round, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>smallestUnit : Symbol(smallestUnit, Decl(temporal.ts, 1705, 13)) + + d.round({ smallestUnit: "minute", roundingMode: "trunc" }); // => PT10M +>d.round : Symbol(Temporal.Duration.round, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>d : Symbol(d, Decl(temporal.ts, 1697, 7)) +>round : Symbol(Temporal.Duration.round, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>smallestUnit : Symbol(smallestUnit, Decl(temporal.ts, 1706, 13)) +>roundingMode : Symbol(roundingMode, Decl(temporal.ts, 1706, 37)) + + // How many seconds in a multi-unit duration? + d = Temporal.Duration.from("PT2H34M18S"); +>d : Symbol(d, Decl(temporal.ts, 1697, 7)) +>Temporal.Duration.from : Symbol(Temporal.DurationConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.Duration : Symbol(Temporal.Duration, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>Duration : Symbol(Temporal.Duration, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.DurationConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) + + d.round({ largestUnit: "second" }).seconds; // => 9258 +>d.round({ largestUnit: "second" }).seconds : Symbol(Temporal.Duration.seconds, Decl(lib.esnext.temporal.d.ts, --, --)) +>d.round : Symbol(Temporal.Duration.round, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>d : Symbol(d, Decl(temporal.ts, 1697, 7)) +>round : Symbol(Temporal.Duration.round, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>largestUnit : Symbol(largestUnit, Decl(temporal.ts, 1710, 13)) +>seconds : Symbol(Temporal.Duration.seconds, Decl(lib.esnext.temporal.d.ts, --, --)) + + // Normalize, with and without taking DST into account + d = Temporal.Duration.from({ hours: 2756 }); +>d : Symbol(d, Decl(temporal.ts, 1697, 7)) +>Temporal.Duration.from : Symbol(Temporal.DurationConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.Duration : Symbol(Temporal.Duration, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>Duration : Symbol(Temporal.Duration, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.DurationConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>hours : Symbol(hours, Decl(temporal.ts, 1713, 32)) + + d.round({ +>d.round : Symbol(Temporal.Duration.round, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>d : Symbol(d, Decl(temporal.ts, 1697, 7)) +>round : Symbol(Temporal.Duration.round, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) + + relativeTo: "2020-01-01T00:00+01:00[Europe/Rome]", +>relativeTo : Symbol(relativeTo, Decl(temporal.ts, 1714, 13)) + + largestUnit: "year", +>largestUnit : Symbol(largestUnit, Decl(temporal.ts, 1715, 58)) + + }); // => P114DT21H + // (one hour longer because DST skipped an hour) + d.round({ +>d.round : Symbol(Temporal.Duration.round, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>d : Symbol(d, Decl(temporal.ts, 1697, 7)) +>round : Symbol(Temporal.Duration.round, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) + + relativeTo: "2020-01-01", +>relativeTo : Symbol(relativeTo, Decl(temporal.ts, 1719, 13)) + + largestUnit: "year", +>largestUnit : Symbol(largestUnit, Decl(temporal.ts, 1720, 33)) + + }); // => P114DT20H + // (one hour shorter if ignoring DST) + + // Normalize days into months or years + d = Temporal.Duration.from({ days: 190 }); +>d : Symbol(d, Decl(temporal.ts, 1697, 7)) +>Temporal.Duration.from : Symbol(Temporal.DurationConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.Duration : Symbol(Temporal.Duration, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>Duration : Symbol(Temporal.Duration, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.DurationConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>days : Symbol(days, Decl(temporal.ts, 1726, 32)) + + const refDate = Temporal.PlainDate.from("2020-01-01"); +>refDate : Symbol(refDate, Decl(temporal.ts, 1727, 9)) +>Temporal.PlainDate.from : Symbol(Temporal.PlainDateConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.PlainDate : Symbol(Temporal.PlainDate, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>PlainDate : Symbol(Temporal.PlainDate, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.PlainDateConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) + + d.round({ relativeTo: refDate, largestUnit: "year" }); // => P6M8D +>d.round : Symbol(Temporal.Duration.round, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>d : Symbol(d, Decl(temporal.ts, 1697, 7)) +>round : Symbol(Temporal.Duration.round, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>relativeTo : Symbol(relativeTo, Decl(temporal.ts, 1728, 13)) +>refDate : Symbol(refDate, Decl(temporal.ts, 1727, 9)) +>largestUnit : Symbol(largestUnit, Decl(temporal.ts, 1728, 34)) + + // Same, but in a different calendar system + d.round({ +>d.round : Symbol(Temporal.Duration.round, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>d : Symbol(d, Decl(temporal.ts, 1697, 7)) +>round : Symbol(Temporal.Duration.round, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) + + relativeTo: refDate.withCalendar("hebrew"), +>relativeTo : Symbol(relativeTo, Decl(temporal.ts, 1731, 13)) +>refDate.withCalendar : Symbol(Temporal.PlainDate.withCalendar, Decl(lib.esnext.temporal.d.ts, --, --)) +>refDate : Symbol(refDate, Decl(temporal.ts, 1727, 9)) +>withCalendar : Symbol(Temporal.PlainDate.withCalendar, Decl(lib.esnext.temporal.d.ts, --, --)) + + largestUnit: "year", +>largestUnit : Symbol(largestUnit, Decl(temporal.ts, 1732, 51)) + + }); // => P6M13D + + // Round a duration up to the next 5-minute billing period + d = Temporal.Duration.from({ minutes: 6 }); +>d : Symbol(d, Decl(temporal.ts, 1697, 7)) +>Temporal.Duration.from : Symbol(Temporal.DurationConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.Duration : Symbol(Temporal.Duration, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>Duration : Symbol(Temporal.Duration, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.DurationConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>minutes : Symbol(minutes, Decl(temporal.ts, 1737, 32)) + + d.round({ +>d.round : Symbol(Temporal.Duration.round, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>d : Symbol(d, Decl(temporal.ts, 1697, 7)) +>round : Symbol(Temporal.Duration.round, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) + + smallestUnit: "minute", +>smallestUnit : Symbol(smallestUnit, Decl(temporal.ts, 1738, 13)) + + roundingIncrement: 5, +>roundingIncrement : Symbol(roundingIncrement, Decl(temporal.ts, 1739, 31)) + + roundingMode: "ceil", +>roundingMode : Symbol(roundingMode, Decl(temporal.ts, 1740, 29)) + + }); // => PT10M + + // How many full 3-month quarters of this year, are in this duration? + d = Temporal.Duration.from({ months: 10, days: 15 }); +>d : Symbol(d, Decl(temporal.ts, 1697, 7)) +>Temporal.Duration.from : Symbol(Temporal.DurationConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.Duration : Symbol(Temporal.Duration, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>Duration : Symbol(Temporal.Duration, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.DurationConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>months : Symbol(months, Decl(temporal.ts, 1745, 32)) +>days : Symbol(days, Decl(temporal.ts, 1745, 44)) + + d = d.round({ +>d : Symbol(d, Decl(temporal.ts, 1697, 7)) +>d.round : Symbol(Temporal.Duration.round, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>d : Symbol(d, Decl(temporal.ts, 1697, 7)) +>round : Symbol(Temporal.Duration.round, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) + + smallestUnit: "month", +>smallestUnit : Symbol(smallestUnit, Decl(temporal.ts, 1746, 17)) + + roundingIncrement: 3, +>roundingIncrement : Symbol(roundingIncrement, Decl(temporal.ts, 1747, 30)) + + roundingMode: "trunc", +>roundingMode : Symbol(roundingMode, Decl(temporal.ts, 1748, 29)) + + relativeTo: Temporal.Now.plainDateISO(), +>relativeTo : Symbol(relativeTo, Decl(temporal.ts, 1749, 30)) +>Temporal.Now.plainDateISO : Symbol(Temporal.Now.plainDateISO, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.Now : Symbol(Temporal.Now, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>Now : Symbol(Temporal.Now, Decl(lib.esnext.temporal.d.ts, --, --)) +>plainDateISO : Symbol(Temporal.Now.plainDateISO, Decl(lib.esnext.temporal.d.ts, --, --)) + + }); + const quarters = d.months / 3; +>quarters : Symbol(quarters, Decl(temporal.ts, 1752, 9)) +>d.months : Symbol(Temporal.Duration.months, Decl(lib.esnext.temporal.d.ts, --, --)) +>d : Symbol(d, Decl(temporal.ts, 1697, 7)) +>months : Symbol(Temporal.Duration.months, Decl(lib.esnext.temporal.d.ts, --, --)) + + quarters; // => 3 +>quarters : Symbol(quarters, Decl(temporal.ts, 1752, 9)) +} + +{ + let d: Temporal.Duration; +>d : Symbol(d, Decl(temporal.ts, 1757, 7)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>Duration : Symbol(Temporal.Duration, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) + + // How many seconds in 130 hours and 20 minutes? + d = Temporal.Duration.from({ hours: 130, minutes: 20 }); +>d : Symbol(d, Decl(temporal.ts, 1757, 7)) +>Temporal.Duration.from : Symbol(Temporal.DurationConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.Duration : Symbol(Temporal.Duration, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>Duration : Symbol(Temporal.Duration, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.DurationConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>hours : Symbol(hours, Decl(temporal.ts, 1760, 32)) +>minutes : Symbol(minutes, Decl(temporal.ts, 1760, 44)) + + d.total({ unit: "second" }); // => 469200 +>d.total : Symbol(Temporal.Duration.total, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>d : Symbol(d, Decl(temporal.ts, 1757, 7)) +>total : Symbol(Temporal.Duration.total, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>unit : Symbol(unit, Decl(temporal.ts, 1761, 13)) + + // How many 24-hour days is 123456789 seconds? + d = Temporal.Duration.from("PT123456789S"); +>d : Symbol(d, Decl(temporal.ts, 1757, 7)) +>Temporal.Duration.from : Symbol(Temporal.DurationConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.Duration : Symbol(Temporal.Duration, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>Duration : Symbol(Temporal.Duration, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.DurationConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) + + d.total({ unit: "day" }); // 1428.8980208333332 +>d.total : Symbol(Temporal.Duration.total, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>d : Symbol(d, Decl(temporal.ts, 1757, 7)) +>total : Symbol(Temporal.Duration.total, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>unit : Symbol(unit, Decl(temporal.ts, 1765, 13)) + + // Find totals in months, with and without taking DST into account + d = Temporal.Duration.from({ hours: 2756 }); +>d : Symbol(d, Decl(temporal.ts, 1757, 7)) +>Temporal.Duration.from : Symbol(Temporal.DurationConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.Duration : Symbol(Temporal.Duration, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>Duration : Symbol(Temporal.Duration, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.DurationConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>hours : Symbol(hours, Decl(temporal.ts, 1768, 32)) + + d.total({ +>d.total : Symbol(Temporal.Duration.total, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>d : Symbol(d, Decl(temporal.ts, 1757, 7)) +>total : Symbol(Temporal.Duration.total, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) + + relativeTo: "2020-01-01T00:00+01:00[Europe/Rome]", +>relativeTo : Symbol(relativeTo, Decl(temporal.ts, 1769, 13)) + + unit: "month", +>unit : Symbol(unit, Decl(temporal.ts, 1770, 58)) + + }); // => 3.7958333333333334 + d.total({ +>d.total : Symbol(Temporal.Duration.total, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>d : Symbol(d, Decl(temporal.ts, 1757, 7)) +>total : Symbol(Temporal.Duration.total, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) + + unit: "month", +>unit : Symbol(unit, Decl(temporal.ts, 1773, 13)) + + relativeTo: "2020-01-01", +>relativeTo : Symbol(relativeTo, Decl(temporal.ts, 1774, 22)) + + }); // => 3.7944444444444443 +} + +{ + let d: Temporal.Duration; +>d : Symbol(d, Decl(temporal.ts, 1780, 7)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>Duration : Symbol(Temporal.Duration, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) + + d = Temporal.Duration.from({ years: 1, days: 1 }); +>d : Symbol(d, Decl(temporal.ts, 1780, 7)) +>Temporal.Duration.from : Symbol(Temporal.DurationConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.Duration : Symbol(Temporal.Duration, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>Duration : Symbol(Temporal.Duration, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.DurationConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>years : Symbol(years, Decl(temporal.ts, 1782, 32)) +>days : Symbol(days, Decl(temporal.ts, 1782, 42)) + + d.toString(); // => P1Y1D +>d.toString : Symbol(Temporal.Duration.toString, Decl(lib.esnext.temporal.d.ts, --, --)) +>d : Symbol(d, Decl(temporal.ts, 1780, 7)) +>toString : Symbol(Temporal.Duration.toString, Decl(lib.esnext.temporal.d.ts, --, --)) + + d = Temporal.Duration.from({ years: -1, days: -1 }); +>d : Symbol(d, Decl(temporal.ts, 1780, 7)) +>Temporal.Duration.from : Symbol(Temporal.DurationConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.Duration : Symbol(Temporal.Duration, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>Duration : Symbol(Temporal.Duration, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.DurationConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>years : Symbol(years, Decl(temporal.ts, 1784, 32)) +>days : Symbol(days, Decl(temporal.ts, 1784, 43)) + + d.toString(); // => -P1Y1D +>d.toString : Symbol(Temporal.Duration.toString, Decl(lib.esnext.temporal.d.ts, --, --)) +>d : Symbol(d, Decl(temporal.ts, 1780, 7)) +>toString : Symbol(Temporal.Duration.toString, Decl(lib.esnext.temporal.d.ts, --, --)) + + d = Temporal.Duration.from({ milliseconds: 1000 }); +>d : Symbol(d, Decl(temporal.ts, 1780, 7)) +>Temporal.Duration.from : Symbol(Temporal.DurationConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.Duration : Symbol(Temporal.Duration, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>Duration : Symbol(Temporal.Duration, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.DurationConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>milliseconds : Symbol(milliseconds, Decl(temporal.ts, 1786, 32)) + + d.toString(); // => PT1S +>d.toString : Symbol(Temporal.Duration.toString, Decl(lib.esnext.temporal.d.ts, --, --)) +>d : Symbol(d, Decl(temporal.ts, 1780, 7)) +>toString : Symbol(Temporal.Duration.toString, Decl(lib.esnext.temporal.d.ts, --, --)) + + // The output format always balances units under 1 s, even if the + // underlying Temporal.Duration object doesn't. + const nobal = Temporal.Duration.from({ milliseconds: 3500 }); +>nobal : Symbol(nobal, Decl(temporal.ts, 1791, 9)) +>Temporal.Duration.from : Symbol(Temporal.DurationConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.Duration : Symbol(Temporal.Duration, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>Duration : Symbol(Temporal.Duration, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.DurationConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>milliseconds : Symbol(milliseconds, Decl(temporal.ts, 1791, 42)) + + console.log(`${nobal}`, nobal.seconds, nobal.milliseconds); // => 'PT3.5S 0 3500' +>console.log : Symbol(Console.log, Decl(lib.dom.d.ts, --, --)) +>console : Symbol(console, Decl(lib.dom.d.ts, --, --)) +>log : Symbol(Console.log, Decl(lib.dom.d.ts, --, --)) +>nobal : Symbol(nobal, Decl(temporal.ts, 1791, 9)) +>nobal.seconds : Symbol(Temporal.Duration.seconds, Decl(lib.esnext.temporal.d.ts, --, --)) +>nobal : Symbol(nobal, Decl(temporal.ts, 1791, 9)) +>seconds : Symbol(Temporal.Duration.seconds, Decl(lib.esnext.temporal.d.ts, --, --)) +>nobal.milliseconds : Symbol(Temporal.Duration.milliseconds, Decl(lib.esnext.temporal.d.ts, --, --)) +>nobal : Symbol(nobal, Decl(temporal.ts, 1791, 9)) +>milliseconds : Symbol(Temporal.Duration.milliseconds, Decl(lib.esnext.temporal.d.ts, --, --)) + + const bal = nobal.round({ largestUnit: "year" }); // balance through round +>bal : Symbol(bal, Decl(temporal.ts, 1793, 9)) +>nobal.round : Symbol(Temporal.Duration.round, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>nobal : Symbol(nobal, Decl(temporal.ts, 1791, 9)) +>round : Symbol(Temporal.Duration.round, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>largestUnit : Symbol(largestUnit, Decl(temporal.ts, 1793, 29)) + + console.log(`${bal}`, bal.seconds, bal.milliseconds); // => 'PT3.5S 3 500' +>console.log : Symbol(Console.log, Decl(lib.dom.d.ts, --, --)) +>console : Symbol(console, Decl(lib.dom.d.ts, --, --)) +>log : Symbol(Console.log, Decl(lib.dom.d.ts, --, --)) +>bal : Symbol(bal, Decl(temporal.ts, 1793, 9)) +>bal.seconds : Symbol(Temporal.Duration.seconds, Decl(lib.esnext.temporal.d.ts, --, --)) +>bal : Symbol(bal, Decl(temporal.ts, 1793, 9)) +>seconds : Symbol(Temporal.Duration.seconds, Decl(lib.esnext.temporal.d.ts, --, --)) +>bal.milliseconds : Symbol(Temporal.Duration.milliseconds, Decl(lib.esnext.temporal.d.ts, --, --)) +>bal : Symbol(bal, Decl(temporal.ts, 1793, 9)) +>milliseconds : Symbol(Temporal.Duration.milliseconds, Decl(lib.esnext.temporal.d.ts, --, --)) + + d = Temporal.Duration.from("PT59.999999999S"); +>d : Symbol(d, Decl(temporal.ts, 1780, 7)) +>Temporal.Duration.from : Symbol(Temporal.DurationConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.Duration : Symbol(Temporal.Duration, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>Duration : Symbol(Temporal.Duration, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.DurationConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) + + d.toString({ smallestUnit: "second" }); // => PT59S +>d.toString : Symbol(Temporal.Duration.toString, Decl(lib.esnext.temporal.d.ts, --, --)) +>d : Symbol(d, Decl(temporal.ts, 1780, 7)) +>toString : Symbol(Temporal.Duration.toString, Decl(lib.esnext.temporal.d.ts, --, --)) +>smallestUnit : Symbol(smallestUnit, Decl(temporal.ts, 1797, 16)) + + d.toString({ fractionalSecondDigits: 0 }); // => PT59S +>d.toString : Symbol(Temporal.Duration.toString, Decl(lib.esnext.temporal.d.ts, --, --)) +>d : Symbol(d, Decl(temporal.ts, 1780, 7)) +>toString : Symbol(Temporal.Duration.toString, Decl(lib.esnext.temporal.d.ts, --, --)) +>fractionalSecondDigits : Symbol(fractionalSecondDigits, Decl(temporal.ts, 1798, 16)) + + d.toString({ fractionalSecondDigits: 4 }); // => PT59.9999S +>d.toString : Symbol(Temporal.Duration.toString, Decl(lib.esnext.temporal.d.ts, --, --)) +>d : Symbol(d, Decl(temporal.ts, 1780, 7)) +>toString : Symbol(Temporal.Duration.toString, Decl(lib.esnext.temporal.d.ts, --, --)) +>fractionalSecondDigits : Symbol(fractionalSecondDigits, Decl(temporal.ts, 1799, 16)) + + d.toString({ fractionalSecondDigits: 8, roundingMode: "halfExpand" }); +>d.toString : Symbol(Temporal.Duration.toString, Decl(lib.esnext.temporal.d.ts, --, --)) +>d : Symbol(d, Decl(temporal.ts, 1780, 7)) +>toString : Symbol(Temporal.Duration.toString, Decl(lib.esnext.temporal.d.ts, --, --)) +>fractionalSecondDigits : Symbol(fractionalSecondDigits, Decl(temporal.ts, 1800, 16)) +>roundingMode : Symbol(roundingMode, Decl(temporal.ts, 1800, 43)) + + // => PT60.00000000S +} + +{ + const d = Temporal.Duration.from("P1DT6H30M"); +>d : Symbol(d, Decl(temporal.ts, 1805, 9)) +>Temporal.Duration.from : Symbol(Temporal.DurationConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.Duration : Symbol(Temporal.Duration, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>Duration : Symbol(Temporal.Duration, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) +>from : Symbol(Temporal.DurationConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) + + d.toLocaleString(); // example output: '1 day 6 hours 30 minutes' +>d.toLocaleString : Symbol(Temporal.Duration.toLocaleString, Decl(lib.esnext.temporal.d.ts, --, --)) +>d : Symbol(d, Decl(temporal.ts, 1805, 9)) +>toLocaleString : Symbol(Temporal.Duration.toLocaleString, Decl(lib.esnext.temporal.d.ts, --, --)) + + d.toLocaleString("de-DE"); // example output: '1 Tag 6 Stunden 30 Minuten' +>d.toLocaleString : Symbol(Temporal.Duration.toLocaleString, Decl(lib.esnext.temporal.d.ts, --, --)) +>d : Symbol(d, Decl(temporal.ts, 1805, 9)) +>toLocaleString : Symbol(Temporal.Duration.toLocaleString, Decl(lib.esnext.temporal.d.ts, --, --)) + + d.toLocaleString("en-US", { days: "short", hours: "numeric" }); // example output: '1 day 6 hours' +>d.toLocaleString : Symbol(Temporal.Duration.toLocaleString, Decl(lib.esnext.temporal.d.ts, --, --)) +>d : Symbol(d, Decl(temporal.ts, 1805, 9)) +>toLocaleString : Symbol(Temporal.Duration.toLocaleString, Decl(lib.esnext.temporal.d.ts, --, --)) +>days : Symbol(days, Decl(temporal.ts, 1808, 31)) +>hours : Symbol(hours, Decl(temporal.ts, 1808, 46)) +} + +{ + Temporal.Now.instant(); // get the current system exact time +>Temporal.Now.instant : Symbol(Temporal.Now.instant, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.Now : Symbol(Temporal.Now, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>Now : Symbol(Temporal.Now, Decl(lib.esnext.temporal.d.ts, --, --)) +>instant : Symbol(Temporal.Now.instant, Decl(lib.esnext.temporal.d.ts, --, --)) + + Temporal.Now.timeZoneId(); // get the current system time zone +>Temporal.Now.timeZoneId : Symbol(Temporal.Now.timeZoneId, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.Now : Symbol(Temporal.Now, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>Now : Symbol(Temporal.Now, Decl(lib.esnext.temporal.d.ts, --, --)) +>timeZoneId : Symbol(Temporal.Now.timeZoneId, Decl(lib.esnext.temporal.d.ts, --, --)) + + Temporal.Now.zonedDateTimeISO(); // get the current date and wall-clock time in the system time zone and ISO-8601 calendar +>Temporal.Now.zonedDateTimeISO : Symbol(Temporal.Now.zonedDateTimeISO, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.Now : Symbol(Temporal.Now, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>Now : Symbol(Temporal.Now, Decl(lib.esnext.temporal.d.ts, --, --)) +>zonedDateTimeISO : Symbol(Temporal.Now.zonedDateTimeISO, Decl(lib.esnext.temporal.d.ts, --, --)) + + Temporal.Now.plainDateISO(); // get the current date in the system time zone and ISO-8601 calendar +>Temporal.Now.plainDateISO : Symbol(Temporal.Now.plainDateISO, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.Now : Symbol(Temporal.Now, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>Now : Symbol(Temporal.Now, Decl(lib.esnext.temporal.d.ts, --, --)) +>plainDateISO : Symbol(Temporal.Now.plainDateISO, Decl(lib.esnext.temporal.d.ts, --, --)) + + Temporal.Now.plainTimeISO(); // get the current wall-clock time in the system time zone and ISO-8601 calendar +>Temporal.Now.plainTimeISO : Symbol(Temporal.Now.plainTimeISO, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.Now : Symbol(Temporal.Now, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>Now : Symbol(Temporal.Now, Decl(lib.esnext.temporal.d.ts, --, --)) +>plainTimeISO : Symbol(Temporal.Now.plainTimeISO, Decl(lib.esnext.temporal.d.ts, --, --)) + + Temporal.Now.plainDateTimeISO(); // same as above, but return the DateTime in the ISO-8601 calendar +>Temporal.Now.plainDateTimeISO : Symbol(Temporal.Now.plainDateTimeISO, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal.Now : Symbol(Temporal.Now, Decl(lib.esnext.temporal.d.ts, --, --)) +>Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) +>Now : Symbol(Temporal.Now, Decl(lib.esnext.temporal.d.ts, --, --)) +>plainDateTimeISO : Symbol(Temporal.Now.plainDateTimeISO, Decl(lib.esnext.temporal.d.ts, --, --)) +} + diff --git a/tests/baselines/reference/temporal.types b/tests/baselines/reference/temporal.types new file mode 100644 index 0000000000000..b8c7f7790d2ea --- /dev/null +++ b/tests/baselines/reference/temporal.types @@ -0,0 +1,15707 @@ +//// [tests/cases/compiler/temporal.ts] //// + +=== Performance Stats === +Type Count: 2,500 + +=== temporal.ts === +/** + * Test cases derived from documentation at tc39/proposal-temporal, + * under the following license: + * + * Copyright 2017, 2018, 2019, 2020 ECMA International + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH + * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, + * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM + * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR + * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. + */ + +{ + const instant = Temporal.Instant.from("2020-01-01T00:00+05:30"); // => 2019-12-31T18:30:00Z +>instant : Temporal.Instant +> : ^^^^^^^^^^^^^^^^ +>Temporal.Instant.from("2020-01-01T00:00+05:30") : Temporal.Instant +> : ^^^^^^^^^^^^^^^^ +>Temporal.Instant.from : (item: Temporal.InstantLike) => Temporal.Instant +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.Instant : Temporal.InstantConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>Instant : Temporal.InstantConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.InstantLike) => Temporal.Instant +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"2020-01-01T00:00+05:30" : "2020-01-01T00:00+05:30" +> : ^^^^^^^^^^^^^^^^^^^^^^^^ + + instant.epochNanoseconds; // => 1577817000000000000n +>instant.epochNanoseconds : bigint +> : ^^^^^^ +>instant : Temporal.Instant +> : ^^^^^^^^^^^^^^^^ +>epochNanoseconds : bigint +> : ^^^^^^ + + // `Temporal.Instant` lacks properties that depend on time zone or calendar + instant.year; // => undefined +>instant.year : any +> : ^^^ +>instant : Temporal.Instant +> : ^^^^^^^^^^^^^^^^ +>year : any +> : ^^^ + + const zdtTokyo = instant.toZonedDateTimeISO("Asia/Tokyo"); // => 2020-01-01T03:30:00+09:00[Asia/Tokyo] +>zdtTokyo : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>instant.toZonedDateTimeISO("Asia/Tokyo") : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>instant.toZonedDateTimeISO : (timeZone: Temporal.TimeZoneLike) => Temporal.ZonedDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>instant : Temporal.Instant +> : ^^^^^^^^^^^^^^^^ +>toZonedDateTimeISO : (timeZone: Temporal.TimeZoneLike) => Temporal.ZonedDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"Asia/Tokyo" : "Asia/Tokyo" +> : ^^^^^^^^^^^^ + + zdtTokyo.year; // => 2020 +>zdtTokyo.year : number +> : ^^^^^^ +>zdtTokyo : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>year : number +> : ^^^^^^ + + zdtTokyo.toPlainDate(); // => 2020-01-01 +>zdtTokyo.toPlainDate() : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>zdtTokyo.toPlainDate : () => Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^^^^^^^ +>zdtTokyo : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>toPlainDate : () => Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^^^^^^^ +} + +{ + // Convert from `Temporal.Instant` to `Date` (which uses millisecond precision) + const instant = Temporal.Instant.from("2020-01-01T00:00:00.123456789+05:30"); +>instant : Temporal.Instant +> : ^^^^^^^^^^^^^^^^ +>Temporal.Instant.from("2020-01-01T00:00:00.123456789+05:30") : Temporal.Instant +> : ^^^^^^^^^^^^^^^^ +>Temporal.Instant.from : (item: Temporal.InstantLike) => Temporal.Instant +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.Instant : Temporal.InstantConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>Instant : Temporal.InstantConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.InstantLike) => Temporal.Instant +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"2020-01-01T00:00:00.123456789+05:30" : "2020-01-01T00:00:00.123456789+05:30" +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + // => 2019-12-31T18:30:00.123456789Z + const date = new Date(instant.epochMilliseconds); +>date : Date +> : ^^^^ +>new Date(instant.epochMilliseconds) : Date +> : ^^^^ +>Date : DateConstructor +> : ^^^^^^^^^^^^^^^ +>instant.epochMilliseconds : number +> : ^^^^^^ +>instant : Temporal.Instant +> : ^^^^^^^^^^^^^^^^ +>epochMilliseconds : number +> : ^^^^^^ + + date.toISOString(); // => 2019-12-31T18:30:00.123Z +>date.toISOString() : string +> : ^^^^^^ +>date.toISOString : () => string +> : ^^^^^^ +>date : Date +> : ^^^^ +>toISOString : () => string +> : ^^^^^^ + + // Convert from `Date` to `Temporal.Instant` + const sameInstant = date.toTemporalInstant(); // => 2019-12-31T18:30:00.123Z +>sameInstant : Temporal.Instant +> : ^^^^^^^^^^^^^^^^ +>date.toTemporalInstant() : Temporal.Instant +> : ^^^^^^^^^^^^^^^^ +>date.toTemporalInstant : () => Temporal.Instant +> : ^^^^^^ +>date : Date +> : ^^^^ +>toTemporalInstant : () => Temporal.Instant +> : ^^^^^^ +} + +{ + const date = new Date(2019, 11, 31, 18, 30); // => Tue Dec 31 2019 18:30:00 GMT-0800 (Pacific Standard Time) +>date : Date +> : ^^^^ +>new Date(2019, 11, 31, 18, 30) : Date +> : ^^^^ +>Date : DateConstructor +> : ^^^^^^^^^^^^^^^ +>2019 : 2019 +> : ^^^^ +>11 : 11 +> : ^^ +>31 : 31 +> : ^^ +>18 : 18 +> : ^^ +>30 : 30 +> : ^^ + + const instant = date.toTemporalInstant(); // => 2020-01-01T02:30:00Z +>instant : Temporal.Instant +> : ^^^^^^^^^^^^^^^^ +>date.toTemporalInstant() : Temporal.Instant +> : ^^^^^^^^^^^^^^^^ +>date.toTemporalInstant : () => Temporal.Instant +> : ^^^^^^ +>date : Date +> : ^^^^ +>toTemporalInstant : () => Temporal.Instant +> : ^^^^^^ + + const zonedDateTime = instant.toZonedDateTimeISO(Temporal.Now.timeZoneId()); +>zonedDateTime : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>instant.toZonedDateTimeISO(Temporal.Now.timeZoneId()) : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>instant.toZonedDateTimeISO : (timeZone: Temporal.TimeZoneLike) => Temporal.ZonedDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>instant : Temporal.Instant +> : ^^^^^^^^^^^^^^^^ +>toZonedDateTimeISO : (timeZone: Temporal.TimeZoneLike) => Temporal.ZonedDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.Now.timeZoneId() : string +> : ^^^^^^ +>Temporal.Now.timeZoneId : () => string +> : ^^^^^^ +>Temporal.Now : typeof Temporal.Now +> : ^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>Now : typeof Temporal.Now +> : ^^^^^^^^^^^^^^^^^^^ +>timeZoneId : () => string +> : ^^^^^^ + + // => 2019-12-31T18:30:00-08:00[America/Los_Angeles] + zonedDateTime.day; // => 31 +>zonedDateTime.day : number +> : ^^^^^^ +>zonedDateTime : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>day : number +> : ^^^^^^ + + const dateOnly = zonedDateTime.toPlainDate(); // => 2019-12-31 +>dateOnly : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>zonedDateTime.toPlainDate() : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>zonedDateTime.toPlainDate : () => Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^^^^^^^ +>zonedDateTime : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>toPlainDate : () => Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^^^^^^^ +} + +{ + const instant = new Temporal.Instant(1553906700000000000n); +>instant : Temporal.Instant +> : ^^^^^^^^^^^^^^^^ +>new Temporal.Instant(1553906700000000000n) : Temporal.Instant +> : ^^^^^^^^^^^^^^^^ +>Temporal.Instant : Temporal.InstantConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>Instant : Temporal.InstantConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>1553906700000000000n : 1553906700000000000n +> : ^^^^^^^^^^^^^^^^^^^^ + + // When was the Unix epoch? + const epoch = new Temporal.Instant(0n); // => 1970-01-01T00:00:00Z +>epoch : Temporal.Instant +> : ^^^^^^^^^^^^^^^^ +>new Temporal.Instant(0n) : Temporal.Instant +> : ^^^^^^^^^^^^^^^^ +>Temporal.Instant : Temporal.InstantConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>Instant : Temporal.InstantConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>0n : 0n +> : ^^ + + // Dates before the Unix epoch are negative + const turnOfTheCentury = new Temporal.Instant(-2208988800000000000n); // => 1900-01-01T00:00:00Z +>turnOfTheCentury : Temporal.Instant +> : ^^^^^^^^^^^^^^^^ +>new Temporal.Instant(-2208988800000000000n) : Temporal.Instant +> : ^^^^^^^^^^^^^^^^ +>Temporal.Instant : Temporal.InstantConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>Instant : Temporal.InstantConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>-2208988800000000000n : -2208988800000000000n +> : ^^^^^^^^^^^^^^^^^^^^^ +>2208988800000000000n : 2208988800000000000n +> : ^^^^^^^^^^^^^^^^^^^^ +} + +{ + let instant: Temporal.Instant; +>instant : Temporal.Instant +> : ^^^^^^^^^^^^^^^^ +>Temporal : any +> : ^^^ + + instant = Temporal.Instant.from("2019-03-30T01:45:00+01:00[Europe/Berlin]"); +>instant = Temporal.Instant.from("2019-03-30T01:45:00+01:00[Europe/Berlin]") : Temporal.Instant +> : ^^^^^^^^^^^^^^^^ +>instant : Temporal.Instant +> : ^^^^^^^^^^^^^^^^ +>Temporal.Instant.from("2019-03-30T01:45:00+01:00[Europe/Berlin]") : Temporal.Instant +> : ^^^^^^^^^^^^^^^^ +>Temporal.Instant.from : (item: Temporal.InstantLike) => Temporal.Instant +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.Instant : Temporal.InstantConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>Instant : Temporal.InstantConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.InstantLike) => Temporal.Instant +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"2019-03-30T01:45:00+01:00[Europe/Berlin]" : "2019-03-30T01:45:00+01:00[Europe/Berlin]" +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + instant = Temporal.Instant.from("2019-03-30T01:45+01:00"); +>instant = Temporal.Instant.from("2019-03-30T01:45+01:00") : Temporal.Instant +> : ^^^^^^^^^^^^^^^^ +>instant : Temporal.Instant +> : ^^^^^^^^^^^^^^^^ +>Temporal.Instant.from("2019-03-30T01:45+01:00") : Temporal.Instant +> : ^^^^^^^^^^^^^^^^ +>Temporal.Instant.from : (item: Temporal.InstantLike) => Temporal.Instant +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.Instant : Temporal.InstantConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>Instant : Temporal.InstantConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.InstantLike) => Temporal.Instant +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"2019-03-30T01:45+01:00" : "2019-03-30T01:45+01:00" +> : ^^^^^^^^^^^^^^^^^^^^^^^^ + + instant = Temporal.Instant.from("2019-03-30T00:45Z"); +>instant = Temporal.Instant.from("2019-03-30T00:45Z") : Temporal.Instant +> : ^^^^^^^^^^^^^^^^ +>instant : Temporal.Instant +> : ^^^^^^^^^^^^^^^^ +>Temporal.Instant.from("2019-03-30T00:45Z") : Temporal.Instant +> : ^^^^^^^^^^^^^^^^ +>Temporal.Instant.from : (item: Temporal.InstantLike) => Temporal.Instant +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.Instant : Temporal.InstantConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>Instant : Temporal.InstantConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.InstantLike) => Temporal.Instant +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"2019-03-30T00:45Z" : "2019-03-30T00:45Z" +> : ^^^^^^^^^^^^^^^^^^^ + + instant === Temporal.Instant.from(instant); // => false +>instant === Temporal.Instant.from(instant) : boolean +> : ^^^^^^^ +>instant : Temporal.Instant +> : ^^^^^^^^^^^^^^^^ +>Temporal.Instant.from(instant) : Temporal.Instant +> : ^^^^^^^^^^^^^^^^ +>Temporal.Instant.from : (item: Temporal.InstantLike) => Temporal.Instant +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.Instant : Temporal.InstantConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>Instant : Temporal.InstantConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.InstantLike) => Temporal.Instant +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>instant : Temporal.Instant +> : ^^^^^^^^^^^^^^^^ +} + +{ + const legacyDate = new Date("1995-12-17T03:24Z"); +>legacyDate : Date +> : ^^^^ +>new Date("1995-12-17T03:24Z") : Date +> : ^^^^ +>Date : DateConstructor +> : ^^^^^^^^^^^^^^^ +>"1995-12-17T03:24Z" : "1995-12-17T03:24Z" +> : ^^^^^^^^^^^^^^^^^^^ + + let instant: Temporal.Instant; +>instant : Temporal.Instant +> : ^^^^^^^^^^^^^^^^ +>Temporal : any +> : ^^^ + + instant = Temporal.Instant.fromEpochMilliseconds(legacyDate.getTime()); // => 1995-12-17T03:24:00Z +>instant = Temporal.Instant.fromEpochMilliseconds(legacyDate.getTime()) : Temporal.Instant +> : ^^^^^^^^^^^^^^^^ +>instant : Temporal.Instant +> : ^^^^^^^^^^^^^^^^ +>Temporal.Instant.fromEpochMilliseconds(legacyDate.getTime()) : Temporal.Instant +> : ^^^^^^^^^^^^^^^^ +>Temporal.Instant.fromEpochMilliseconds : (epochMilliseconds: number) => Temporal.Instant +> : ^ ^^ ^^^^^^^^^^^^^^^^^^^^^ +>Temporal.Instant : Temporal.InstantConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>Instant : Temporal.InstantConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>fromEpochMilliseconds : (epochMilliseconds: number) => Temporal.Instant +> : ^ ^^ ^^^^^^^^^^^^^^^^^^^^^ +>legacyDate.getTime() : number +> : ^^^^^^ +>legacyDate.getTime : () => number +> : ^^^^^^ +>legacyDate : Date +> : ^^^^ +>getTime : () => number +> : ^^^^^^ + + instant = Temporal.Instant.fromEpochMilliseconds(legacyDate); // valueOf() called implicitly +>instant = Temporal.Instant.fromEpochMilliseconds(legacyDate) : Temporal.Instant +> : ^^^^^^^^^^^^^^^^ +>instant : Temporal.Instant +> : ^^^^^^^^^^^^^^^^ +>Temporal.Instant.fromEpochMilliseconds(legacyDate) : Temporal.Instant +> : ^^^^^^^^^^^^^^^^ +>Temporal.Instant.fromEpochMilliseconds : (epochMilliseconds: number) => Temporal.Instant +> : ^ ^^ ^^^^^^^^^^^^^^^^^^^^^ +>Temporal.Instant : Temporal.InstantConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>Instant : Temporal.InstantConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>fromEpochMilliseconds : (epochMilliseconds: number) => Temporal.Instant +> : ^ ^^ ^^^^^^^^^^^^^^^^^^^^^ +>legacyDate : Date +> : ^^^^ + + instant = legacyDate.toTemporalInstant(); // recommended +>instant = legacyDate.toTemporalInstant() : Temporal.Instant +> : ^^^^^^^^^^^^^^^^ +>instant : Temporal.Instant +> : ^^^^^^^^^^^^^^^^ +>legacyDate.toTemporalInstant() : Temporal.Instant +> : ^^^^^^^^^^^^^^^^ +>legacyDate.toTemporalInstant : () => Temporal.Instant +> : ^^^^^^ +>legacyDate : Date +> : ^^^^ +>toTemporalInstant : () => Temporal.Instant +> : ^^^^^^ +} + +{ + const one = Temporal.Instant.fromEpochMilliseconds(1.0e12); +>one : Temporal.Instant +> : ^^^^^^^^^^^^^^^^ +>Temporal.Instant.fromEpochMilliseconds(1.0e12) : Temporal.Instant +> : ^^^^^^^^^^^^^^^^ +>Temporal.Instant.fromEpochMilliseconds : (epochMilliseconds: number) => Temporal.Instant +> : ^ ^^ ^^^^^^^^^^^^^^^^^^^^^ +>Temporal.Instant : Temporal.InstantConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>Instant : Temporal.InstantConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>fromEpochMilliseconds : (epochMilliseconds: number) => Temporal.Instant +> : ^ ^^ ^^^^^^^^^^^^^^^^^^^^^ +>1.0e12 : 1000000000000 +> : ^^^^^^^^^^^^^ + + const two = Temporal.Instant.fromEpochMilliseconds(1.1e12); +>two : Temporal.Instant +> : ^^^^^^^^^^^^^^^^ +>Temporal.Instant.fromEpochMilliseconds(1.1e12) : Temporal.Instant +> : ^^^^^^^^^^^^^^^^ +>Temporal.Instant.fromEpochMilliseconds : (epochMilliseconds: number) => Temporal.Instant +> : ^ ^^ ^^^^^^^^^^^^^^^^^^^^^ +>Temporal.Instant : Temporal.InstantConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>Instant : Temporal.InstantConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>fromEpochMilliseconds : (epochMilliseconds: number) => Temporal.Instant +> : ^ ^^ ^^^^^^^^^^^^^^^^^^^^^ +>1.1e12 : 1100000000000 +> : ^^^^^^^^^^^^^ + + const three = Temporal.Instant.fromEpochMilliseconds(1.2e12); +>three : Temporal.Instant +> : ^^^^^^^^^^^^^^^^ +>Temporal.Instant.fromEpochMilliseconds(1.2e12) : Temporal.Instant +> : ^^^^^^^^^^^^^^^^ +>Temporal.Instant.fromEpochMilliseconds : (epochMilliseconds: number) => Temporal.Instant +> : ^ ^^ ^^^^^^^^^^^^^^^^^^^^^ +>Temporal.Instant : Temporal.InstantConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>Instant : Temporal.InstantConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>fromEpochMilliseconds : (epochMilliseconds: number) => Temporal.Instant +> : ^ ^^ ^^^^^^^^^^^^^^^^^^^^^ +>1.2e12 : 1200000000000 +> : ^^^^^^^^^^^^^ + + const sorted = [three, one, two].sort(Temporal.Instant.compare); +>sorted : Temporal.Instant[] +> : ^^^^^^^^^^^^^^^^^^ +>[three, one, two].sort(Temporal.Instant.compare) : Temporal.Instant[] +> : ^^^^^^^^^^^^^^^^^^ +>[three, one, two].sort : (compareFn?: ((a: Temporal.Instant, b: Temporal.Instant) => number) | undefined) => Temporal.Instant[] +> : ^ ^^^^^ ^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>[three, one, two] : Temporal.Instant[] +> : ^^^^^^^^^^^^^^^^^^ +>three : Temporal.Instant +> : ^^^^^^^^^^^^^^^^ +>one : Temporal.Instant +> : ^^^^^^^^^^^^^^^^ +>two : Temporal.Instant +> : ^^^^^^^^^^^^^^^^ +>sort : (compareFn?: ((a: Temporal.Instant, b: Temporal.Instant) => number) | undefined) => Temporal.Instant[] +> : ^ ^^^^^ ^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.Instant.compare : (one: Temporal.InstantLike, two: Temporal.InstantLike) => number +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.Instant : Temporal.InstantConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>Instant : Temporal.InstantConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>compare : (one: Temporal.InstantLike, two: Temporal.InstantLike) => number +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + sorted.join(" "); +>sorted.join(" ") : string +> : ^^^^^^ +>sorted.join : (separator?: string) => string +> : ^ ^^^ ^^^^^ +>sorted : Temporal.Instant[] +> : ^^^^^^^^^^^^^^^^^^ +>join : (separator?: string) => string +> : ^ ^^^ ^^^^^ +>" " : " " +> : ^^^ + + // => '2001-09-09T01:46:40Z 2004-11-09T11:33:20Z 2008-01-10T21:20:00Z' +} + +{ + const instant = Temporal.Instant.from("2019-03-30T00:45Z"); +>instant : Temporal.Instant +> : ^^^^^^^^^^^^^^^^ +>Temporal.Instant.from("2019-03-30T00:45Z") : Temporal.Instant +> : ^^^^^^^^^^^^^^^^ +>Temporal.Instant.from : (item: Temporal.InstantLike) => Temporal.Instant +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.Instant : Temporal.InstantConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>Instant : Temporal.InstantConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.InstantLike) => Temporal.Instant +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"2019-03-30T00:45Z" : "2019-03-30T00:45Z" +> : ^^^^^^^^^^^^^^^^^^^ + + new Date(instant.epochMilliseconds); // => 2019-03-30T00:45:00.000Z +>new Date(instant.epochMilliseconds) : Date +> : ^^^^ +>Date : DateConstructor +> : ^^^^^^^^^^^^^^^ +>instant.epochMilliseconds : number +> : ^^^^^^ +>instant : Temporal.Instant +> : ^^^^^^^^^^^^^^^^ +>epochMilliseconds : number +> : ^^^^^^ + + // If you need epoch seconds data: + const epochSecs = Math.floor(instant.epochMilliseconds / 1000); // => 1553906700 +>epochSecs : number +> : ^^^^^^ +>Math.floor(instant.epochMilliseconds / 1000) : number +> : ^^^^^^ +>Math.floor : (x: number) => number +> : ^ ^^ ^^^^^ +>Math : Math +> : ^^^^ +>floor : (x: number) => number +> : ^ ^^ ^^^^^ +>instant.epochMilliseconds / 1000 : number +> : ^^^^^^ +>instant.epochMilliseconds : number +> : ^^^^^^ +>instant : Temporal.Instant +> : ^^^^^^^^^^^^^^^^ +>epochMilliseconds : number +> : ^^^^^^ +>1000 : 1000 +> : ^^^^ + + const ns = instant.epochNanoseconds; +>ns : bigint +> : ^^^^^^ +>instant.epochNanoseconds : bigint +> : ^^^^^^ +>instant : Temporal.Instant +> : ^^^^^^^^^^^^^^^^ +>epochNanoseconds : bigint +> : ^^^^^^ + + const epochMicros = ns / 1000n + ((ns % 1000n) < 0n ? -1n : 0n); +>epochMicros : bigint +> : ^^^^^^ +>ns / 1000n + ((ns % 1000n) < 0n ? -1n : 0n) : bigint +> : ^^^^^^ +>ns / 1000n : bigint +> : ^^^^^^ +>ns : bigint +> : ^^^^^^ +>1000n : 1000n +> : ^^^^^ +>((ns % 1000n) < 0n ? -1n : 0n) : 0n | -1n +> : ^^^^^^^^ +>(ns % 1000n) < 0n ? -1n : 0n : 0n | -1n +> : ^^^^^^^^ +>(ns % 1000n) < 0n : boolean +> : ^^^^^^^ +>(ns % 1000n) : bigint +> : ^^^^^^ +>ns % 1000n : bigint +> : ^^^^^^ +>ns : bigint +> : ^^^^^^ +>1000n : 1000n +> : ^^^^^ +>0n : 0n +> : ^^ +>-1n : -1n +> : ^^^ +>1n : 1n +> : ^^ +>0n : 0n +> : ^^ +} + +{ + // Converting a specific exact time to a calendar date / wall-clock time + let timestamp: Temporal.Instant; +>timestamp : Temporal.Instant +> : ^^^^^^^^^^^^^^^^ +>Temporal : any +> : ^^^ + + timestamp = Temporal.Instant.fromEpochMilliseconds(1553993100_000); +>timestamp = Temporal.Instant.fromEpochMilliseconds(1553993100_000) : Temporal.Instant +> : ^^^^^^^^^^^^^^^^ +>timestamp : Temporal.Instant +> : ^^^^^^^^^^^^^^^^ +>Temporal.Instant.fromEpochMilliseconds(1553993100_000) : Temporal.Instant +> : ^^^^^^^^^^^^^^^^ +>Temporal.Instant.fromEpochMilliseconds : (epochMilliseconds: number) => Temporal.Instant +> : ^ ^^ ^^^^^^^^^^^^^^^^^^^^^ +>Temporal.Instant : Temporal.InstantConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>Instant : Temporal.InstantConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>fromEpochMilliseconds : (epochMilliseconds: number) => Temporal.Instant +> : ^ ^^ ^^^^^^^^^^^^^^^^^^^^^ +>1553993100_000 : 1553993100000 +> : ^^^^^^^^^^^^^ + + timestamp.toZonedDateTimeISO("Europe/Berlin"); // => 2019-03-31T01:45:00+01:00[Europe/Berlin] +>timestamp.toZonedDateTimeISO("Europe/Berlin") : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>timestamp.toZonedDateTimeISO : (timeZone: Temporal.TimeZoneLike) => Temporal.ZonedDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>timestamp : Temporal.Instant +> : ^^^^^^^^^^^^^^^^ +>toZonedDateTimeISO : (timeZone: Temporal.TimeZoneLike) => Temporal.ZonedDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"Europe/Berlin" : "Europe/Berlin" +> : ^^^^^^^^^^^^^^^ + + timestamp.toZonedDateTimeISO("UTC"); // => 2019-03-31T00:45:00+00:00[UTC] +>timestamp.toZonedDateTimeISO("UTC") : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>timestamp.toZonedDateTimeISO : (timeZone: Temporal.TimeZoneLike) => Temporal.ZonedDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>timestamp : Temporal.Instant +> : ^^^^^^^^^^^^^^^^ +>toZonedDateTimeISO : (timeZone: Temporal.TimeZoneLike) => Temporal.ZonedDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"UTC" : "UTC" +> : ^^^^^ + + timestamp.toZonedDateTimeISO("-08:00"); // => 2019-03-30T16:45:00-08:00[-08:00] +>timestamp.toZonedDateTimeISO("-08:00") : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>timestamp.toZonedDateTimeISO : (timeZone: Temporal.TimeZoneLike) => Temporal.ZonedDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>timestamp : Temporal.Instant +> : ^^^^^^^^^^^^^^^^ +>toZonedDateTimeISO : (timeZone: Temporal.TimeZoneLike) => Temporal.ZonedDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"-08:00" : "-08:00" +> : ^^^^^^^^ + + // What time was the Unix epoch (timestamp 0) in Bell Labs (Murray Hill, New Jersey, USA) in the Gregorian calendar? + const epoch = Temporal.Instant.fromEpochMilliseconds(0); +>epoch : Temporal.Instant +> : ^^^^^^^^^^^^^^^^ +>Temporal.Instant.fromEpochMilliseconds(0) : Temporal.Instant +> : ^^^^^^^^^^^^^^^^ +>Temporal.Instant.fromEpochMilliseconds : (epochMilliseconds: number) => Temporal.Instant +> : ^ ^^ ^^^^^^^^^^^^^^^^^^^^^ +>Temporal.Instant : Temporal.InstantConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>Instant : Temporal.InstantConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>fromEpochMilliseconds : (epochMilliseconds: number) => Temporal.Instant +> : ^ ^^ ^^^^^^^^^^^^^^^^^^^^^ +>0 : 0 +> : ^ + + epoch.toZonedDateTimeISO("America/New_York").withCalendar("gregory"); +>epoch.toZonedDateTimeISO("America/New_York").withCalendar("gregory") : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>epoch.toZonedDateTimeISO("America/New_York").withCalendar : (calendar: Temporal.CalendarLike) => Temporal.ZonedDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>epoch.toZonedDateTimeISO("America/New_York") : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>epoch.toZonedDateTimeISO : (timeZone: Temporal.TimeZoneLike) => Temporal.ZonedDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>epoch : Temporal.Instant +> : ^^^^^^^^^^^^^^^^ +>toZonedDateTimeISO : (timeZone: Temporal.TimeZoneLike) => Temporal.ZonedDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"America/New_York" : "America/New_York" +> : ^^^^^^^^^^^^^^^^^^ +>withCalendar : (calendar: Temporal.CalendarLike) => Temporal.ZonedDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"gregory" : "gregory" +> : ^^^^^^^^^ + + // => 1969-12-31T19:00:00-05:00[America/New_York][u-ca=gregory] + + // What time was the Unix epoch in Tokyo in the Japanese calendar? + const zdt = epoch.toZonedDateTimeISO("Asia/Tokyo").withCalendar("japanese"); +>zdt : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>epoch.toZonedDateTimeISO("Asia/Tokyo").withCalendar("japanese") : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>epoch.toZonedDateTimeISO("Asia/Tokyo").withCalendar : (calendar: Temporal.CalendarLike) => Temporal.ZonedDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>epoch.toZonedDateTimeISO("Asia/Tokyo") : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>epoch.toZonedDateTimeISO : (timeZone: Temporal.TimeZoneLike) => Temporal.ZonedDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>epoch : Temporal.Instant +> : ^^^^^^^^^^^^^^^^ +>toZonedDateTimeISO : (timeZone: Temporal.TimeZoneLike) => Temporal.ZonedDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"Asia/Tokyo" : "Asia/Tokyo" +> : ^^^^^^^^^^^^ +>withCalendar : (calendar: Temporal.CalendarLike) => Temporal.ZonedDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"japanese" : "japanese" +> : ^^^^^^^^^^ + + // => 1970-01-01T09:00:00+09:00[Asia/Tokyo][u-ca=japanese] + console.log(zdt.eraYear, zdt.era); +>console.log(zdt.eraYear, zdt.era) : void +> : ^^^^ +>console.log : (...data: any[]) => void +> : ^^^^ ^^ ^^^^^ +>console : Console +> : ^^^^^^^ +>log : (...data: any[]) => void +> : ^^^^ ^^ ^^^^^ +>zdt.eraYear : number | undefined +> : ^^^^^^^^^^^^^^^^^^ +>zdt : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>eraYear : number | undefined +> : ^^^^^^^^^^^^^^^^^^ +>zdt.era : string | undefined +> : ^^^^^^^^^^^^^^^^^^ +>zdt : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>era : string | undefined +> : ^^^^^^^^^^^^^^^^^^ + + // => '45 showa' +} + +{ + // Temporal.Instant representing five hours from now + Temporal.Now.instant().add({ hours: 5 }); +>Temporal.Now.instant().add({ hours: 5 }) : Temporal.Instant +> : ^^^^^^^^^^^^^^^^ +>Temporal.Now.instant().add : (duration: Temporal.DurationLike) => Temporal.Instant +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.Now.instant() : Temporal.Instant +> : ^^^^^^^^^^^^^^^^ +>Temporal.Now.instant : () => Temporal.Instant +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.Now : typeof Temporal.Now +> : ^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>Now : typeof Temporal.Now +> : ^^^^^^^^^^^^^^^^^^^ +>instant : () => Temporal.Instant +> : ^^^^^^^^^^^^^^^^^^^^^^ +>add : (duration: Temporal.DurationLike) => Temporal.Instant +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ hours: 5 } : { hours: number; } +> : ^^^^^^^^^^^^^^^^^^ +>hours : number +> : ^^^^^^ +>5 : 5 +> : ^ + + const fiveHours = Temporal.Duration.from({ hours: 5 }); +>fiveHours : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>Temporal.Duration.from({ hours: 5 }) : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>Temporal.Duration.from : (item: Temporal.DurationLike) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.Duration : Temporal.DurationConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>Duration : Temporal.DurationConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.DurationLike) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ hours: 5 } : { hours: number; } +> : ^^^^^^^^^^^^^^^^^^ +>hours : number +> : ^^^^^^ +>5 : 5 +> : ^ + + Temporal.Now.instant().add(fiveHours); +>Temporal.Now.instant().add(fiveHours) : Temporal.Instant +> : ^^^^^^^^^^^^^^^^ +>Temporal.Now.instant().add : (duration: Temporal.DurationLike) => Temporal.Instant +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.Now.instant() : Temporal.Instant +> : ^^^^^^^^^^^^^^^^ +>Temporal.Now.instant : () => Temporal.Instant +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.Now : typeof Temporal.Now +> : ^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>Now : typeof Temporal.Now +> : ^^^^^^^^^^^^^^^^^^^ +>instant : () => Temporal.Instant +> : ^^^^^^^^^^^^^^^^^^^^^^ +>add : (duration: Temporal.DurationLike) => Temporal.Instant +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>fiveHours : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +} + +{ + // Temporal.Instant representing this time an hour ago + Temporal.Now.instant().subtract({ hours: 1 }); +>Temporal.Now.instant().subtract({ hours: 1 }) : Temporal.Instant +> : ^^^^^^^^^^^^^^^^ +>Temporal.Now.instant().subtract : (duration: Temporal.DurationLike) => Temporal.Instant +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.Now.instant() : Temporal.Instant +> : ^^^^^^^^^^^^^^^^ +>Temporal.Now.instant : () => Temporal.Instant +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.Now : typeof Temporal.Now +> : ^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>Now : typeof Temporal.Now +> : ^^^^^^^^^^^^^^^^^^^ +>instant : () => Temporal.Instant +> : ^^^^^^^^^^^^^^^^^^^^^^ +>subtract : (duration: Temporal.DurationLike) => Temporal.Instant +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ hours: 1 } : { hours: number; } +> : ^^^^^^^^^^^^^^^^^^ +>hours : number +> : ^^^^^^ +>1 : 1 +> : ^ + + const oneHour = Temporal.Duration.from({ hours: 1 }); +>oneHour : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>Temporal.Duration.from({ hours: 1 }) : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>Temporal.Duration.from : (item: Temporal.DurationLike) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.Duration : Temporal.DurationConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>Duration : Temporal.DurationConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.DurationLike) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ hours: 1 } : { hours: number; } +> : ^^^^^^^^^^^^^^^^^^ +>hours : number +> : ^^^^^^ +>1 : 1 +> : ^ + + Temporal.Now.instant().subtract(oneHour); +>Temporal.Now.instant().subtract(oneHour) : Temporal.Instant +> : ^^^^^^^^^^^^^^^^ +>Temporal.Now.instant().subtract : (duration: Temporal.DurationLike) => Temporal.Instant +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.Now.instant() : Temporal.Instant +> : ^^^^^^^^^^^^^^^^ +>Temporal.Now.instant : () => Temporal.Instant +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.Now : typeof Temporal.Now +> : ^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>Now : typeof Temporal.Now +> : ^^^^^^^^^^^^^^^^^^^ +>instant : () => Temporal.Instant +> : ^^^^^^^^^^^^^^^^^^^^^^ +>subtract : (duration: Temporal.DurationLike) => Temporal.Instant +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>oneHour : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +} + +{ + const startOfMoonMission = Temporal.Instant.from("1969-07-16T13:32:00Z"); +>startOfMoonMission : Temporal.Instant +> : ^^^^^^^^^^^^^^^^ +>Temporal.Instant.from("1969-07-16T13:32:00Z") : Temporal.Instant +> : ^^^^^^^^^^^^^^^^ +>Temporal.Instant.from : (item: Temporal.InstantLike) => Temporal.Instant +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.Instant : Temporal.InstantConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>Instant : Temporal.InstantConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.InstantLike) => Temporal.Instant +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"1969-07-16T13:32:00Z" : "1969-07-16T13:32:00Z" +> : ^^^^^^^^^^^^^^^^^^^^^^ + + const endOfMoonMission = Temporal.Instant.from("1969-07-24T16:50:35Z"); +>endOfMoonMission : Temporal.Instant +> : ^^^^^^^^^^^^^^^^ +>Temporal.Instant.from("1969-07-24T16:50:35Z") : Temporal.Instant +> : ^^^^^^^^^^^^^^^^ +>Temporal.Instant.from : (item: Temporal.InstantLike) => Temporal.Instant +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.Instant : Temporal.InstantConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>Instant : Temporal.InstantConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.InstantLike) => Temporal.Instant +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"1969-07-24T16:50:35Z" : "1969-07-24T16:50:35Z" +> : ^^^^^^^^^^^^^^^^^^^^^^ + + const missionLength = startOfMoonMission.until(endOfMoonMission, { largestUnit: "hour" }); +>missionLength : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>startOfMoonMission.until(endOfMoonMission, { largestUnit: "hour" }) : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>startOfMoonMission.until : (other: Temporal.InstantLike, options?: Temporal.RoundingOptionsWithLargestUnit) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^ +>startOfMoonMission : Temporal.Instant +> : ^^^^^^^^^^^^^^^^ +>until : (other: Temporal.InstantLike, options?: Temporal.RoundingOptionsWithLargestUnit) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^ +>endOfMoonMission : Temporal.Instant +> : ^^^^^^^^^^^^^^^^ +>{ largestUnit: "hour" } : { largestUnit: "hour"; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^ +>largestUnit : "hour" +> : ^^^^^^ +>"hour" : "hour" +> : ^^^^^^ + + // => PT195H18M35S + missionLength.toLocaleString(); +>missionLength.toLocaleString() : string +> : ^^^^^^ +>missionLength.toLocaleString : (locales?: Intl.LocalesArgument, options?: Intl.DurationFormatOptions) => string +> : ^ ^^^ ^^ ^^^ ^^^^^ +>missionLength : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>toLocaleString : (locales?: Intl.LocalesArgument, options?: Intl.DurationFormatOptions) => string +> : ^ ^^^ ^^ ^^^ ^^^^^ + + // example output: '195 hours 18 minutes 35 seconds' + + // Rounding, for example if you don't care about the minutes and seconds + const approxMissionLength = startOfMoonMission.until(endOfMoonMission, { +>approxMissionLength : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>startOfMoonMission.until(endOfMoonMission, { largestUnit: "hour", smallestUnit: "hour", }) : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>startOfMoonMission.until : (other: Temporal.InstantLike, options?: Temporal.RoundingOptionsWithLargestUnit) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^ +>startOfMoonMission : Temporal.Instant +> : ^^^^^^^^^^^^^^^^ +>until : (other: Temporal.InstantLike, options?: Temporal.RoundingOptionsWithLargestUnit) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^ +>endOfMoonMission : Temporal.Instant +> : ^^^^^^^^^^^^^^^^ +>{ largestUnit: "hour", smallestUnit: "hour", } : { largestUnit: "hour"; smallestUnit: "hour"; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + largestUnit: "hour", +>largestUnit : "hour" +> : ^^^^^^ +>"hour" : "hour" +> : ^^^^^^ + + smallestUnit: "hour", +>smallestUnit : "hour" +> : ^^^^^^ +>"hour" : "hour" +> : ^^^^^^ + + }); + // => PT195H + + // A billion (10^9) seconds since the epoch in different units + const epoch = Temporal.Instant.fromEpochMilliseconds(0); +>epoch : Temporal.Instant +> : ^^^^^^^^^^^^^^^^ +>Temporal.Instant.fromEpochMilliseconds(0) : Temporal.Instant +> : ^^^^^^^^^^^^^^^^ +>Temporal.Instant.fromEpochMilliseconds : (epochMilliseconds: number) => Temporal.Instant +> : ^ ^^ ^^^^^^^^^^^^^^^^^^^^^ +>Temporal.Instant : Temporal.InstantConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>Instant : Temporal.InstantConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>fromEpochMilliseconds : (epochMilliseconds: number) => Temporal.Instant +> : ^ ^^ ^^^^^^^^^^^^^^^^^^^^^ +>0 : 0 +> : ^ + + const billion = Temporal.Instant.fromEpochMilliseconds(1e9); +>billion : Temporal.Instant +> : ^^^^^^^^^^^^^^^^ +>Temporal.Instant.fromEpochMilliseconds(1e9) : Temporal.Instant +> : ^^^^^^^^^^^^^^^^ +>Temporal.Instant.fromEpochMilliseconds : (epochMilliseconds: number) => Temporal.Instant +> : ^ ^^ ^^^^^^^^^^^^^^^^^^^^^ +>Temporal.Instant : Temporal.InstantConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>Instant : Temporal.InstantConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>fromEpochMilliseconds : (epochMilliseconds: number) => Temporal.Instant +> : ^ ^^ ^^^^^^^^^^^^^^^^^^^^^ +>1e9 : 1000000000 +> : ^^^^^^^^^^ + + epoch.until(billion); +>epoch.until(billion) : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>epoch.until : (other: Temporal.InstantLike, options?: Temporal.RoundingOptionsWithLargestUnit) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^ +>epoch : Temporal.Instant +> : ^^^^^^^^^^^^^^^^ +>until : (other: Temporal.InstantLike, options?: Temporal.RoundingOptionsWithLargestUnit) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^ +>billion : Temporal.Instant +> : ^^^^^^^^^^^^^^^^ + + // => PT1000000000S + epoch.until(billion, { largestUnit: "hour" }); +>epoch.until(billion, { largestUnit: "hour" }) : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>epoch.until : (other: Temporal.InstantLike, options?: Temporal.RoundingOptionsWithLargestUnit) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^ +>epoch : Temporal.Instant +> : ^^^^^^^^^^^^^^^^ +>until : (other: Temporal.InstantLike, options?: Temporal.RoundingOptionsWithLargestUnit) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^ +>billion : Temporal.Instant +> : ^^^^^^^^^^^^^^^^ +>{ largestUnit: "hour" } : { largestUnit: "hour"; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^ +>largestUnit : "hour" +> : ^^^^^^ +>"hour" : "hour" +> : ^^^^^^ + + // => PT277777H46M40S + const ns = epoch.until(billion, { largestUnit: "nanosecond" }); +>ns : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>epoch.until(billion, { largestUnit: "nanosecond" }) : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>epoch.until : (other: Temporal.InstantLike, options?: Temporal.RoundingOptionsWithLargestUnit) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^ +>epoch : Temporal.Instant +> : ^^^^^^^^^^^^^^^^ +>until : (other: Temporal.InstantLike, options?: Temporal.RoundingOptionsWithLargestUnit) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^ +>billion : Temporal.Instant +> : ^^^^^^^^^^^^^^^^ +>{ largestUnit: "nanosecond" } : { largestUnit: "nanosecond"; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>largestUnit : "nanosecond" +> : ^^^^^^^^^^^^ +>"nanosecond" : "nanosecond" +> : ^^^^^^^^^^^^ + + // => PT1000000000S + ns.add({ nanoseconds: 1 }); +>ns.add({ nanoseconds: 1 }) : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>ns.add : (other: Temporal.DurationLike) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>ns : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>add : (other: Temporal.DurationLike) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ nanoseconds: 1 } : { nanoseconds: number; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^ +>nanoseconds : number +> : ^^^^^^ +>1 : 1 +> : ^ + + // => PT1000000000S + // (lost precision) + + // Calculate the difference in years, eliminating the ambiguity by + // explicitly using the corresponding calendar date in UTC: + epoch.toZonedDateTimeISO("UTC").until( +>epoch.toZonedDateTimeISO("UTC").until( billion.toZonedDateTimeISO("UTC"), { largestUnit: "year" }, ) : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>epoch.toZonedDateTimeISO("UTC").until : (other: Temporal.ZonedDateTimeLike, options?: Temporal.RoundingOptionsWithLargestUnit) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^ +>epoch.toZonedDateTimeISO("UTC") : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>epoch.toZonedDateTimeISO : (timeZone: Temporal.TimeZoneLike) => Temporal.ZonedDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>epoch : Temporal.Instant +> : ^^^^^^^^^^^^^^^^ +>toZonedDateTimeISO : (timeZone: Temporal.TimeZoneLike) => Temporal.ZonedDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"UTC" : "UTC" +> : ^^^^^ +>until : (other: Temporal.ZonedDateTimeLike, options?: Temporal.RoundingOptionsWithLargestUnit) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^ + + billion.toZonedDateTimeISO("UTC"), +>billion.toZonedDateTimeISO("UTC") : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>billion.toZonedDateTimeISO : (timeZone: Temporal.TimeZoneLike) => Temporal.ZonedDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>billion : Temporal.Instant +> : ^^^^^^^^^^^^^^^^ +>toZonedDateTimeISO : (timeZone: Temporal.TimeZoneLike) => Temporal.ZonedDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"UTC" : "UTC" +> : ^^^^^ + + { largestUnit: "year" }, +>{ largestUnit: "year" } : { largestUnit: "year"; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^ +>largestUnit : "year" +> : ^^^^^^ +>"year" : "year" +> : ^^^^^^ + + ); + // => P31Y8M8DT1H46M40S +} + +{ + const instant = Temporal.Instant.from("2019-03-30T02:45:59.999999999Z"); +>instant : Temporal.Instant +> : ^^^^^^^^^^^^^^^^ +>Temporal.Instant.from("2019-03-30T02:45:59.999999999Z") : Temporal.Instant +> : ^^^^^^^^^^^^^^^^ +>Temporal.Instant.from : (item: Temporal.InstantLike) => Temporal.Instant +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.Instant : Temporal.InstantConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>Instant : Temporal.InstantConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.InstantLike) => Temporal.Instant +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"2019-03-30T02:45:59.999999999Z" : "2019-03-30T02:45:59.999999999Z" +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + // Round to a particular unit + instant.round({ smallestUnit: "second" }); // => 2019-03-30T02:46:00Z +>instant.round({ smallestUnit: "second" }) : Temporal.Instant +> : ^^^^^^^^^^^^^^^^ +>instant.round : { (roundTo: Temporal.TimeUnit): Temporal.Instant; (roundTo: Temporal.RoundingOptions): Temporal.Instant; } +> : ^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^ +>instant : Temporal.Instant +> : ^^^^^^^^^^^^^^^^ +>round : { (roundTo: Temporal.TimeUnit): Temporal.Instant; (roundTo: Temporal.RoundingOptions): Temporal.Instant; } +> : ^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^ +>{ smallestUnit: "second" } : { smallestUnit: "second"; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>smallestUnit : "second" +> : ^^^^^^^^ +>"second" : "second" +> : ^^^^^^^^ + + // Round to an increment of a unit, e.g. an hour: + instant.round({ roundingIncrement: 60, smallestUnit: "minute" }); +>instant.round({ roundingIncrement: 60, smallestUnit: "minute" }) : Temporal.Instant +> : ^^^^^^^^^^^^^^^^ +>instant.round : { (roundTo: Temporal.TimeUnit): Temporal.Instant; (roundTo: Temporal.RoundingOptions): Temporal.Instant; } +> : ^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^ +>instant : Temporal.Instant +> : ^^^^^^^^^^^^^^^^ +>round : { (roundTo: Temporal.TimeUnit): Temporal.Instant; (roundTo: Temporal.RoundingOptions): Temporal.Instant; } +> : ^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^ +>{ roundingIncrement: 60, smallestUnit: "minute" } : { roundingIncrement: number; smallestUnit: "minute"; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>roundingIncrement : number +> : ^^^^^^ +>60 : 60 +> : ^^ +>smallestUnit : "minute" +> : ^^^^^^^^ +>"minute" : "minute" +> : ^^^^^^^^ + + // => 2019-03-30T03:00:00Z + // Round to the same increment but round down instead: + instant.round({ roundingIncrement: 60, smallestUnit: "minute", roundingMode: "floor" }); +>instant.round({ roundingIncrement: 60, smallestUnit: "minute", roundingMode: "floor" }) : Temporal.Instant +> : ^^^^^^^^^^^^^^^^ +>instant.round : { (roundTo: Temporal.TimeUnit): Temporal.Instant; (roundTo: Temporal.RoundingOptions): Temporal.Instant; } +> : ^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^ +>instant : Temporal.Instant +> : ^^^^^^^^^^^^^^^^ +>round : { (roundTo: Temporal.TimeUnit): Temporal.Instant; (roundTo: Temporal.RoundingOptions): Temporal.Instant; } +> : ^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^ +>{ roundingIncrement: 60, smallestUnit: "minute", roundingMode: "floor" } : { roundingIncrement: number; smallestUnit: "minute"; roundingMode: "floor"; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>roundingIncrement : number +> : ^^^^^^ +>60 : 60 +> : ^^ +>smallestUnit : "minute" +> : ^^^^^^^^ +>"minute" : "minute" +> : ^^^^^^^^ +>roundingMode : "floor" +> : ^^^^^^^ +>"floor" : "floor" +> : ^^^^^^^ + + // => 2019-03-30T02:00:00Z +} + +{ + const one = Temporal.Instant.fromEpochMilliseconds(1.0e12); +>one : Temporal.Instant +> : ^^^^^^^^^^^^^^^^ +>Temporal.Instant.fromEpochMilliseconds(1.0e12) : Temporal.Instant +> : ^^^^^^^^^^^^^^^^ +>Temporal.Instant.fromEpochMilliseconds : (epochMilliseconds: number) => Temporal.Instant +> : ^ ^^ ^^^^^^^^^^^^^^^^^^^^^ +>Temporal.Instant : Temporal.InstantConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>Instant : Temporal.InstantConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>fromEpochMilliseconds : (epochMilliseconds: number) => Temporal.Instant +> : ^ ^^ ^^^^^^^^^^^^^^^^^^^^^ +>1.0e12 : 1000000000000 +> : ^^^^^^^^^^^^^ + + const two = Temporal.Instant.fromEpochMilliseconds(1.1e12); +>two : Temporal.Instant +> : ^^^^^^^^^^^^^^^^ +>Temporal.Instant.fromEpochMilliseconds(1.1e12) : Temporal.Instant +> : ^^^^^^^^^^^^^^^^ +>Temporal.Instant.fromEpochMilliseconds : (epochMilliseconds: number) => Temporal.Instant +> : ^ ^^ ^^^^^^^^^^^^^^^^^^^^^ +>Temporal.Instant : Temporal.InstantConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>Instant : Temporal.InstantConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>fromEpochMilliseconds : (epochMilliseconds: number) => Temporal.Instant +> : ^ ^^ ^^^^^^^^^^^^^^^^^^^^^ +>1.1e12 : 1100000000000 +> : ^^^^^^^^^^^^^ + + one.equals(two); // => false +>one.equals(two) : boolean +> : ^^^^^^^ +>one.equals : (other: Temporal.InstantLike) => boolean +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>one : Temporal.Instant +> : ^^^^^^^^^^^^^^^^ +>equals : (other: Temporal.InstantLike) => boolean +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>two : Temporal.Instant +> : ^^^^^^^^^^^^^^^^ + + one.equals(one); // => true +>one.equals(one) : boolean +> : ^^^^^^^ +>one.equals : (other: Temporal.InstantLike) => boolean +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>one : Temporal.Instant +> : ^^^^^^^^^^^^^^^^ +>equals : (other: Temporal.InstantLike) => boolean +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>one : Temporal.Instant +> : ^^^^^^^^^^^^^^^^ +} + +{ + const instant = Temporal.Instant.fromEpochMilliseconds(1574074321816); +>instant : Temporal.Instant +> : ^^^^^^^^^^^^^^^^ +>Temporal.Instant.fromEpochMilliseconds(1574074321816) : Temporal.Instant +> : ^^^^^^^^^^^^^^^^ +>Temporal.Instant.fromEpochMilliseconds : (epochMilliseconds: number) => Temporal.Instant +> : ^ ^^ ^^^^^^^^^^^^^^^^^^^^^ +>Temporal.Instant : Temporal.InstantConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>Instant : Temporal.InstantConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>fromEpochMilliseconds : (epochMilliseconds: number) => Temporal.Instant +> : ^ ^^ ^^^^^^^^^^^^^^^^^^^^^ +>1574074321816 : 1574074321816 +> : ^^^^^^^^^^^^^ + + instant.toString(); // => '2019-11-18T10:52:01.816Z' +>instant.toString() : string +> : ^^^^^^ +>instant.toString : (options?: Temporal.InstantToStringOptions) => string +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>instant : Temporal.Instant +> : ^^^^^^^^^^^^^^^^ +>toString : (options?: Temporal.InstantToStringOptions) => string +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + instant.toString({ timeZone: "UTC" }); +>instant.toString({ timeZone: "UTC" }) : string +> : ^^^^^^ +>instant.toString : (options?: Temporal.InstantToStringOptions) => string +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>instant : Temporal.Instant +> : ^^^^^^^^^^^^^^^^ +>toString : (options?: Temporal.InstantToStringOptions) => string +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ timeZone: "UTC" } : { timeZone: string; } +> : ^^^^^^^^^^^^^^^^^^^^^ +>timeZone : string +> : ^^^^^^ +>"UTC" : "UTC" +> : ^^^^^ + + // => '2019-11-18T10:52:01.816+00:00' + instant.toString({ timeZone: "Asia/Seoul" }); +>instant.toString({ timeZone: "Asia/Seoul" }) : string +> : ^^^^^^ +>instant.toString : (options?: Temporal.InstantToStringOptions) => string +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>instant : Temporal.Instant +> : ^^^^^^^^^^^^^^^^ +>toString : (options?: Temporal.InstantToStringOptions) => string +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ timeZone: "Asia/Seoul" } : { timeZone: string; } +> : ^^^^^^^^^^^^^^^^^^^^^ +>timeZone : string +> : ^^^^^^ +>"Asia/Seoul" : "Asia/Seoul" +> : ^^^^^^^^^^^^ + + // => '2019-11-18T19:52:01.816+09:00' + + instant.toString({ smallestUnit: "minute" }); +>instant.toString({ smallestUnit: "minute" }) : string +> : ^^^^^^ +>instant.toString : (options?: Temporal.InstantToStringOptions) => string +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>instant : Temporal.Instant +> : ^^^^^^^^^^^^^^^^ +>toString : (options?: Temporal.InstantToStringOptions) => string +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ smallestUnit: "minute" } : { smallestUnit: "minute"; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>smallestUnit : "minute" +> : ^^^^^^^^ +>"minute" : "minute" +> : ^^^^^^^^ + + // => '2019-11-18T10:52Z' + instant.toString({ fractionalSecondDigits: 0 }); +>instant.toString({ fractionalSecondDigits: 0 }) : string +> : ^^^^^^ +>instant.toString : (options?: Temporal.InstantToStringOptions) => string +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>instant : Temporal.Instant +> : ^^^^^^^^^^^^^^^^ +>toString : (options?: Temporal.InstantToStringOptions) => string +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ fractionalSecondDigits: 0 } : { fractionalSecondDigits: 0; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>fractionalSecondDigits : 0 +> : ^ +>0 : 0 +> : ^ + + // => '2019-11-18T10:52:01Z' + instant.toString({ fractionalSecondDigits: 4 }); +>instant.toString({ fractionalSecondDigits: 4 }) : string +> : ^^^^^^ +>instant.toString : (options?: Temporal.InstantToStringOptions) => string +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>instant : Temporal.Instant +> : ^^^^^^^^^^^^^^^^ +>toString : (options?: Temporal.InstantToStringOptions) => string +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ fractionalSecondDigits: 4 } : { fractionalSecondDigits: 4; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>fractionalSecondDigits : 4 +> : ^ +>4 : 4 +> : ^ + + // => '2019-11-18T10:52:01.8160Z' + instant.toString({ smallestUnit: "second", roundingMode: "halfExpand" }); +>instant.toString({ smallestUnit: "second", roundingMode: "halfExpand" }) : string +> : ^^^^^^ +>instant.toString : (options?: Temporal.InstantToStringOptions) => string +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>instant : Temporal.Instant +> : ^^^^^^^^^^^^^^^^ +>toString : (options?: Temporal.InstantToStringOptions) => string +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ smallestUnit: "second", roundingMode: "halfExpand" } : { smallestUnit: "second"; roundingMode: "halfExpand"; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>smallestUnit : "second" +> : ^^^^^^^^ +>"second" : "second" +> : ^^^^^^^^ +>roundingMode : "halfExpand" +> : ^^^^^^^^^^^^ +>"halfExpand" : "halfExpand" +> : ^^^^^^^^^^^^ + + // => '2019-11-18T10:52:02Z' +} + +{ + const instant = Temporal.Instant.from("2019-11-18T11:00:00.000Z"); +>instant : Temporal.Instant +> : ^^^^^^^^^^^^^^^^ +>Temporal.Instant.from("2019-11-18T11:00:00.000Z") : Temporal.Instant +> : ^^^^^^^^^^^^^^^^ +>Temporal.Instant.from : (item: Temporal.InstantLike) => Temporal.Instant +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.Instant : Temporal.InstantConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>Instant : Temporal.InstantConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.InstantLike) => Temporal.Instant +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"2019-11-18T11:00:00.000Z" : "2019-11-18T11:00:00.000Z" +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^ + + instant.toLocaleString(); // example output: '2019-11-18, 3:00:00 a.m.' +>instant.toLocaleString() : string +> : ^^^^^^ +>instant.toLocaleString : (locales?: Intl.LocalesArgument, options?: Intl.DateTimeFormatOptions) => string +> : ^ ^^^ ^^ ^^^ ^^^^^ +>instant : Temporal.Instant +> : ^^^^^^^^^^^^^^^^ +>toLocaleString : (locales?: Intl.LocalesArgument, options?: Intl.DateTimeFormatOptions) => string +> : ^ ^^^ ^^ ^^^ ^^^^^ + + instant.toLocaleString("de-DE"); // example output: '18.11.2019, 03:00:00' +>instant.toLocaleString("de-DE") : string +> : ^^^^^^ +>instant.toLocaleString : (locales?: Intl.LocalesArgument, options?: Intl.DateTimeFormatOptions) => string +> : ^ ^^^ ^^ ^^^ ^^^^^ +>instant : Temporal.Instant +> : ^^^^^^^^^^^^^^^^ +>toLocaleString : (locales?: Intl.LocalesArgument, options?: Intl.DateTimeFormatOptions) => string +> : ^ ^^^ ^^ ^^^ ^^^^^ +>"de-DE" : "de-DE" +> : ^^^^^^^ + + instant.toLocaleString("de-DE", { +>instant.toLocaleString("de-DE", { timeZone: "Europe/Berlin", year: "numeric", month: "numeric", day: "numeric", hour: "numeric", minute: "numeric", timeZoneName: "long", }) : string +> : ^^^^^^ +>instant.toLocaleString : (locales?: Intl.LocalesArgument, options?: Intl.DateTimeFormatOptions) => string +> : ^ ^^^ ^^ ^^^ ^^^^^ +>instant : Temporal.Instant +> : ^^^^^^^^^^^^^^^^ +>toLocaleString : (locales?: Intl.LocalesArgument, options?: Intl.DateTimeFormatOptions) => string +> : ^ ^^^ ^^ ^^^ ^^^^^ +>"de-DE" : "de-DE" +> : ^^^^^^^ +>{ timeZone: "Europe/Berlin", year: "numeric", month: "numeric", day: "numeric", hour: "numeric", minute: "numeric", timeZoneName: "long", } : { timeZone: string; year: "numeric"; month: "numeric"; day: "numeric"; hour: "numeric"; minute: "numeric"; timeZoneName: "long"; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + timeZone: "Europe/Berlin", +>timeZone : string +> : ^^^^^^ +>"Europe/Berlin" : "Europe/Berlin" +> : ^^^^^^^^^^^^^^^ + + year: "numeric", +>year : "numeric" +> : ^^^^^^^^^ +>"numeric" : "numeric" +> : ^^^^^^^^^ + + month: "numeric", +>month : "numeric" +> : ^^^^^^^^^ +>"numeric" : "numeric" +> : ^^^^^^^^^ + + day: "numeric", +>day : "numeric" +> : ^^^^^^^^^ +>"numeric" : "numeric" +> : ^^^^^^^^^ + + hour: "numeric", +>hour : "numeric" +> : ^^^^^^^^^ +>"numeric" : "numeric" +> : ^^^^^^^^^ + + minute: "numeric", +>minute : "numeric" +> : ^^^^^^^^^ +>"numeric" : "numeric" +> : ^^^^^^^^^ + + timeZoneName: "long", +>timeZoneName : "long" +> : ^^^^^^ +>"long" : "long" +> : ^^^^^^ + + }); // => '18.11.2019, 12:00 Mitteleuropäische Normalzeit' + instant.toLocaleString("en-US-u-nu-fullwide-hc-h12", { +>instant.toLocaleString("en-US-u-nu-fullwide-hc-h12", { timeZone: "Asia/Kolkata", }) : string +> : ^^^^^^ +>instant.toLocaleString : (locales?: Intl.LocalesArgument, options?: Intl.DateTimeFormatOptions) => string +> : ^ ^^^ ^^ ^^^ ^^^^^ +>instant : Temporal.Instant +> : ^^^^^^^^^^^^^^^^ +>toLocaleString : (locales?: Intl.LocalesArgument, options?: Intl.DateTimeFormatOptions) => string +> : ^ ^^^ ^^ ^^^ ^^^^^ +>"en-US-u-nu-fullwide-hc-h12" : "en-US-u-nu-fullwide-hc-h12" +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ timeZone: "Asia/Kolkata", } : { timeZone: string; } +> : ^^^^^^^^^^^^^^^^^^^^^ + + timeZone: "Asia/Kolkata", +>timeZone : string +> : ^^^^^^ +>"Asia/Kolkata" : "Asia/Kolkata" +> : ^^^^^^^^^^^^^^ + + }); // => '11/18/2019, 4:30:00 PM' +} + +{ + // UNIX epoch in California + new Temporal.ZonedDateTime(0n, "America/Los_Angeles", "iso8601"); +>new Temporal.ZonedDateTime(0n, "America/Los_Angeles", "iso8601") : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.ZonedDateTime : Temporal.ZonedDateTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>ZonedDateTime : Temporal.ZonedDateTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>0n : 0n +> : ^^ +>"America/Los_Angeles" : "America/Los_Angeles" +> : ^^^^^^^^^^^^^^^^^^^^^ +>"iso8601" : "iso8601" +> : ^^^^^^^^^ + + // => 1969-12-31T16:00:00-08:00[America/Los_Angeles] + new Temporal.ZonedDateTime(0n, "America/Los_Angeles"); +>new Temporal.ZonedDateTime(0n, "America/Los_Angeles") : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.ZonedDateTime : Temporal.ZonedDateTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>ZonedDateTime : Temporal.ZonedDateTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>0n : 0n +> : ^^ +>"America/Los_Angeles" : "America/Los_Angeles" +> : ^^^^^^^^^^^^^^^^^^^^^ + + // => 1969-12-31T16:00:00-08:00[America/Los_Angeles] + // same, but shorter +} + +{ + let zdt: Temporal.ZonedDateTime; +>zdt : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : any +> : ^^^ + + zdt = Temporal.ZonedDateTime.from("1995-12-07T03:24:30+02:00[Africa/Cairo]"); +>zdt = Temporal.ZonedDateTime.from("1995-12-07T03:24:30+02:00[Africa/Cairo]") : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>zdt : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.ZonedDateTime.from("1995-12-07T03:24:30+02:00[Africa/Cairo]") : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.ZonedDateTime.from : (item: Temporal.ZonedDateTimeLike, options?: Temporal.ZonedDateTimeFromOptions) => Temporal.ZonedDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.ZonedDateTime : Temporal.ZonedDateTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>ZonedDateTime : Temporal.ZonedDateTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.ZonedDateTimeLike, options?: Temporal.ZonedDateTimeFromOptions) => Temporal.ZonedDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"1995-12-07T03:24:30+02:00[Africa/Cairo]" : "1995-12-07T03:24:30+02:00[Africa/Cairo]" +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + zdt = Temporal.ZonedDateTime.from("1995-12-07T03:24:30+02:00[Africa/Cairo][u-ca=islamic]"); +>zdt = Temporal.ZonedDateTime.from("1995-12-07T03:24:30+02:00[Africa/Cairo][u-ca=islamic]") : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>zdt : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.ZonedDateTime.from("1995-12-07T03:24:30+02:00[Africa/Cairo][u-ca=islamic]") : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.ZonedDateTime.from : (item: Temporal.ZonedDateTimeLike, options?: Temporal.ZonedDateTimeFromOptions) => Temporal.ZonedDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.ZonedDateTime : Temporal.ZonedDateTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>ZonedDateTime : Temporal.ZonedDateTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.ZonedDateTimeLike, options?: Temporal.ZonedDateTimeFromOptions) => Temporal.ZonedDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"1995-12-07T03:24:30+02:00[Africa/Cairo][u-ca=islamic]" : "1995-12-07T03:24:30+02:00[Africa/Cairo][u-ca=islamic]" +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + zdt = Temporal.ZonedDateTime.from("19951207T032430+0200[Africa/Cairo]"); +>zdt = Temporal.ZonedDateTime.from("19951207T032430+0200[Africa/Cairo]") : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>zdt : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.ZonedDateTime.from("19951207T032430+0200[Africa/Cairo]") : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.ZonedDateTime.from : (item: Temporal.ZonedDateTimeLike, options?: Temporal.ZonedDateTimeFromOptions) => Temporal.ZonedDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.ZonedDateTime : Temporal.ZonedDateTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>ZonedDateTime : Temporal.ZonedDateTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.ZonedDateTimeLike, options?: Temporal.ZonedDateTimeFromOptions) => Temporal.ZonedDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"19951207T032430+0200[Africa/Cairo]" : "19951207T032430+0200[Africa/Cairo]" +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + zdt = Temporal.ZonedDateTime.from({ +>zdt = Temporal.ZonedDateTime.from({ timeZone: "America/Los_Angeles", year: 1995, month: 12, day: 7, hour: 3, minute: 24, second: 30, millisecond: 0, microsecond: 3, nanosecond: 500, }) : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>zdt : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.ZonedDateTime.from({ timeZone: "America/Los_Angeles", year: 1995, month: 12, day: 7, hour: 3, minute: 24, second: 30, millisecond: 0, microsecond: 3, nanosecond: 500, }) : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.ZonedDateTime.from : (item: Temporal.ZonedDateTimeLike, options?: Temporal.ZonedDateTimeFromOptions) => Temporal.ZonedDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.ZonedDateTime : Temporal.ZonedDateTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>ZonedDateTime : Temporal.ZonedDateTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.ZonedDateTimeLike, options?: Temporal.ZonedDateTimeFromOptions) => Temporal.ZonedDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ timeZone: "America/Los_Angeles", year: 1995, month: 12, day: 7, hour: 3, minute: 24, second: 30, millisecond: 0, microsecond: 3, nanosecond: 500, } : { timeZone: string; year: number; month: number; day: number; hour: number; minute: number; second: number; millisecond: number; microsecond: number; nanosecond: number; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + timeZone: "America/Los_Angeles", +>timeZone : string +> : ^^^^^^ +>"America/Los_Angeles" : "America/Los_Angeles" +> : ^^^^^^^^^^^^^^^^^^^^^ + + year: 1995, +>year : number +> : ^^^^^^ +>1995 : 1995 +> : ^^^^ + + month: 12, +>month : number +> : ^^^^^^ +>12 : 12 +> : ^^ + + day: 7, +>day : number +> : ^^^^^^ +>7 : 7 +> : ^ + + hour: 3, +>hour : number +> : ^^^^^^ +>3 : 3 +> : ^ + + minute: 24, +>minute : number +> : ^^^^^^ +>24 : 24 +> : ^^ + + second: 30, +>second : number +> : ^^^^^^ +>30 : 30 +> : ^^ + + millisecond: 0, +>millisecond : number +> : ^^^^^^ +>0 : 0 +> : ^ + + microsecond: 3, +>microsecond : number +> : ^^^^^^ +>3 : 3 +> : ^ + + nanosecond: 500, +>nanosecond : number +> : ^^^^^^ +>500 : 500 +> : ^^^ + + }); // => 1995-12-07T03:24:30.0000035-08:00[America/Los_Angeles] + + // Different overflow modes + zdt = Temporal.ZonedDateTime.from({ timeZone: "Europe/Paris", year: 2001, month: 13, day: 1 }, { overflow: "constrain" }); +>zdt = Temporal.ZonedDateTime.from({ timeZone: "Europe/Paris", year: 2001, month: 13, day: 1 }, { overflow: "constrain" }) : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>zdt : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.ZonedDateTime.from({ timeZone: "Europe/Paris", year: 2001, month: 13, day: 1 }, { overflow: "constrain" }) : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.ZonedDateTime.from : (item: Temporal.ZonedDateTimeLike, options?: Temporal.ZonedDateTimeFromOptions) => Temporal.ZonedDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.ZonedDateTime : Temporal.ZonedDateTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>ZonedDateTime : Temporal.ZonedDateTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.ZonedDateTimeLike, options?: Temporal.ZonedDateTimeFromOptions) => Temporal.ZonedDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ timeZone: "Europe/Paris", year: 2001, month: 13, day: 1 } : { timeZone: string; year: number; month: number; day: number; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>timeZone : string +> : ^^^^^^ +>"Europe/Paris" : "Europe/Paris" +> : ^^^^^^^^^^^^^^ +>year : number +> : ^^^^^^ +>2001 : 2001 +> : ^^^^ +>month : number +> : ^^^^^^ +>13 : 13 +> : ^^ +>day : number +> : ^^^^^^ +>1 : 1 +> : ^ +>{ overflow: "constrain" } : { overflow: "constrain"; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^ +>overflow : "constrain" +> : ^^^^^^^^^^^ +>"constrain" : "constrain" +> : ^^^^^^^^^^^ + + // => 2001-12-01T00:00:00+01:00[Europe/Paris] + zdt = Temporal.ZonedDateTime.from({ timeZone: "Europe/Paris", year: 2001, month: 13, day: 1 }, { overflow: "reject" }); +>zdt = Temporal.ZonedDateTime.from({ timeZone: "Europe/Paris", year: 2001, month: 13, day: 1 }, { overflow: "reject" }) : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>zdt : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.ZonedDateTime.from({ timeZone: "Europe/Paris", year: 2001, month: 13, day: 1 }, { overflow: "reject" }) : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.ZonedDateTime.from : (item: Temporal.ZonedDateTimeLike, options?: Temporal.ZonedDateTimeFromOptions) => Temporal.ZonedDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.ZonedDateTime : Temporal.ZonedDateTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>ZonedDateTime : Temporal.ZonedDateTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.ZonedDateTimeLike, options?: Temporal.ZonedDateTimeFromOptions) => Temporal.ZonedDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ timeZone: "Europe/Paris", year: 2001, month: 13, day: 1 } : { timeZone: string; year: number; month: number; day: number; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>timeZone : string +> : ^^^^^^ +>"Europe/Paris" : "Europe/Paris" +> : ^^^^^^^^^^^^^^ +>year : number +> : ^^^^^^ +>2001 : 2001 +> : ^^^^ +>month : number +> : ^^^^^^ +>13 : 13 +> : ^^ +>day : number +> : ^^^^^^ +>1 : 1 +> : ^ +>{ overflow: "reject" } : { overflow: "reject"; } +> : ^^^^^^^^^^^^^^^^^^^^^^^ +>overflow : "reject" +> : ^^^^^^^^ +>"reject" : "reject" +> : ^^^^^^^^ + + // => throws RangeError +} + +{ + const arr = [ +>arr : Temporal.ZonedDateTime[] +> : ^^^^^^^^^^^^^^^^^^^^^^^^ +>[ Temporal.ZonedDateTime.from("2020-02-01T12:30-05:00[America/Toronto]"), Temporal.ZonedDateTime.from("2020-02-01T12:30-05:00[America/New_York]"), Temporal.ZonedDateTime.from("2020-02-01T12:30+01:00[Europe/Brussels]"), Temporal.ZonedDateTime.from("2020-02-01T12:30+00:00[Europe/London]"), ] : Temporal.ZonedDateTime[] +> : ^^^^^^^^^^^^^^^^^^^^^^^^ + + Temporal.ZonedDateTime.from("2020-02-01T12:30-05:00[America/Toronto]"), +>Temporal.ZonedDateTime.from("2020-02-01T12:30-05:00[America/Toronto]") : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.ZonedDateTime.from : (item: Temporal.ZonedDateTimeLike, options?: Temporal.ZonedDateTimeFromOptions) => Temporal.ZonedDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.ZonedDateTime : Temporal.ZonedDateTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>ZonedDateTime : Temporal.ZonedDateTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.ZonedDateTimeLike, options?: Temporal.ZonedDateTimeFromOptions) => Temporal.ZonedDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"2020-02-01T12:30-05:00[America/Toronto]" : "2020-02-01T12:30-05:00[America/Toronto]" +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + Temporal.ZonedDateTime.from("2020-02-01T12:30-05:00[America/New_York]"), +>Temporal.ZonedDateTime.from("2020-02-01T12:30-05:00[America/New_York]") : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.ZonedDateTime.from : (item: Temporal.ZonedDateTimeLike, options?: Temporal.ZonedDateTimeFromOptions) => Temporal.ZonedDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.ZonedDateTime : Temporal.ZonedDateTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>ZonedDateTime : Temporal.ZonedDateTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.ZonedDateTimeLike, options?: Temporal.ZonedDateTimeFromOptions) => Temporal.ZonedDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"2020-02-01T12:30-05:00[America/New_York]" : "2020-02-01T12:30-05:00[America/New_York]" +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + Temporal.ZonedDateTime.from("2020-02-01T12:30+01:00[Europe/Brussels]"), +>Temporal.ZonedDateTime.from("2020-02-01T12:30+01:00[Europe/Brussels]") : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.ZonedDateTime.from : (item: Temporal.ZonedDateTimeLike, options?: Temporal.ZonedDateTimeFromOptions) => Temporal.ZonedDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.ZonedDateTime : Temporal.ZonedDateTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>ZonedDateTime : Temporal.ZonedDateTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.ZonedDateTimeLike, options?: Temporal.ZonedDateTimeFromOptions) => Temporal.ZonedDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"2020-02-01T12:30+01:00[Europe/Brussels]" : "2020-02-01T12:30+01:00[Europe/Brussels]" +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + Temporal.ZonedDateTime.from("2020-02-01T12:30+00:00[Europe/London]"), +>Temporal.ZonedDateTime.from("2020-02-01T12:30+00:00[Europe/London]") : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.ZonedDateTime.from : (item: Temporal.ZonedDateTimeLike, options?: Temporal.ZonedDateTimeFromOptions) => Temporal.ZonedDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.ZonedDateTime : Temporal.ZonedDateTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>ZonedDateTime : Temporal.ZonedDateTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.ZonedDateTimeLike, options?: Temporal.ZonedDateTimeFromOptions) => Temporal.ZonedDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"2020-02-01T12:30+00:00[Europe/London]" : "2020-02-01T12:30+00:00[Europe/London]" +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + ]; + const sorted = arr.sort(Temporal.ZonedDateTime.compare); +>sorted : Temporal.ZonedDateTime[] +> : ^^^^^^^^^^^^^^^^^^^^^^^^ +>arr.sort(Temporal.ZonedDateTime.compare) : Temporal.ZonedDateTime[] +> : ^^^^^^^^^^^^^^^^^^^^^^^^ +>arr.sort : (compareFn?: ((a: Temporal.ZonedDateTime, b: Temporal.ZonedDateTime) => number) | undefined) => Temporal.ZonedDateTime[] +> : ^ ^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>arr : Temporal.ZonedDateTime[] +> : ^^^^^^^^^^^^^^^^^^^^^^^^ +>sort : (compareFn?: ((a: Temporal.ZonedDateTime, b: Temporal.ZonedDateTime) => number) | undefined) => Temporal.ZonedDateTime[] +> : ^ ^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.ZonedDateTime.compare : (one: Temporal.ZonedDateTimeLike, two: Temporal.ZonedDateTimeLike) => number +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.ZonedDateTime : Temporal.ZonedDateTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>ZonedDateTime : Temporal.ZonedDateTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>compare : (one: Temporal.ZonedDateTimeLike, two: Temporal.ZonedDateTimeLike) => number +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + JSON.stringify(sorted, undefined, 2); +>JSON.stringify(sorted, undefined, 2) : string +> : ^^^^^^ +>JSON.stringify : { (value: any, replacer?: (this: any, key: string, value: any) => any, space?: string | number): string; (value: any, replacer?: (number | string)[] | null, space?: string | number): string; } +> : ^^^ ^^ ^^ ^^^ ^^ ^^^ ^^^ ^^^ ^^ ^^ ^^^ ^^ ^^^ ^^^ ^^^ +>JSON : JSON +> : ^^^^ +>stringify : { (value: any, replacer?: (this: any, key: string, value: any) => any, space?: string | number): string; (value: any, replacer?: (number | string)[] | null, space?: string | number): string; } +> : ^^^ ^^ ^^ ^^^ ^^ ^^^ ^^^ ^^^ ^^ ^^ ^^^ ^^ ^^^ ^^^ ^^^ +>sorted : Temporal.ZonedDateTime[] +> : ^^^^^^^^^^^^^^^^^^^^^^^^ +>undefined : undefined +> : ^^^^^^^^^ +>2 : 2 +> : ^ + + // => + // '[ + // "2020-02-01T12:30+01:00[Europe/Brussels]", + // "2020-02-01T12:30+00:00[Europe/London]", + // "2020-02-01T12:30-05:00[America/Toronto]", + // "2020-02-01T12:30-05:00[America/New_York]" + // ]' +} + +{ + const dt = Temporal.ZonedDateTime.from("1995-12-07T03:24:30.000003500[Europe/Rome]"); +>dt : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.ZonedDateTime.from("1995-12-07T03:24:30.000003500[Europe/Rome]") : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.ZonedDateTime.from : (item: Temporal.ZonedDateTimeLike, options?: Temporal.ZonedDateTimeFromOptions) => Temporal.ZonedDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.ZonedDateTime : Temporal.ZonedDateTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>ZonedDateTime : Temporal.ZonedDateTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.ZonedDateTimeLike, options?: Temporal.ZonedDateTimeFromOptions) => Temporal.ZonedDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"1995-12-07T03:24:30.000003500[Europe/Rome]" : "1995-12-07T03:24:30.000003500[Europe/Rome]" +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + dt.year; // => 1995 +>dt.year : number +> : ^^^^^^ +>dt : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>year : number +> : ^^^^^^ + + dt.month; // => 12 +>dt.month : number +> : ^^^^^^ +>dt : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>month : number +> : ^^^^^^ + + dt.monthCode; // => 'M12' +>dt.monthCode : string +> : ^^^^^^ +>dt : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>monthCode : string +> : ^^^^^^ + + dt.day; // => 7 +>dt.day : number +> : ^^^^^^ +>dt : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>day : number +> : ^^^^^^ + + dt.hour; // => 3 +>dt.hour : number +> : ^^^^^^ +>dt : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>hour : number +> : ^^^^^^ + + dt.minute; // => 24 +>dt.minute : number +> : ^^^^^^ +>dt : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>minute : number +> : ^^^^^^ + + dt.second; // => 30 +>dt.second : number +> : ^^^^^^ +>dt : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>second : number +> : ^^^^^^ + + dt.millisecond; // => 0 +>dt.millisecond : number +> : ^^^^^^ +>dt : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>millisecond : number +> : ^^^^^^ + + dt.microsecond; // => 3 +>dt.microsecond : number +> : ^^^^^^ +>dt : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>microsecond : number +> : ^^^^^^ + + dt.nanosecond; // => 500 +>dt.nanosecond : number +> : ^^^^^^ +>dt : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>nanosecond : number +> : ^^^^^^ +} + +{ + const zdt = Temporal.ZonedDateTime.from("2020-02-01T12:30+09:00[Asia/Tokyo]"); +>zdt : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.ZonedDateTime.from("2020-02-01T12:30+09:00[Asia/Tokyo]") : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.ZonedDateTime.from : (item: Temporal.ZonedDateTimeLike, options?: Temporal.ZonedDateTimeFromOptions) => Temporal.ZonedDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.ZonedDateTime : Temporal.ZonedDateTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>ZonedDateTime : Temporal.ZonedDateTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.ZonedDateTimeLike, options?: Temporal.ZonedDateTimeFromOptions) => Temporal.ZonedDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"2020-02-01T12:30+09:00[Asia/Tokyo]" : "2020-02-01T12:30+09:00[Asia/Tokyo]" +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + const epochMs = zdt.epochMilliseconds; +>epochMs : number +> : ^^^^^^ +>zdt.epochMilliseconds : number +> : ^^^^^^ +>zdt : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>epochMilliseconds : number +> : ^^^^^^ + + // => 1580527800000 + zdt.toInstant().epochMilliseconds; +>zdt.toInstant().epochMilliseconds : number +> : ^^^^^^ +>zdt.toInstant() : Temporal.Instant +> : ^^^^^^^^^^^^^^^^ +>zdt.toInstant : () => Temporal.Instant +> : ^^^^^^^^^^^^^^^^^^^^^^ +>zdt : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>toInstant : () => Temporal.Instant +> : ^^^^^^^^^^^^^^^^^^^^^^ +>epochMilliseconds : number +> : ^^^^^^ + + // => 1580527800000 + const legacyDate = new Date(epochMs); +>legacyDate : Date +> : ^^^^ +>new Date(epochMs) : Date +> : ^^^^ +>Date : DateConstructor +> : ^^^^^^^^^^^^^^^ +>epochMs : number +> : ^^^^^^ + + // => 2020-02-01T03:30:00.000Z + // (if the system time zone is America/Los_Angeles) + const epochNanos = zdt.epochNanoseconds; +>epochNanos : bigint +> : ^^^^^^ +>zdt.epochNanoseconds : bigint +> : ^^^^^^ +>zdt : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>epochNanoseconds : bigint +> : ^^^^^^ + + // => 1580527800000000000n + + // If you need epoch seconds data: + const epochSecs = Math.floor(zdt.epochMilliseconds / 1000); // => 1553906700 +>epochSecs : number +> : ^^^^^^ +>Math.floor(zdt.epochMilliseconds / 1000) : number +> : ^^^^^^ +>Math.floor : (x: number) => number +> : ^ ^^ ^^^^^ +>Math : Math +> : ^^^^ +>floor : (x: number) => number +> : ^ ^^ ^^^^^ +>zdt.epochMilliseconds / 1000 : number +> : ^^^^^^ +>zdt.epochMilliseconds : number +> : ^^^^^^ +>zdt : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>epochMilliseconds : number +> : ^^^^^^ +>1000 : 1000 +> : ^^^^ + + // => 1580527800 + + // If you need epoch microseconds data: + // (Note the extra check for correct floor rounding with bigints) + const ns = zdt.epochNanoseconds; +>ns : bigint +> : ^^^^^^ +>zdt.epochNanoseconds : bigint +> : ^^^^^^ +>zdt : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>epochNanoseconds : bigint +> : ^^^^^^ + + const epochMicros = ns / 1000n + ((ns % 1000n) < 0n ? -1n : 0n); +>epochMicros : bigint +> : ^^^^^^ +>ns / 1000n + ((ns % 1000n) < 0n ? -1n : 0n) : bigint +> : ^^^^^^ +>ns / 1000n : bigint +> : ^^^^^^ +>ns : bigint +> : ^^^^^^ +>1000n : 1000n +> : ^^^^^ +>((ns % 1000n) < 0n ? -1n : 0n) : 0n | -1n +> : ^^^^^^^^ +>(ns % 1000n) < 0n ? -1n : 0n : 0n | -1n +> : ^^^^^^^^ +>(ns % 1000n) < 0n : boolean +> : ^^^^^^^ +>(ns % 1000n) : bigint +> : ^^^^^^ +>ns % 1000n : bigint +> : ^^^^^^ +>ns : bigint +> : ^^^^^^ +>1000n : 1000n +> : ^^^^^ +>0n : 0n +> : ^^ +>-1n : -1n +> : ^^^ +>1n : 1n +> : ^^ +>0n : 0n +> : ^^ + + // => 1580527800000000n +} + +{ + const zdt = Temporal.ZonedDateTime.from("1995-12-07T03:24-08:00[America/Los_Angeles]"); +>zdt : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.ZonedDateTime.from("1995-12-07T03:24-08:00[America/Los_Angeles]") : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.ZonedDateTime.from : (item: Temporal.ZonedDateTimeLike, options?: Temporal.ZonedDateTimeFromOptions) => Temporal.ZonedDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.ZonedDateTime : Temporal.ZonedDateTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>ZonedDateTime : Temporal.ZonedDateTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.ZonedDateTimeLike, options?: Temporal.ZonedDateTimeFromOptions) => Temporal.ZonedDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"1995-12-07T03:24-08:00[America/Los_Angeles]" : "1995-12-07T03:24-08:00[America/Los_Angeles]" +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + `Time zone is: ${zdt.timeZoneId}`; +>`Time zone is: ${zdt.timeZoneId}` : string +> : ^^^^^^ +>zdt.timeZoneId : string +> : ^^^^^^ +>zdt : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>timeZoneId : string +> : ^^^^^^ + + // => 'Time zone is: America/Los_Angeles' + zdt.withTimeZone("Asia/Kolkata").timeZoneId; +>zdt.withTimeZone("Asia/Kolkata").timeZoneId : string +> : ^^^^^^ +>zdt.withTimeZone("Asia/Kolkata") : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>zdt.withTimeZone : (timeZone: Temporal.TimeZoneLike) => Temporal.ZonedDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>zdt : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>withTimeZone : (timeZone: Temporal.TimeZoneLike) => Temporal.ZonedDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"Asia/Kolkata" : "Asia/Kolkata" +> : ^^^^^^^^^^^^^^ +>timeZoneId : string +> : ^^^^^^ + + // => Asia/Kolkata + zdt.withTimeZone("Asia/Calcutta").timeZoneId; +>zdt.withTimeZone("Asia/Calcutta").timeZoneId : string +> : ^^^^^^ +>zdt.withTimeZone("Asia/Calcutta") : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>zdt.withTimeZone : (timeZone: Temporal.TimeZoneLike) => Temporal.ZonedDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>zdt : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>withTimeZone : (timeZone: Temporal.TimeZoneLike) => Temporal.ZonedDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"Asia/Calcutta" : "Asia/Calcutta" +> : ^^^^^^^^^^^^^^^ +>timeZoneId : string +> : ^^^^^^ + + // => Asia/Calcutta (does not follow links in the IANA Time Zone Database) + + zdt.withTimeZone("europe/paris").timeZoneId; +>zdt.withTimeZone("europe/paris").timeZoneId : string +> : ^^^^^^ +>zdt.withTimeZone("europe/paris") : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>zdt.withTimeZone : (timeZone: Temporal.TimeZoneLike) => Temporal.ZonedDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>zdt : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>withTimeZone : (timeZone: Temporal.TimeZoneLike) => Temporal.ZonedDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"europe/paris" : "europe/paris" +> : ^^^^^^^^^^^^^^ +>timeZoneId : string +> : ^^^^^^ + + // => Europe/Paris (normalized to match IANA Time Zone Database capitalization) + + zdt.withTimeZone("+05:00").timeZoneId; +>zdt.withTimeZone("+05:00").timeZoneId : string +> : ^^^^^^ +>zdt.withTimeZone("+05:00") : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>zdt.withTimeZone : (timeZone: Temporal.TimeZoneLike) => Temporal.ZonedDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>zdt : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>withTimeZone : (timeZone: Temporal.TimeZoneLike) => Temporal.ZonedDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"+05:00" : "+05:00" +> : ^^^^^^^^ +>timeZoneId : string +> : ^^^^^^ + + // => +05:00 + zdt.withTimeZone("+05").timeZoneId; +>zdt.withTimeZone("+05").timeZoneId : string +> : ^^^^^^ +>zdt.withTimeZone("+05") : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>zdt.withTimeZone : (timeZone: Temporal.TimeZoneLike) => Temporal.ZonedDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>zdt : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>withTimeZone : (timeZone: Temporal.TimeZoneLike) => Temporal.ZonedDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"+05" : "+05" +> : ^^^^^ +>timeZoneId : string +> : ^^^^^^ + + // => +05:00 (normalized to ±HH:MM) + zdt.withTimeZone("+0500").timeZoneId; +>zdt.withTimeZone("+0500").timeZoneId : string +> : ^^^^^^ +>zdt.withTimeZone("+0500") : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>zdt.withTimeZone : (timeZone: Temporal.TimeZoneLike) => Temporal.ZonedDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>zdt : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>withTimeZone : (timeZone: Temporal.TimeZoneLike) => Temporal.ZonedDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"+0500" : "+0500" +> : ^^^^^^^ +>timeZoneId : string +> : ^^^^^^ + + // => +05:00 (normalized to ±HH:MM) +} + +{ + const date = Temporal.ZonedDateTime.from("-000015-01-01T12:30[Europe/Rome][u-ca=gregory]"); +>date : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.ZonedDateTime.from("-000015-01-01T12:30[Europe/Rome][u-ca=gregory]") : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.ZonedDateTime.from : (item: Temporal.ZonedDateTimeLike, options?: Temporal.ZonedDateTimeFromOptions) => Temporal.ZonedDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.ZonedDateTime : Temporal.ZonedDateTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>ZonedDateTime : Temporal.ZonedDateTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.ZonedDateTimeLike, options?: Temporal.ZonedDateTimeFromOptions) => Temporal.ZonedDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"-000015-01-01T12:30[Europe/Rome][u-ca=gregory]" : "-000015-01-01T12:30[Europe/Rome][u-ca=gregory]" +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + date.era; +>date.era : string | undefined +> : ^^^^^^^^^^^^^^^^^^ +>date : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>era : string | undefined +> : ^^^^^^^^^^^^^^^^^^ + + // => 'bce' + date.eraYear; +>date.eraYear : number | undefined +> : ^^^^^^^^^^^^^^^^^^ +>date : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>eraYear : number | undefined +> : ^^^^^^^^^^^^^^^^^^ + + // => 16 + date.year; +>date.year : number +> : ^^^^^^ +>date : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>year : number +> : ^^^^^^ + + // => -15 +} + +{ + const zdt = Temporal.ZonedDateTime.from("1995-12-07T03:24-08:00[America/Los_Angeles]"); +>zdt : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.ZonedDateTime.from("1995-12-07T03:24-08:00[America/Los_Angeles]") : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.ZonedDateTime.from : (item: Temporal.ZonedDateTimeLike, options?: Temporal.ZonedDateTimeFromOptions) => Temporal.ZonedDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.ZonedDateTime : Temporal.ZonedDateTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>ZonedDateTime : Temporal.ZonedDateTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.ZonedDateTimeLike, options?: Temporal.ZonedDateTimeFromOptions) => Temporal.ZonedDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"1995-12-07T03:24-08:00[America/Los_Angeles]" : "1995-12-07T03:24-08:00[America/Los_Angeles]" +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + ["MON", "TUE", "WED", "THU", "FRI", "SAT", "SUN"][zdt.dayOfWeek - 1]; // => 'THU' +>["MON", "TUE", "WED", "THU", "FRI", "SAT", "SUN"][zdt.dayOfWeek - 1] : string +> : ^^^^^^ +>["MON", "TUE", "WED", "THU", "FRI", "SAT", "SUN"] : string[] +> : ^^^^^^^^ +>"MON" : "MON" +> : ^^^^^ +>"TUE" : "TUE" +> : ^^^^^ +>"WED" : "WED" +> : ^^^^^ +>"THU" : "THU" +> : ^^^^^ +>"FRI" : "FRI" +> : ^^^^^ +>"SAT" : "SAT" +> : ^^^^^ +>"SUN" : "SUN" +> : ^^^^^ +>zdt.dayOfWeek - 1 : number +> : ^^^^^^ +>zdt.dayOfWeek : number +> : ^^^^^^ +>zdt : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>dayOfWeek : number +> : ^^^^^^ +>1 : 1 +> : ^ +} + +{ + const zdt = Temporal.ZonedDateTime.from("1995-12-07T03:24-08:00[America/Los_Angeles]"); +>zdt : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.ZonedDateTime.from("1995-12-07T03:24-08:00[America/Los_Angeles]") : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.ZonedDateTime.from : (item: Temporal.ZonedDateTimeLike, options?: Temporal.ZonedDateTimeFromOptions) => Temporal.ZonedDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.ZonedDateTime : Temporal.ZonedDateTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>ZonedDateTime : Temporal.ZonedDateTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.ZonedDateTimeLike, options?: Temporal.ZonedDateTimeFromOptions) => Temporal.ZonedDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"1995-12-07T03:24-08:00[America/Los_Angeles]" : "1995-12-07T03:24-08:00[America/Los_Angeles]" +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + // ISO ordinal date + console.log(zdt.year, zdt.dayOfYear); // => '1995 341' +>console.log(zdt.year, zdt.dayOfYear) : void +> : ^^^^ +>console.log : (...data: any[]) => void +> : ^^^^ ^^ ^^^^^ +>console : Console +> : ^^^^^^^ +>log : (...data: any[]) => void +> : ^^^^ ^^ ^^^^^ +>zdt.year : number +> : ^^^^^^ +>zdt : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>year : number +> : ^^^^^^ +>zdt.dayOfYear : number +> : ^^^^^^ +>zdt : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>dayOfYear : number +> : ^^^^^^ +} + +{ + const zdt = Temporal.ZonedDateTime.from("2022-01-01T03:24-08:00[America/Los_Angeles]"); +>zdt : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.ZonedDateTime.from("2022-01-01T03:24-08:00[America/Los_Angeles]") : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.ZonedDateTime.from : (item: Temporal.ZonedDateTimeLike, options?: Temporal.ZonedDateTimeFromOptions) => Temporal.ZonedDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.ZonedDateTime : Temporal.ZonedDateTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>ZonedDateTime : Temporal.ZonedDateTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.ZonedDateTimeLike, options?: Temporal.ZonedDateTimeFromOptions) => Temporal.ZonedDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"2022-01-01T03:24-08:00[America/Los_Angeles]" : "2022-01-01T03:24-08:00[America/Los_Angeles]" +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + // ISO week date + console.log(zdt.yearOfWeek, zdt.weekOfYear, zdt.dayOfWeek); // => '2021 52 6' +>console.log(zdt.yearOfWeek, zdt.weekOfYear, zdt.dayOfWeek) : void +> : ^^^^ +>console.log : (...data: any[]) => void +> : ^^^^ ^^ ^^^^^ +>console : Console +> : ^^^^^^^ +>log : (...data: any[]) => void +> : ^^^^ ^^ ^^^^^ +>zdt.yearOfWeek : number | undefined +> : ^^^^^^^^^^^^^^^^^^ +>zdt : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>yearOfWeek : number | undefined +> : ^^^^^^^^^^^^^^^^^^ +>zdt.weekOfYear : number | undefined +> : ^^^^^^^^^^^^^^^^^^ +>zdt : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>weekOfYear : number | undefined +> : ^^^^^^^^^^^^^^^^^^ +>zdt.dayOfWeek : number +> : ^^^^^^ +>zdt : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>dayOfWeek : number +> : ^^^^^^ +} + +{ + const zdt = Temporal.ZonedDateTime.from("1995-12-07T03:24-08:00[America/Los_Angeles]"); +>zdt : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.ZonedDateTime.from("1995-12-07T03:24-08:00[America/Los_Angeles]") : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.ZonedDateTime.from : (item: Temporal.ZonedDateTimeLike, options?: Temporal.ZonedDateTimeFromOptions) => Temporal.ZonedDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.ZonedDateTime : Temporal.ZonedDateTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>ZonedDateTime : Temporal.ZonedDateTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.ZonedDateTimeLike, options?: Temporal.ZonedDateTimeFromOptions) => Temporal.ZonedDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"1995-12-07T03:24-08:00[America/Los_Angeles]" : "1995-12-07T03:24-08:00[America/Los_Angeles]" +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + zdt.daysInWeek; // => 7 +>zdt.daysInWeek : number +> : ^^^^^^ +>zdt : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>daysInWeek : number +> : ^^^^^^ +} + +{ + // Attempt to write some mnemonic poetry + const monthsByDays: Record = {}; +>monthsByDays : Record +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : any +> : ^^^ +>{} : {} +> : ^^ + + for (let month = 1; month <= 12; month++) { +>month : number +> : ^^^^^^ +>1 : 1 +> : ^ +>month <= 12 : boolean +> : ^^^^^^^ +>month : number +> : ^^^^^^ +>12 : 12 +> : ^^ +>month++ : number +> : ^^^^^^ +>month : number +> : ^^^^^^ + + const zdt = Temporal.Now.zonedDateTimeISO().with({ month }); +>zdt : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.Now.zonedDateTimeISO().with({ month }) : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.Now.zonedDateTimeISO().with : (zonedDateTimeLike: Temporal.PartialTemporalLike, options?: Temporal.ZonedDateTimeFromOptions) => Temporal.ZonedDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.Now.zonedDateTimeISO() : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.Now.zonedDateTimeISO : (timeZone?: Temporal.TimeZoneLike) => Temporal.ZonedDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.Now : typeof Temporal.Now +> : ^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>Now : typeof Temporal.Now +> : ^^^^^^^^^^^^^^^^^^^ +>zonedDateTimeISO : (timeZone?: Temporal.TimeZoneLike) => Temporal.ZonedDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>with : (zonedDateTimeLike: Temporal.PartialTemporalLike, options?: Temporal.ZonedDateTimeFromOptions) => Temporal.ZonedDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ month } : { month: number; } +> : ^^^^^^^^^^^^^^^^^^ +>month : number +> : ^^^^^^ + + monthsByDays[zdt.daysInMonth] = (monthsByDays[zdt.daysInMonth] || []).concat(zdt); +>monthsByDays[zdt.daysInMonth] = (monthsByDays[zdt.daysInMonth] || []).concat(zdt) : Temporal.ZonedDateTime[] +> : ^^^^^^^^^^^^^^^^^^^^^^^^ +>monthsByDays[zdt.daysInMonth] : Temporal.ZonedDateTime[] +> : ^^^^^^^^^^^^^^^^^^^^^^^^ +>monthsByDays : Record +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>zdt.daysInMonth : number +> : ^^^^^^ +>zdt : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>daysInMonth : number +> : ^^^^^^ +>(monthsByDays[zdt.daysInMonth] || []).concat(zdt) : Temporal.ZonedDateTime[] +> : ^^^^^^^^^^^^^^^^^^^^^^^^ +>(monthsByDays[zdt.daysInMonth] || []).concat : { (...items: ConcatArray[]): Temporal.ZonedDateTime[]; (...items: (Temporal.ZonedDateTime | ConcatArray)[]): Temporal.ZonedDateTime[]; } +> : ^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>(monthsByDays[zdt.daysInMonth] || []) : Temporal.ZonedDateTime[] +> : ^^^^^^^^^^^^^^^^^^^^^^^^ +>monthsByDays[zdt.daysInMonth] || [] : Temporal.ZonedDateTime[] +> : ^^^^^^^^^^^^^^^^^^^^^^^^ +>monthsByDays[zdt.daysInMonth] : Temporal.ZonedDateTime[] +> : ^^^^^^^^^^^^^^^^^^^^^^^^ +>monthsByDays : Record +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>zdt.daysInMonth : number +> : ^^^^^^ +>zdt : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>daysInMonth : number +> : ^^^^^^ +>[] : never[] +> : ^^^^^^^ +>concat : { (...items: ConcatArray[]): Temporal.ZonedDateTime[]; (...items: (Temporal.ZonedDateTime | ConcatArray)[]): Temporal.ZonedDateTime[]; } +> : ^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>zdt : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ + } + + const strings = monthsByDays[30].map(zdt => zdt.toLocaleString("en", { month: "long" })); +>strings : string[] +> : ^^^^^^^^ +>monthsByDays[30].map(zdt => zdt.toLocaleString("en", { month: "long" })) : string[] +> : ^^^^^^^^ +>monthsByDays[30].map : (callbackfn: (value: Temporal.ZonedDateTime, index: number, array: Temporal.ZonedDateTime[]) => U, thisArg?: any) => U[] +> : ^ ^^ ^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^ ^^^^^^^^ +>monthsByDays[30] : Temporal.ZonedDateTime[] +> : ^^^^^^^^^^^^^^^^^^^^^^^^ +>monthsByDays : Record +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>30 : 30 +> : ^^ +>map : (callbackfn: (value: Temporal.ZonedDateTime, index: number, array: Temporal.ZonedDateTime[]) => U, thisArg?: any) => U[] +> : ^ ^^ ^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^ ^^^^^^^^ +>zdt => zdt.toLocaleString("en", { month: "long" }) : (zdt: Temporal.ZonedDateTime) => string +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>zdt : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>zdt.toLocaleString("en", { month: "long" }) : string +> : ^^^^^^ +>zdt.toLocaleString : (locales?: Intl.LocalesArgument, options?: Intl.DateTimeFormatOptions) => string +> : ^ ^^^ ^^ ^^^ ^^^^^ +>zdt : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>toLocaleString : (locales?: Intl.LocalesArgument, options?: Intl.DateTimeFormatOptions) => string +> : ^ ^^^ ^^ ^^^ ^^^^^ +>"en" : "en" +> : ^^^^ +>{ month: "long" } : { month: "long"; } +> : ^^^^^^^^^^^^^^^^^^ +>month : "long" +> : ^^^^^^ +>"long" : "long" +> : ^^^^^^ + + // Shuffle to improve poem as determined empirically + strings.unshift(strings.pop()!); +>strings.unshift(strings.pop()!) : number +> : ^^^^^^ +>strings.unshift : (...items: string[]) => number +> : ^^^^ ^^^^^^^^^^^^^^^ +>strings : string[] +> : ^^^^^^^^ +>unshift : (...items: string[]) => number +> : ^^^^ ^^^^^^^^^^^^^^^ +>strings.pop()! : string +> : ^^^^^^ +>strings.pop() : string | undefined +> : ^^^^^^^^^^^^^^^^^^ +>strings.pop : () => string | undefined +> : ^^^^^^^^^^^^^^^^^^^^^^^^ +>strings : string[] +> : ^^^^^^^^ +>pop : () => string | undefined +> : ^^^^^^^^^^^^^^^^^^^^^^^^ + + const format = new Intl.ListFormat("en"); +>format : Intl.ListFormat +> : ^^^^^^^^^^^^^^^ +>new Intl.ListFormat("en") : Intl.ListFormat +> : ^^^^^^^^^^^^^^^ +>Intl.ListFormat : { new (locales?: Intl.LocalesArgument, options?: Intl.ListFormatOptions): Intl.ListFormat; prototype: Intl.ListFormat; supportedLocalesOf(locales: Intl.LocalesArgument, options?: Pick): Intl.UnicodeBCP47LocaleIdentifier[]; } +> : ^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^ ^^^ ^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^ +>Intl : typeof Intl +> : ^^^^^^^^^^^ +>ListFormat : { new (locales?: Intl.LocalesArgument, options?: Intl.ListFormatOptions): Intl.ListFormat; prototype: Intl.ListFormat; supportedLocalesOf(locales: Intl.LocalesArgument, options?: Pick): Intl.UnicodeBCP47LocaleIdentifier[]; } +> : ^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^ ^^^ ^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^ +>"en" : "en" +> : ^^^^ + + const poem = `Thirty days hath ${format.format(strings)}`; +>poem : string +> : ^^^^^^ +>`Thirty days hath ${format.format(strings)}` : string +> : ^^^^^^ +>format.format(strings) : string +> : ^^^^^^ +>format.format : (list: Iterable) => string +> : ^ ^^ ^^^^^ +>format : Intl.ListFormat +> : ^^^^^^^^^^^^^^^ +>format : (list: Iterable) => string +> : ^ ^^ ^^^^^ +>strings : string[] +> : ^^^^^^^^ + + console.log(poem); +>console.log(poem) : void +> : ^^^^ +>console.log : (...data: any[]) => void +> : ^^^^ ^^ ^^^^^ +>console : Console +> : ^^^^^^^ +>log : (...data: any[]) => void +> : ^^^^ ^^ ^^^^^ +>poem : string +> : ^^^^^^ +} + +{ + const zdt = Temporal.Now.zonedDateTimeISO(); +>zdt : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.Now.zonedDateTimeISO() : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.Now.zonedDateTimeISO : (timeZone?: Temporal.TimeZoneLike) => Temporal.ZonedDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.Now : typeof Temporal.Now +> : ^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>Now : typeof Temporal.Now +> : ^^^^^^^^^^^^^^^^^^^ +>zonedDateTimeISO : (timeZone?: Temporal.TimeZoneLike) => Temporal.ZonedDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + const percent = zdt.dayOfYear / zdt.daysInYear; +>percent : number +> : ^^^^^^ +>zdt.dayOfYear / zdt.daysInYear : number +> : ^^^^^^ +>zdt.dayOfYear : number +> : ^^^^^^ +>zdt : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>dayOfYear : number +> : ^^^^^^ +>zdt.daysInYear : number +> : ^^^^^^ +>zdt : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>daysInYear : number +> : ^^^^^^ + + `The year is ${percent.toLocaleString("en", { style: "percent" })} over!`; +>`The year is ${percent.toLocaleString("en", { style: "percent" })} over!` : string +> : ^^^^^^ +>percent.toLocaleString("en", { style: "percent" }) : string +> : ^^^^^^ +>percent.toLocaleString : (locales?: string | string[], options?: Intl.NumberFormatOptions) => string +> : ^ ^^^ ^^ ^^^ ^^^^^ +>percent : number +> : ^^^^^^ +>toLocaleString : (locales?: string | string[], options?: Intl.NumberFormatOptions) => string +> : ^ ^^^ ^^ ^^^ ^^^^^ +>"en" : "en" +> : ^^^^ +>{ style: "percent" } : { style: "percent"; } +> : ^^^^^^^^^^^^^^^^^^^^^ +>style : "percent" +> : ^^^^^^^^^ +>"percent" : "percent" +> : ^^^^^^^^^ + + // example output: "The year is 10% over!" +} + +{ + const zdt = Temporal.ZonedDateTime.from("1900-01-01T12:00+09:00[Asia/Tokyo]"); +>zdt : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.ZonedDateTime.from("1900-01-01T12:00+09:00[Asia/Tokyo]") : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.ZonedDateTime.from : (item: Temporal.ZonedDateTimeLike, options?: Temporal.ZonedDateTimeFromOptions) => Temporal.ZonedDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.ZonedDateTime : Temporal.ZonedDateTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>ZonedDateTime : Temporal.ZonedDateTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.ZonedDateTimeLike, options?: Temporal.ZonedDateTimeFromOptions) => Temporal.ZonedDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"1900-01-01T12:00+09:00[Asia/Tokyo]" : "1900-01-01T12:00+09:00[Asia/Tokyo]" +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + zdt.monthsInYear; // => 12 +>zdt.monthsInYear : number +> : ^^^^^^ +>zdt : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>monthsInYear : number +> : ^^^^^^ +} + +{ + // Is this year a leap year? + const zdt = Temporal.Now.zonedDateTimeISO(); +>zdt : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.Now.zonedDateTimeISO() : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.Now.zonedDateTimeISO : (timeZone?: Temporal.TimeZoneLike) => Temporal.ZonedDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.Now : typeof Temporal.Now +> : ^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>Now : typeof Temporal.Now +> : ^^^^^^^^^^^^^^^^^^^ +>zonedDateTimeISO : (timeZone?: Temporal.TimeZoneLike) => Temporal.ZonedDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + zdt.inLeapYear; // example output: true +>zdt.inLeapYear : boolean +> : ^^^^^^^ +>zdt : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>inLeapYear : boolean +> : ^^^^^^^ + + // Is 2100 a leap year? (no, because it's divisible by 100 and not 400) + zdt.with({ year: 2100 }).inLeapYear; // => false +>zdt.with({ year: 2100 }).inLeapYear : boolean +> : ^^^^^^^ +>zdt.with({ year: 2100 }) : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>zdt.with : (zonedDateTimeLike: Temporal.PartialTemporalLike, options?: Temporal.ZonedDateTimeFromOptions) => Temporal.ZonedDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>zdt : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>with : (zonedDateTimeLike: Temporal.PartialTemporalLike, options?: Temporal.ZonedDateTimeFromOptions) => Temporal.ZonedDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ year: 2100 } : { year: number; } +> : ^^^^^^^^^^^^^^^^^ +>year : number +> : ^^^^^^ +>2100 : 2100 +> : ^^^^ +>inLeapYear : boolean +> : ^^^^^^^ +} + +{ + const zdt = Temporal.ZonedDateTime.from("2010-11-07T23:00:00-03:30[America/St_Johns]"); +>zdt : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.ZonedDateTime.from("2010-11-07T23:00:00-03:30[America/St_Johns]") : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.ZonedDateTime.from : (item: Temporal.ZonedDateTimeLike, options?: Temporal.ZonedDateTimeFromOptions) => Temporal.ZonedDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.ZonedDateTime : Temporal.ZonedDateTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>ZonedDateTime : Temporal.ZonedDateTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.ZonedDateTimeLike, options?: Temporal.ZonedDateTimeFromOptions) => Temporal.ZonedDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"2010-11-07T23:00:00-03:30[America/St_Johns]" : "2010-11-07T23:00:00-03:30[America/St_Johns]" +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + zdt.hoursInDay; // 25 +>zdt.hoursInDay : number +> : ^^^^^^ +>zdt : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>hoursInDay : number +> : ^^^^^^ +} + +{ + const zdt = Temporal.ZonedDateTime.from("2020-11-01T01:30-07:00[America/Los_Angeles]"); +>zdt : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.ZonedDateTime.from("2020-11-01T01:30-07:00[America/Los_Angeles]") : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.ZonedDateTime.from : (item: Temporal.ZonedDateTimeLike, options?: Temporal.ZonedDateTimeFromOptions) => Temporal.ZonedDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.ZonedDateTime : Temporal.ZonedDateTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>ZonedDateTime : Temporal.ZonedDateTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.ZonedDateTimeLike, options?: Temporal.ZonedDateTimeFromOptions) => Temporal.ZonedDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"2020-11-01T01:30-07:00[America/Los_Angeles]" : "2020-11-01T01:30-07:00[America/Los_Angeles]" +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + zdt.offsetNanoseconds; +>zdt.offsetNanoseconds : number +> : ^^^^^^ +>zdt : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>offsetNanoseconds : number +> : ^^^^^^ + + // => -25200000000000 + // (-7 * 3600 * 1e9) +} + +{ + const zdt = Temporal.ZonedDateTime.from("2020-11-01T01:30-07:00[America/Los_Angeles]"); +>zdt : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.ZonedDateTime.from("2020-11-01T01:30-07:00[America/Los_Angeles]") : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.ZonedDateTime.from : (item: Temporal.ZonedDateTimeLike, options?: Temporal.ZonedDateTimeFromOptions) => Temporal.ZonedDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.ZonedDateTime : Temporal.ZonedDateTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>ZonedDateTime : Temporal.ZonedDateTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.ZonedDateTimeLike, options?: Temporal.ZonedDateTimeFromOptions) => Temporal.ZonedDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"2020-11-01T01:30-07:00[America/Los_Angeles]" : "2020-11-01T01:30-07:00[America/Los_Angeles]" +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + zdt.offset; +>zdt.offset : string +> : ^^^^^^ +>zdt : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>offset : string +> : ^^^^^^ + + // => '-07:00' + zdt.withTimeZone("Asia/Kolkata").offset; +>zdt.withTimeZone("Asia/Kolkata").offset : string +> : ^^^^^^ +>zdt.withTimeZone("Asia/Kolkata") : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>zdt.withTimeZone : (timeZone: Temporal.TimeZoneLike) => Temporal.ZonedDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>zdt : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>withTimeZone : (timeZone: Temporal.TimeZoneLike) => Temporal.ZonedDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"Asia/Kolkata" : "Asia/Kolkata" +> : ^^^^^^^^^^^^^^ +>offset : string +> : ^^^^^^ + + // => '+05:30' + + const minus8Hours = "-08:00"; +>minus8Hours : "-08:00" +> : ^^^^^^^^ +>"-08:00" : "-08:00" +> : ^^^^^^^^ + + const daylightTime0130 = Temporal.ZonedDateTime.from("2020-11-01T01:30-07:00[America/Los_Angeles]"); +>daylightTime0130 : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.ZonedDateTime.from("2020-11-01T01:30-07:00[America/Los_Angeles]") : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.ZonedDateTime.from : (item: Temporal.ZonedDateTimeLike, options?: Temporal.ZonedDateTimeFromOptions) => Temporal.ZonedDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.ZonedDateTime : Temporal.ZonedDateTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>ZonedDateTime : Temporal.ZonedDateTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.ZonedDateTimeLike, options?: Temporal.ZonedDateTimeFromOptions) => Temporal.ZonedDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"2020-11-01T01:30-07:00[America/Los_Angeles]" : "2020-11-01T01:30-07:00[America/Los_Angeles]" +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + // => 2020-11-01T01:30:00-07:00[America/Los_Angeles] + // This is Pacific Daylight Time 1:30AM + const repeated0130 = daylightTime0130.with({ offset: minus8Hours }); +>repeated0130 : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>daylightTime0130.with({ offset: minus8Hours }) : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>daylightTime0130.with : (zonedDateTimeLike: Temporal.PartialTemporalLike, options?: Temporal.ZonedDateTimeFromOptions) => Temporal.ZonedDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>daylightTime0130 : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>with : (zonedDateTimeLike: Temporal.PartialTemporalLike, options?: Temporal.ZonedDateTimeFromOptions) => Temporal.ZonedDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ offset: minus8Hours } : { offset: string; } +> : ^^^^^^^^^^^^^^^^^^^ +>offset : string +> : ^^^^^^ +>minus8Hours : "-08:00" +> : ^^^^^^^^ + + // => 2020-11-01T01:30:00-08:00[America/Los_Angeles] + // This is Pacific Standard Time 1:30AM +} + +{ + const zdt = Temporal.ZonedDateTime.from("1995-12-07T03:24:00-06:00[America/Chicago]"); +>zdt : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.ZonedDateTime.from("1995-12-07T03:24:00-06:00[America/Chicago]") : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.ZonedDateTime.from : (item: Temporal.ZonedDateTimeLike, options?: Temporal.ZonedDateTimeFromOptions) => Temporal.ZonedDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.ZonedDateTime : Temporal.ZonedDateTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>ZonedDateTime : Temporal.ZonedDateTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.ZonedDateTimeLike, options?: Temporal.ZonedDateTimeFromOptions) => Temporal.ZonedDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"1995-12-07T03:24:00-06:00[America/Chicago]" : "1995-12-07T03:24:00-06:00[America/Chicago]" +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + zdt.with({ year: 2015, minute: 31 }); // => 2015-12-07T03:31:00-06:00[America/Chicago] +>zdt.with({ year: 2015, minute: 31 }) : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>zdt.with : (zonedDateTimeLike: Temporal.PartialTemporalLike, options?: Temporal.ZonedDateTimeFromOptions) => Temporal.ZonedDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>zdt : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>with : (zonedDateTimeLike: Temporal.PartialTemporalLike, options?: Temporal.ZonedDateTimeFromOptions) => Temporal.ZonedDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ year: 2015, minute: 31 } : { year: number; minute: number; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>year : number +> : ^^^^^^ +>2015 : 2015 +> : ^^^^ +>minute : number +> : ^^^^^^ +>31 : 31 +> : ^^ +} + +{ + const zdt = Temporal.ZonedDateTime.from("2015-12-07T03:24:30.000003500-08:00[America/Los_Angeles]"); +>zdt : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.ZonedDateTime.from("2015-12-07T03:24:30.000003500-08:00[America/Los_Angeles]") : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.ZonedDateTime.from : (item: Temporal.ZonedDateTimeLike, options?: Temporal.ZonedDateTimeFromOptions) => Temporal.ZonedDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.ZonedDateTime : Temporal.ZonedDateTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>ZonedDateTime : Temporal.ZonedDateTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.ZonedDateTimeLike, options?: Temporal.ZonedDateTimeFromOptions) => Temporal.ZonedDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"2015-12-07T03:24:30.000003500-08:00[America/Los_Angeles]" : "2015-12-07T03:24:30.000003500-08:00[America/Los_Angeles]" +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + zdt.withPlainTime({ hour: 10 }); // => 2015-12-07T10:00:00-08:00[America/Los_Angeles] +>zdt.withPlainTime({ hour: 10 }) : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>zdt.withPlainTime : (plainTime?: Temporal.PlainTimeLike) => Temporal.ZonedDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>zdt : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>withPlainTime : (plainTime?: Temporal.PlainTimeLike) => Temporal.ZonedDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ hour: 10 } : { hour: number; } +> : ^^^^^^^^^^^^^^^^^ +>hour : number +> : ^^^^^^ +>10 : 10 +> : ^^ + + const time = Temporal.PlainTime.from("11:22"); +>time : Temporal.PlainTime +> : ^^^^^^^^^^^^^^^^^^ +>Temporal.PlainTime.from("11:22") : Temporal.PlainTime +> : ^^^^^^^^^^^^^^^^^^ +>Temporal.PlainTime.from : (item: Temporal.PlainTimeLike, options?: Temporal.OverflowOptions) => Temporal.PlainTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainTime : Temporal.PlainTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>PlainTime : Temporal.PlainTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.PlainTimeLike, options?: Temporal.OverflowOptions) => Temporal.PlainTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"11:22" : "11:22" +> : ^^^^^^^ + + zdt.withPlainTime(time); // => 2015-12-07T11:22:00-08:00[America/Los_Angeles] +>zdt.withPlainTime(time) : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>zdt.withPlainTime : (plainTime?: Temporal.PlainTimeLike) => Temporal.ZonedDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>zdt : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>withPlainTime : (plainTime?: Temporal.PlainTimeLike) => Temporal.ZonedDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>time : Temporal.PlainTime +> : ^^^^^^^^^^^^^^^^^^ + + zdt.withPlainTime("12:34"); // => 2015-12-07T12:34:00-08:00[America/Los_Angeles] +>zdt.withPlainTime("12:34") : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>zdt.withPlainTime : (plainTime?: Temporal.PlainTimeLike) => Temporal.ZonedDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>zdt : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>withPlainTime : (plainTime?: Temporal.PlainTimeLike) => Temporal.ZonedDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"12:34" : "12:34" +> : ^^^^^^^ + + // easier for chaining + zdt.add({ days: 2, hours: 22 }).withPlainTime("00:00"); // => 2015-12-10T00:00:00-08:00[America/Los_Angeles] +>zdt.add({ days: 2, hours: 22 }).withPlainTime("00:00") : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>zdt.add({ days: 2, hours: 22 }).withPlainTime : (plainTime?: Temporal.PlainTimeLike) => Temporal.ZonedDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>zdt.add({ days: 2, hours: 22 }) : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>zdt.add : (duration: Temporal.DurationLike, options?: Temporal.OverflowOptions) => Temporal.ZonedDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>zdt : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>add : (duration: Temporal.DurationLike, options?: Temporal.OverflowOptions) => Temporal.ZonedDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ days: 2, hours: 22 } : { days: number; hours: number; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>days : number +> : ^^^^^^ +>2 : 2 +> : ^ +>hours : number +> : ^^^^^^ +>22 : 22 +> : ^^ +>withPlainTime : (plainTime?: Temporal.PlainTimeLike) => Temporal.ZonedDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"00:00" : "00:00" +> : ^^^^^^^ +} + +{ + const zdt = Temporal.ZonedDateTime.from("1995-12-07T03:24:30+09:00[Asia/Tokyo]"); +>zdt : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.ZonedDateTime.from("1995-12-07T03:24:30+09:00[Asia/Tokyo]") : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.ZonedDateTime.from : (item: Temporal.ZonedDateTimeLike, options?: Temporal.ZonedDateTimeFromOptions) => Temporal.ZonedDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.ZonedDateTime : Temporal.ZonedDateTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>ZonedDateTime : Temporal.ZonedDateTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.ZonedDateTimeLike, options?: Temporal.ZonedDateTimeFromOptions) => Temporal.ZonedDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"1995-12-07T03:24:30+09:00[Asia/Tokyo]" : "1995-12-07T03:24:30+09:00[Asia/Tokyo]" +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + zdt.toString(); // => '1995-12-07T03:24:30+09:00[Asia/Tokyo]' +>zdt.toString() : string +> : ^^^^^^ +>zdt.toString : (options?: Temporal.ZonedDateTimeToStringOptions) => string +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>zdt : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>toString : (options?: Temporal.ZonedDateTimeToStringOptions) => string +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + zdt.withTimeZone("Africa/Accra").toString(); // => '1995-12-06T18:24:30+00:00[Africa/Accra]' +>zdt.withTimeZone("Africa/Accra").toString() : string +> : ^^^^^^ +>zdt.withTimeZone("Africa/Accra").toString : (options?: Temporal.ZonedDateTimeToStringOptions) => string +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>zdt.withTimeZone("Africa/Accra") : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>zdt.withTimeZone : (timeZone: Temporal.TimeZoneLike) => Temporal.ZonedDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>zdt : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>withTimeZone : (timeZone: Temporal.TimeZoneLike) => Temporal.ZonedDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"Africa/Accra" : "Africa/Accra" +> : ^^^^^^^^^^^^^^ +>toString : (options?: Temporal.ZonedDateTimeToStringOptions) => string +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +} + +{ + const zdt = Temporal.ZonedDateTime.from("1995-12-07T03:24:30.000003500+09:00[Asia/Tokyo][u-ca=japanese]"); +>zdt : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.ZonedDateTime.from("1995-12-07T03:24:30.000003500+09:00[Asia/Tokyo][u-ca=japanese]") : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.ZonedDateTime.from : (item: Temporal.ZonedDateTimeLike, options?: Temporal.ZonedDateTimeFromOptions) => Temporal.ZonedDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.ZonedDateTime : Temporal.ZonedDateTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>ZonedDateTime : Temporal.ZonedDateTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.ZonedDateTimeLike, options?: Temporal.ZonedDateTimeFromOptions) => Temporal.ZonedDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"1995-12-07T03:24:30.000003500+09:00[Asia/Tokyo][u-ca=japanese]" : "1995-12-07T03:24:30.000003500+09:00[Asia/Tokyo][u-ca=japanese]" +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + `${zdt.era} ${zdt.eraYear}`; // => 'heisei 7' +>`${zdt.era} ${zdt.eraYear}` : string +> : ^^^^^^ +>zdt.era : string | undefined +> : ^^^^^^^^^^^^^^^^^^ +>zdt : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>era : string | undefined +> : ^^^^^^^^^^^^^^^^^^ +>zdt.eraYear : number | undefined +> : ^^^^^^^^^^^^^^^^^^ +>zdt : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>eraYear : number | undefined +> : ^^^^^^^^^^^^^^^^^^ + + zdt.withCalendar("gregory").eraYear; // => 1995 +>zdt.withCalendar("gregory").eraYear : number | undefined +> : ^^^^^^^^^^^^^^^^^^ +>zdt.withCalendar("gregory") : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>zdt.withCalendar : (calendar: Temporal.CalendarLike) => Temporal.ZonedDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>zdt : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>withCalendar : (calendar: Temporal.CalendarLike) => Temporal.ZonedDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"gregory" : "gregory" +> : ^^^^^^^^^ +>eraYear : number | undefined +> : ^^^^^^^^^^^^^^^^^^ +} + +{ + const zdt = Temporal.ZonedDateTime.from("2020-03-08T00:00-08:00[America/Los_Angeles]"); +>zdt : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.ZonedDateTime.from("2020-03-08T00:00-08:00[America/Los_Angeles]") : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.ZonedDateTime.from : (item: Temporal.ZonedDateTimeLike, options?: Temporal.ZonedDateTimeFromOptions) => Temporal.ZonedDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.ZonedDateTime : Temporal.ZonedDateTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>ZonedDateTime : Temporal.ZonedDateTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.ZonedDateTimeLike, options?: Temporal.ZonedDateTimeFromOptions) => Temporal.ZonedDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"2020-03-08T00:00-08:00[America/Los_Angeles]" : "2020-03-08T00:00-08:00[America/Los_Angeles]" +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + // Add a day to get midnight on the day after DST starts + const laterDay = zdt.add({ days: 1 }); +>laterDay : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>zdt.add({ days: 1 }) : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>zdt.add : (duration: Temporal.DurationLike, options?: Temporal.OverflowOptions) => Temporal.ZonedDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>zdt : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>add : (duration: Temporal.DurationLike, options?: Temporal.OverflowOptions) => Temporal.ZonedDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ days: 1 } : { days: number; } +> : ^^^^^^^^^^^^^^^^^ +>days : number +> : ^^^^^^ +>1 : 1 +> : ^ + + // => 2020-03-09T00:00:00-07:00[America/Los_Angeles] + // Note that the new offset is different, indicating the result is adjusted for DST. + laterDay.since(zdt, { largestUnit: "hour" }).hours; +>laterDay.since(zdt, { largestUnit: "hour" }).hours : number +> : ^^^^^^ +>laterDay.since(zdt, { largestUnit: "hour" }) : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>laterDay.since : (other: Temporal.ZonedDateTimeLike, options?: Temporal.RoundingOptionsWithLargestUnit) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^ +>laterDay : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>since : (other: Temporal.ZonedDateTimeLike, options?: Temporal.RoundingOptionsWithLargestUnit) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^ +>zdt : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>{ largestUnit: "hour" } : { largestUnit: "hour"; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^ +>largestUnit : "hour" +> : ^^^^^^ +>"hour" : "hour" +> : ^^^^^^ +>hours : number +> : ^^^^^^ + + // => 23 + // because one clock hour lost to DST + + const laterHours = zdt.add({ hours: 24 }); +>laterHours : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>zdt.add({ hours: 24 }) : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>zdt.add : (duration: Temporal.DurationLike, options?: Temporal.OverflowOptions) => Temporal.ZonedDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>zdt : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>add : (duration: Temporal.DurationLike, options?: Temporal.OverflowOptions) => Temporal.ZonedDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ hours: 24 } : { hours: number; } +> : ^^^^^^^^^^^^^^^^^^ +>hours : number +> : ^^^^^^ +>24 : 24 +> : ^^ + + // => 2020-03-09T01:00:00-07:00[America/Los_Angeles] + // Adding time units doesn't adjust for DST. Result is 1:00AM: 24 real-world + // hours later because a clock hour was skipped by DST. + laterHours.since(zdt, { largestUnit: "hour" }).hours; // => 24 +>laterHours.since(zdt, { largestUnit: "hour" }).hours : number +> : ^^^^^^ +>laterHours.since(zdt, { largestUnit: "hour" }) : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>laterHours.since : (other: Temporal.ZonedDateTimeLike, options?: Temporal.RoundingOptionsWithLargestUnit) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^ +>laterHours : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>since : (other: Temporal.ZonedDateTimeLike, options?: Temporal.RoundingOptionsWithLargestUnit) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^ +>zdt : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>{ largestUnit: "hour" } : { largestUnit: "hour"; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^ +>largestUnit : "hour" +> : ^^^^^^ +>"hour" : "hour" +> : ^^^^^^ +>hours : number +> : ^^^^^^ +} + +{ + const zdt = Temporal.ZonedDateTime.from("2020-03-09T00:00-07:00[America/Los_Angeles]"); +>zdt : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.ZonedDateTime.from("2020-03-09T00:00-07:00[America/Los_Angeles]") : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.ZonedDateTime.from : (item: Temporal.ZonedDateTimeLike, options?: Temporal.ZonedDateTimeFromOptions) => Temporal.ZonedDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.ZonedDateTime : Temporal.ZonedDateTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>ZonedDateTime : Temporal.ZonedDateTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.ZonedDateTimeLike, options?: Temporal.ZonedDateTimeFromOptions) => Temporal.ZonedDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"2020-03-09T00:00-07:00[America/Los_Angeles]" : "2020-03-09T00:00-07:00[America/Los_Angeles]" +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + // Add a day to get midnight on the day after DST starts + const earlierDay = zdt.subtract({ days: 1 }); +>earlierDay : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>zdt.subtract({ days: 1 }) : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>zdt.subtract : (duration: Temporal.DurationLike, options?: Temporal.OverflowOptions) => Temporal.ZonedDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>zdt : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>subtract : (duration: Temporal.DurationLike, options?: Temporal.OverflowOptions) => Temporal.ZonedDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ days: 1 } : { days: number; } +> : ^^^^^^^^^^^^^^^^^ +>days : number +> : ^^^^^^ +>1 : 1 +> : ^ + + // => 2020-03-08T00:00:00-08:00[America/Los_Angeles] + // Note that the new offset is different, indicating the result is adjusted for DST. + earlierDay.since(zdt, { largestUnit: "hour" }).hours; +>earlierDay.since(zdt, { largestUnit: "hour" }).hours : number +> : ^^^^^^ +>earlierDay.since(zdt, { largestUnit: "hour" }) : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>earlierDay.since : (other: Temporal.ZonedDateTimeLike, options?: Temporal.RoundingOptionsWithLargestUnit) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^ +>earlierDay : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>since : (other: Temporal.ZonedDateTimeLike, options?: Temporal.RoundingOptionsWithLargestUnit) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^ +>zdt : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>{ largestUnit: "hour" } : { largestUnit: "hour"; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^ +>largestUnit : "hour" +> : ^^^^^^ +>"hour" : "hour" +> : ^^^^^^ +>hours : number +> : ^^^^^^ + + // => -23 + // because one clock hour lost to DST + + const earlierHours = zdt.subtract({ hours: 24 }); +>earlierHours : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>zdt.subtract({ hours: 24 }) : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>zdt.subtract : (duration: Temporal.DurationLike, options?: Temporal.OverflowOptions) => Temporal.ZonedDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>zdt : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>subtract : (duration: Temporal.DurationLike, options?: Temporal.OverflowOptions) => Temporal.ZonedDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ hours: 24 } : { hours: number; } +> : ^^^^^^^^^^^^^^^^^^ +>hours : number +> : ^^^^^^ +>24 : 24 +> : ^^ + + // => 2020-03-07T23:00:00-08:00[America/Los_Angeles] + // Subtracting time units doesn't adjust for DST. Result is 11:00PM: 24 real-world + // hours earlier because a clock hour was skipped by DST. + earlierHours.since(zdt, { largestUnit: "hour" }).hours; // => -24 +>earlierHours.since(zdt, { largestUnit: "hour" }).hours : number +> : ^^^^^^ +>earlierHours.since(zdt, { largestUnit: "hour" }) : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>earlierHours.since : (other: Temporal.ZonedDateTimeLike, options?: Temporal.RoundingOptionsWithLargestUnit) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^ +>earlierHours : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>since : (other: Temporal.ZonedDateTimeLike, options?: Temporal.RoundingOptionsWithLargestUnit) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^ +>zdt : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>{ largestUnit: "hour" } : { largestUnit: "hour"; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^ +>largestUnit : "hour" +> : ^^^^^^ +>"hour" : "hour" +> : ^^^^^^ +>hours : number +> : ^^^^^^ +} + +{ + const zdt1 = Temporal.ZonedDateTime.from("1995-12-07T03:24:30.000003500+05:30[Asia/Kolkata]"); +>zdt1 : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.ZonedDateTime.from("1995-12-07T03:24:30.000003500+05:30[Asia/Kolkata]") : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.ZonedDateTime.from : (item: Temporal.ZonedDateTimeLike, options?: Temporal.ZonedDateTimeFromOptions) => Temporal.ZonedDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.ZonedDateTime : Temporal.ZonedDateTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>ZonedDateTime : Temporal.ZonedDateTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.ZonedDateTimeLike, options?: Temporal.ZonedDateTimeFromOptions) => Temporal.ZonedDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"1995-12-07T03:24:30.000003500+05:30[Asia/Kolkata]" : "1995-12-07T03:24:30.000003500+05:30[Asia/Kolkata]" +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + const zdt2 = Temporal.ZonedDateTime.from("2019-01-31T15:30+05:30[Asia/Kolkata]"); +>zdt2 : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.ZonedDateTime.from("2019-01-31T15:30+05:30[Asia/Kolkata]") : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.ZonedDateTime.from : (item: Temporal.ZonedDateTimeLike, options?: Temporal.ZonedDateTimeFromOptions) => Temporal.ZonedDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.ZonedDateTime : Temporal.ZonedDateTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>ZonedDateTime : Temporal.ZonedDateTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.ZonedDateTimeLike, options?: Temporal.ZonedDateTimeFromOptions) => Temporal.ZonedDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"2019-01-31T15:30+05:30[Asia/Kolkata]" : "2019-01-31T15:30+05:30[Asia/Kolkata]" +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + zdt1.until(zdt2); +>zdt1.until(zdt2) : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>zdt1.until : (other: Temporal.ZonedDateTimeLike, options?: Temporal.RoundingOptionsWithLargestUnit) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^ +>zdt1 : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>until : (other: Temporal.ZonedDateTimeLike, options?: Temporal.RoundingOptionsWithLargestUnit) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^ +>zdt2 : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ + + // => PT202956H5M29.9999965S + zdt1.until(zdt2, { largestUnit: "year" }); +>zdt1.until(zdt2, { largestUnit: "year" }) : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>zdt1.until : (other: Temporal.ZonedDateTimeLike, options?: Temporal.RoundingOptionsWithLargestUnit) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^ +>zdt1 : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>until : (other: Temporal.ZonedDateTimeLike, options?: Temporal.RoundingOptionsWithLargestUnit) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^ +>zdt2 : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>{ largestUnit: "year" } : { largestUnit: "year"; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^ +>largestUnit : "year" +> : ^^^^^^ +>"year" : "year" +> : ^^^^^^ + + // => P23Y1M24DT12H5M29.9999965S + zdt2.until(zdt1, { largestUnit: "year" }); +>zdt2.until(zdt1, { largestUnit: "year" }) : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>zdt2.until : (other: Temporal.ZonedDateTimeLike, options?: Temporal.RoundingOptionsWithLargestUnit) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^ +>zdt2 : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>until : (other: Temporal.ZonedDateTimeLike, options?: Temporal.RoundingOptionsWithLargestUnit) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^ +>zdt1 : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>{ largestUnit: "year" } : { largestUnit: "year"; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^ +>largestUnit : "year" +> : ^^^^^^ +>"year" : "year" +> : ^^^^^^ + + // => -P23Y1M24DT12H5M29.9999965S + zdt1.until(zdt2, { largestUnit: "nanosecond" }); +>zdt1.until(zdt2, { largestUnit: "nanosecond" }) : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>zdt1.until : (other: Temporal.ZonedDateTimeLike, options?: Temporal.RoundingOptionsWithLargestUnit) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^ +>zdt1 : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>until : (other: Temporal.ZonedDateTimeLike, options?: Temporal.RoundingOptionsWithLargestUnit) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^ +>zdt2 : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>{ largestUnit: "nanosecond" } : { largestUnit: "nanosecond"; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>largestUnit : "nanosecond" +> : ^^^^^^^^^^^^ +>"nanosecond" : "nanosecond" +> : ^^^^^^^^^^^^ + + // => PT730641929.999996544S + // (precision lost) + + // Rounding, for example if you don't care about sub-seconds + zdt1.until(zdt2, { smallestUnit: "second" }); +>zdt1.until(zdt2, { smallestUnit: "second" }) : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>zdt1.until : (other: Temporal.ZonedDateTimeLike, options?: Temporal.RoundingOptionsWithLargestUnit) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^ +>zdt1 : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>until : (other: Temporal.ZonedDateTimeLike, options?: Temporal.RoundingOptionsWithLargestUnit) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^ +>zdt2 : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>{ smallestUnit: "second" } : { smallestUnit: "second"; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>smallestUnit : "second" +> : ^^^^^^^^ +>"second" : "second" +> : ^^^^^^^^ + + // => PT202956H5M29S + + // Months and years can be different lengths + const [jan1, feb1, mar1] = [1, 2, 3].map(month => Temporal.ZonedDateTime.from({ year: 2020, month, day: 1, timeZone: "Asia/Seoul" })); +>jan1 : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>feb1 : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>mar1 : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>[1, 2, 3].map(month => Temporal.ZonedDateTime.from({ year: 2020, month, day: 1, timeZone: "Asia/Seoul" })) : Temporal.ZonedDateTime[] +> : ^^^^^^^^^^^^^^^^^^^^^^^^ +>[1, 2, 3].map : (callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any) => U[] +> : ^ ^^ ^^^ ^^^^^^^^^^ ^^ ^^ ^^^^^^^^^^^^^^^^^^ ^^^ ^^^^^^^^ +>[1, 2, 3] : number[] +> : ^^^^^^^^ +>1 : 1 +> : ^ +>2 : 2 +> : ^ +>3 : 3 +> : ^ +>map : (callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any) => U[] +> : ^ ^^ ^^^ ^^^^^^^^^^ ^^ ^^ ^^^^^^^^^^^^^^^^^^ ^^^ ^^^^^^^^ +>month => Temporal.ZonedDateTime.from({ year: 2020, month, day: 1, timeZone: "Asia/Seoul" }) : (month: number) => Temporal.ZonedDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>month : number +> : ^^^^^^ +>Temporal.ZonedDateTime.from({ year: 2020, month, day: 1, timeZone: "Asia/Seoul" }) : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.ZonedDateTime.from : (item: Temporal.ZonedDateTimeLike, options?: Temporal.ZonedDateTimeFromOptions) => Temporal.ZonedDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.ZonedDateTime : Temporal.ZonedDateTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>ZonedDateTime : Temporal.ZonedDateTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.ZonedDateTimeLike, options?: Temporal.ZonedDateTimeFromOptions) => Temporal.ZonedDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ year: 2020, month, day: 1, timeZone: "Asia/Seoul" } : { year: number; month: number; day: number; timeZone: string; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>year : number +> : ^^^^^^ +>2020 : 2020 +> : ^^^^ +>month : number +> : ^^^^^^ +>day : number +> : ^^^^^^ +>1 : 1 +> : ^ +>timeZone : string +> : ^^^^^^ +>"Asia/Seoul" : "Asia/Seoul" +> : ^^^^^^^^^^^^ + + jan1.until(feb1, { largestUnit: "day" }); // => P31D +>jan1.until(feb1, { largestUnit: "day" }) : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>jan1.until : (other: Temporal.ZonedDateTimeLike, options?: Temporal.RoundingOptionsWithLargestUnit) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^ +>jan1 : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>until : (other: Temporal.ZonedDateTimeLike, options?: Temporal.RoundingOptionsWithLargestUnit) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^ +>feb1 : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>{ largestUnit: "day" } : { largestUnit: "day"; } +> : ^^^^^^^^^^^^^^^^^^^^^^^ +>largestUnit : "day" +> : ^^^^^ +>"day" : "day" +> : ^^^^^ + + jan1.until(feb1, { largestUnit: "month" }); // => P1M +>jan1.until(feb1, { largestUnit: "month" }) : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>jan1.until : (other: Temporal.ZonedDateTimeLike, options?: Temporal.RoundingOptionsWithLargestUnit) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^ +>jan1 : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>until : (other: Temporal.ZonedDateTimeLike, options?: Temporal.RoundingOptionsWithLargestUnit) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^ +>feb1 : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>{ largestUnit: "month" } : { largestUnit: "month"; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^ +>largestUnit : "month" +> : ^^^^^^^ +>"month" : "month" +> : ^^^^^^^ + + feb1.until(mar1, { largestUnit: "day" }); // => P29D +>feb1.until(mar1, { largestUnit: "day" }) : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>feb1.until : (other: Temporal.ZonedDateTimeLike, options?: Temporal.RoundingOptionsWithLargestUnit) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^ +>feb1 : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>until : (other: Temporal.ZonedDateTimeLike, options?: Temporal.RoundingOptionsWithLargestUnit) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^ +>mar1 : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>{ largestUnit: "day" } : { largestUnit: "day"; } +> : ^^^^^^^^^^^^^^^^^^^^^^^ +>largestUnit : "day" +> : ^^^^^ +>"day" : "day" +> : ^^^^^ + + feb1.until(mar1, { largestUnit: "month" }); // => P1M +>feb1.until(mar1, { largestUnit: "month" }) : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>feb1.until : (other: Temporal.ZonedDateTimeLike, options?: Temporal.RoundingOptionsWithLargestUnit) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^ +>feb1 : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>until : (other: Temporal.ZonedDateTimeLike, options?: Temporal.RoundingOptionsWithLargestUnit) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^ +>mar1 : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>{ largestUnit: "month" } : { largestUnit: "month"; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^ +>largestUnit : "month" +> : ^^^^^^^ +>"month" : "month" +> : ^^^^^^^ + + jan1.until(mar1, { largestUnit: "day" }); // => P60D +>jan1.until(mar1, { largestUnit: "day" }) : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>jan1.until : (other: Temporal.ZonedDateTimeLike, options?: Temporal.RoundingOptionsWithLargestUnit) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^ +>jan1 : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>until : (other: Temporal.ZonedDateTimeLike, options?: Temporal.RoundingOptionsWithLargestUnit) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^ +>mar1 : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>{ largestUnit: "day" } : { largestUnit: "day"; } +> : ^^^^^^^^^^^^^^^^^^^^^^^ +>largestUnit : "day" +> : ^^^^^ +>"day" : "day" +> : ^^^^^ +} + +{ + const zdt1 = Temporal.ZonedDateTime.from("1995-12-07T03:24:30.000003500+05:30[Asia/Kolkata]"); +>zdt1 : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.ZonedDateTime.from("1995-12-07T03:24:30.000003500+05:30[Asia/Kolkata]") : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.ZonedDateTime.from : (item: Temporal.ZonedDateTimeLike, options?: Temporal.ZonedDateTimeFromOptions) => Temporal.ZonedDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.ZonedDateTime : Temporal.ZonedDateTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>ZonedDateTime : Temporal.ZonedDateTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.ZonedDateTimeLike, options?: Temporal.ZonedDateTimeFromOptions) => Temporal.ZonedDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"1995-12-07T03:24:30.000003500+05:30[Asia/Kolkata]" : "1995-12-07T03:24:30.000003500+05:30[Asia/Kolkata]" +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + const zdt2 = Temporal.ZonedDateTime.from("2019-01-31T15:30+05:30[Asia/Kolkata]"); +>zdt2 : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.ZonedDateTime.from("2019-01-31T15:30+05:30[Asia/Kolkata]") : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.ZonedDateTime.from : (item: Temporal.ZonedDateTimeLike, options?: Temporal.ZonedDateTimeFromOptions) => Temporal.ZonedDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.ZonedDateTime : Temporal.ZonedDateTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>ZonedDateTime : Temporal.ZonedDateTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.ZonedDateTimeLike, options?: Temporal.ZonedDateTimeFromOptions) => Temporal.ZonedDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"2019-01-31T15:30+05:30[Asia/Kolkata]" : "2019-01-31T15:30+05:30[Asia/Kolkata]" +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + zdt2.since(zdt1); // => PT202956H5M29.9999965S +>zdt2.since(zdt1) : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>zdt2.since : (other: Temporal.ZonedDateTimeLike, options?: Temporal.RoundingOptionsWithLargestUnit) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^ +>zdt2 : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>since : (other: Temporal.ZonedDateTimeLike, options?: Temporal.RoundingOptionsWithLargestUnit) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^ +>zdt1 : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +} + +{ + const zdt = Temporal.ZonedDateTime.from("1995-12-07T03:24:30.000003500-08:00[America/Los_Angeles]"); +>zdt : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.ZonedDateTime.from("1995-12-07T03:24:30.000003500-08:00[America/Los_Angeles]") : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.ZonedDateTime.from : (item: Temporal.ZonedDateTimeLike, options?: Temporal.ZonedDateTimeFromOptions) => Temporal.ZonedDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.ZonedDateTime : Temporal.ZonedDateTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>ZonedDateTime : Temporal.ZonedDateTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.ZonedDateTimeLike, options?: Temporal.ZonedDateTimeFromOptions) => Temporal.ZonedDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"1995-12-07T03:24:30.000003500-08:00[America/Los_Angeles]" : "1995-12-07T03:24:30.000003500-08:00[America/Los_Angeles]" +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + // Round to a particular unit + zdt.round({ smallestUnit: "hour" }); +>zdt.round({ smallestUnit: "hour" }) : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>zdt.round : { (roundTo: "day" | "days" | Temporal.TimeUnit): Temporal.ZonedDateTime; (roundTo: Temporal.RoundingOptions<"day" | "days" | Temporal.TimeUnit>): Temporal.ZonedDateTime; } +> : ^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>zdt : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>round : { (roundTo: "day" | "days" | Temporal.TimeUnit): Temporal.ZonedDateTime; (roundTo: Temporal.RoundingOptions<"day" | "days" | Temporal.TimeUnit>): Temporal.ZonedDateTime; } +> : ^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ smallestUnit: "hour" } : { smallestUnit: "hour"; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^ +>smallestUnit : "hour" +> : ^^^^^^ +>"hour" : "hour" +> : ^^^^^^ + + // => 1995-12-07T03:00:00-08:00[America/Los_Angeles] + // Round to an increment of a unit, e.g. half an hour: + zdt.round({ roundingIncrement: 30, smallestUnit: "minute" }); +>zdt.round({ roundingIncrement: 30, smallestUnit: "minute" }) : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>zdt.round : { (roundTo: "day" | "days" | Temporal.TimeUnit): Temporal.ZonedDateTime; (roundTo: Temporal.RoundingOptions<"day" | "days" | Temporal.TimeUnit>): Temporal.ZonedDateTime; } +> : ^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>zdt : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>round : { (roundTo: "day" | "days" | Temporal.TimeUnit): Temporal.ZonedDateTime; (roundTo: Temporal.RoundingOptions<"day" | "days" | Temporal.TimeUnit>): Temporal.ZonedDateTime; } +> : ^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ roundingIncrement: 30, smallestUnit: "minute" } : { roundingIncrement: number; smallestUnit: "minute"; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>roundingIncrement : number +> : ^^^^^^ +>30 : 30 +> : ^^ +>smallestUnit : "minute" +> : ^^^^^^^^ +>"minute" : "minute" +> : ^^^^^^^^ + + // => 1995-12-07T03:30:00-08:00[America/Los_Angeles] + // Round to the same increment but round down instead: + zdt.round({ roundingIncrement: 30, smallestUnit: "minute", roundingMode: "floor" }); +>zdt.round({ roundingIncrement: 30, smallestUnit: "minute", roundingMode: "floor" }) : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>zdt.round : { (roundTo: "day" | "days" | Temporal.TimeUnit): Temporal.ZonedDateTime; (roundTo: Temporal.RoundingOptions<"day" | "days" | Temporal.TimeUnit>): Temporal.ZonedDateTime; } +> : ^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>zdt : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>round : { (roundTo: "day" | "days" | Temporal.TimeUnit): Temporal.ZonedDateTime; (roundTo: Temporal.RoundingOptions<"day" | "days" | Temporal.TimeUnit>): Temporal.ZonedDateTime; } +> : ^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ roundingIncrement: 30, smallestUnit: "minute", roundingMode: "floor" } : { roundingIncrement: number; smallestUnit: "minute"; roundingMode: "floor"; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>roundingIncrement : number +> : ^^^^^^ +>30 : 30 +> : ^^ +>smallestUnit : "minute" +> : ^^^^^^^^ +>"minute" : "minute" +> : ^^^^^^^^ +>roundingMode : "floor" +> : ^^^^^^^ +>"floor" : "floor" +> : ^^^^^^^ + + // => 1995-12-07T03:00:00-08:00[America/Los_Angeles] +} + +{ + const zdt = Temporal.ZonedDateTime.from("2015-10-18T12:00-02:00[America/Sao_Paulo]"); +>zdt : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.ZonedDateTime.from("2015-10-18T12:00-02:00[America/Sao_Paulo]") : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.ZonedDateTime.from : (item: Temporal.ZonedDateTimeLike, options?: Temporal.ZonedDateTimeFromOptions) => Temporal.ZonedDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.ZonedDateTime : Temporal.ZonedDateTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>ZonedDateTime : Temporal.ZonedDateTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.ZonedDateTimeLike, options?: Temporal.ZonedDateTimeFromOptions) => Temporal.ZonedDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"2015-10-18T12:00-02:00[America/Sao_Paulo]" : "2015-10-18T12:00-02:00[America/Sao_Paulo]" +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + zdt.startOfDay(); // => 2015-10-18T01:00:00-02:00[America/Sao_Paulo] +>zdt.startOfDay() : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>zdt.startOfDay : () => Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>zdt : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>startOfDay : () => Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +} + +{ + let duration: Temporal.Duration; +>duration : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>Temporal : any +> : ^^^ + + // How long until the next offset change from now, in the current location? + const tz = Temporal.Now.timeZoneId(); +>tz : string +> : ^^^^^^ +>Temporal.Now.timeZoneId() : string +> : ^^^^^^ +>Temporal.Now.timeZoneId : () => string +> : ^^^^^^ +>Temporal.Now : typeof Temporal.Now +> : ^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>Now : typeof Temporal.Now +> : ^^^^^^^^^^^^^^^^^^^ +>timeZoneId : () => string +> : ^^^^^^ + + const now = Temporal.Now.zonedDateTimeISO(tz); +>now : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.Now.zonedDateTimeISO(tz) : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.Now.zonedDateTimeISO : (timeZone?: Temporal.TimeZoneLike) => Temporal.ZonedDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.Now : typeof Temporal.Now +> : ^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>Now : typeof Temporal.Now +> : ^^^^^^^^^^^^^^^^^^^ +>zonedDateTimeISO : (timeZone?: Temporal.TimeZoneLike) => Temporal.ZonedDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>tz : string +> : ^^^^^^ + + const nextTransition = now.getTimeZoneTransition("next"); +>nextTransition : Temporal.ZonedDateTime | null +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>now.getTimeZoneTransition("next") : Temporal.ZonedDateTime | null +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>now.getTimeZoneTransition : { (direction: "next" | "previous"): Temporal.ZonedDateTime | null; (direction: Temporal.TransitionOptions): Temporal.ZonedDateTime | null; } +> : ^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^ +>now : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>getTimeZoneTransition : { (direction: "next" | "previous"): Temporal.ZonedDateTime | null; (direction: Temporal.TransitionOptions): Temporal.ZonedDateTime | null; } +> : ^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^ +>"next" : "next" +> : ^^^^^^ + + duration = nextTransition!.since(now); +>duration = nextTransition!.since(now) : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>duration : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>nextTransition!.since(now) : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>nextTransition!.since : (other: Temporal.ZonedDateTimeLike, options?: Temporal.RoundingOptionsWithLargestUnit) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^ +>nextTransition! : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>nextTransition : Temporal.ZonedDateTime | null +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>since : (other: Temporal.ZonedDateTimeLike, options?: Temporal.RoundingOptionsWithLargestUnit) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^ +>now : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ + + duration.toLocaleString(); // output will vary +>duration.toLocaleString() : string +> : ^^^^^^ +>duration.toLocaleString : (locales?: Intl.LocalesArgument, options?: Intl.DurationFormatOptions) => string +> : ^ ^^^ ^^ ^^^ ^^^^^ +>duration : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>toLocaleString : (locales?: Intl.LocalesArgument, options?: Intl.DurationFormatOptions) => string +> : ^ ^^^ ^^ ^^^ ^^^^^ + + // How long until the previous offset change from now, in the current location? + const previousTransition = now.getTimeZoneTransition("previous"); +>previousTransition : Temporal.ZonedDateTime | null +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>now.getTimeZoneTransition("previous") : Temporal.ZonedDateTime | null +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>now.getTimeZoneTransition : { (direction: "next" | "previous"): Temporal.ZonedDateTime | null; (direction: Temporal.TransitionOptions): Temporal.ZonedDateTime | null; } +> : ^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^ +>now : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>getTimeZoneTransition : { (direction: "next" | "previous"): Temporal.ZonedDateTime | null; (direction: Temporal.TransitionOptions): Temporal.ZonedDateTime | null; } +> : ^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^ +>"previous" : "previous" +> : ^^^^^^^^^^ + + duration = now.since(previousTransition!); +>duration = now.since(previousTransition!) : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>duration : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>now.since(previousTransition!) : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>now.since : (other: Temporal.ZonedDateTimeLike, options?: Temporal.RoundingOptionsWithLargestUnit) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^ +>now : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>since : (other: Temporal.ZonedDateTimeLike, options?: Temporal.RoundingOptionsWithLargestUnit) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^ +>previousTransition! : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>previousTransition : Temporal.ZonedDateTime | null +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + duration.toLocaleString(); // output will vary +>duration.toLocaleString() : string +> : ^^^^^^ +>duration.toLocaleString : (locales?: Intl.LocalesArgument, options?: Intl.DurationFormatOptions) => string +> : ^ ^^^ ^^ ^^^ ^^^^^ +>duration : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>toLocaleString : (locales?: Intl.LocalesArgument, options?: Intl.DurationFormatOptions) => string +> : ^ ^^^ ^^ ^^^ ^^^^^ +} + +{ + const zdt1 = Temporal.ZonedDateTime.from("1995-12-07T03:24:30.000003500+01:00[Europe/Paris]"); +>zdt1 : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.ZonedDateTime.from("1995-12-07T03:24:30.000003500+01:00[Europe/Paris]") : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.ZonedDateTime.from : (item: Temporal.ZonedDateTimeLike, options?: Temporal.ZonedDateTimeFromOptions) => Temporal.ZonedDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.ZonedDateTime : Temporal.ZonedDateTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>ZonedDateTime : Temporal.ZonedDateTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.ZonedDateTimeLike, options?: Temporal.ZonedDateTimeFromOptions) => Temporal.ZonedDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"1995-12-07T03:24:30.000003500+01:00[Europe/Paris]" : "1995-12-07T03:24:30.000003500+01:00[Europe/Paris]" +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + const zdt2 = Temporal.ZonedDateTime.from("1995-12-07T03:24:30.000003500+01:00[Europe/Brussels]"); +>zdt2 : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.ZonedDateTime.from("1995-12-07T03:24:30.000003500+01:00[Europe/Brussels]") : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.ZonedDateTime.from : (item: Temporal.ZonedDateTimeLike, options?: Temporal.ZonedDateTimeFromOptions) => Temporal.ZonedDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.ZonedDateTime : Temporal.ZonedDateTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>ZonedDateTime : Temporal.ZonedDateTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.ZonedDateTimeLike, options?: Temporal.ZonedDateTimeFromOptions) => Temporal.ZonedDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"1995-12-07T03:24:30.000003500+01:00[Europe/Brussels]" : "1995-12-07T03:24:30.000003500+01:00[Europe/Brussels]" +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + zdt1.equals(zdt2); // => false (same offset but different time zones) +>zdt1.equals(zdt2) : boolean +> : ^^^^^^^ +>zdt1.equals : (other: Temporal.ZonedDateTimeLike) => boolean +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>zdt1 : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>equals : (other: Temporal.ZonedDateTimeLike) => boolean +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>zdt2 : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ + + zdt1.equals(zdt1); // => true +>zdt1.equals(zdt1) : boolean +> : ^^^^^^^ +>zdt1.equals : (other: Temporal.ZonedDateTimeLike) => boolean +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>zdt1 : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>equals : (other: Temporal.ZonedDateTimeLike) => boolean +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>zdt1 : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ + + // To compare time zone IDs, use withTimeZone() with each ID on the same + // ZonedDateTime instance, and use equals() to compare + const kolkata = zdt1.withTimeZone("Asia/Kolkata"); +>kolkata : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>zdt1.withTimeZone("Asia/Kolkata") : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>zdt1.withTimeZone : (timeZone: Temporal.TimeZoneLike) => Temporal.ZonedDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>zdt1 : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>withTimeZone : (timeZone: Temporal.TimeZoneLike) => Temporal.ZonedDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"Asia/Kolkata" : "Asia/Kolkata" +> : ^^^^^^^^^^^^^^ + + kolkata.equals(zdt1.withTimeZone("Asia/Calcutta")); // => true +>kolkata.equals(zdt1.withTimeZone("Asia/Calcutta")) : boolean +> : ^^^^^^^ +>kolkata.equals : (other: Temporal.ZonedDateTimeLike) => boolean +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>kolkata : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>equals : (other: Temporal.ZonedDateTimeLike) => boolean +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>zdt1.withTimeZone("Asia/Calcutta") : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>zdt1.withTimeZone : (timeZone: Temporal.TimeZoneLike) => Temporal.ZonedDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>zdt1 : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>withTimeZone : (timeZone: Temporal.TimeZoneLike) => Temporal.ZonedDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"Asia/Calcutta" : "Asia/Calcutta" +> : ^^^^^^^^^^^^^^^ + + // Offset time zones are never equivalent to named time zones + kolkata.equals(zdt1.withTimeZone("+05:30")); // => false +>kolkata.equals(zdt1.withTimeZone("+05:30")) : boolean +> : ^^^^^^^ +>kolkata.equals : (other: Temporal.ZonedDateTimeLike) => boolean +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>kolkata : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>equals : (other: Temporal.ZonedDateTimeLike) => boolean +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>zdt1.withTimeZone("+05:30") : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>zdt1.withTimeZone : (timeZone: Temporal.TimeZoneLike) => Temporal.ZonedDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>zdt1 : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>withTimeZone : (timeZone: Temporal.TimeZoneLike) => Temporal.ZonedDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"+05:30" : "+05:30" +> : ^^^^^^^^ + + const zeroOffset = zdt1.withTimeZone("+00:00"); +>zeroOffset : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>zdt1.withTimeZone("+00:00") : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>zdt1.withTimeZone : (timeZone: Temporal.TimeZoneLike) => Temporal.ZonedDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>zdt1 : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>withTimeZone : (timeZone: Temporal.TimeZoneLike) => Temporal.ZonedDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"+00:00" : "+00:00" +> : ^^^^^^^^ + + zeroOffset.equals(zdt1.withTimeZone("UTC")); // => false +>zeroOffset.equals(zdt1.withTimeZone("UTC")) : boolean +> : ^^^^^^^ +>zeroOffset.equals : (other: Temporal.ZonedDateTimeLike) => boolean +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>zeroOffset : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>equals : (other: Temporal.ZonedDateTimeLike) => boolean +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>zdt1.withTimeZone("UTC") : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>zdt1.withTimeZone : (timeZone: Temporal.TimeZoneLike) => Temporal.ZonedDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>zdt1 : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>withTimeZone : (timeZone: Temporal.TimeZoneLike) => Temporal.ZonedDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"UTC" : "UTC" +> : ^^^^^ + + // For offset time zones, any valid format is accepted + zeroOffset.equals(zdt1.withTimeZone("+00:00")); // => true +>zeroOffset.equals(zdt1.withTimeZone("+00:00")) : boolean +> : ^^^^^^^ +>zeroOffset.equals : (other: Temporal.ZonedDateTimeLike) => boolean +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>zeroOffset : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>equals : (other: Temporal.ZonedDateTimeLike) => boolean +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>zdt1.withTimeZone("+00:00") : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>zdt1.withTimeZone : (timeZone: Temporal.TimeZoneLike) => Temporal.ZonedDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>zdt1 : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>withTimeZone : (timeZone: Temporal.TimeZoneLike) => Temporal.ZonedDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"+00:00" : "+00:00" +> : ^^^^^^^^ + + zeroOffset.equals(zdt1.withTimeZone("+0000")); // => true +>zeroOffset.equals(zdt1.withTimeZone("+0000")) : boolean +> : ^^^^^^^ +>zeroOffset.equals : (other: Temporal.ZonedDateTimeLike) => boolean +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>zeroOffset : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>equals : (other: Temporal.ZonedDateTimeLike) => boolean +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>zdt1.withTimeZone("+0000") : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>zdt1.withTimeZone : (timeZone: Temporal.TimeZoneLike) => Temporal.ZonedDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>zdt1 : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>withTimeZone : (timeZone: Temporal.TimeZoneLike) => Temporal.ZonedDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"+0000" : "+0000" +> : ^^^^^^^ + + zeroOffset.equals(zdt1.withTimeZone("+00")); // => true +>zeroOffset.equals(zdt1.withTimeZone("+00")) : boolean +> : ^^^^^^^ +>zeroOffset.equals : (other: Temporal.ZonedDateTimeLike) => boolean +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>zeroOffset : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>equals : (other: Temporal.ZonedDateTimeLike) => boolean +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>zdt1.withTimeZone("+00") : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>zdt1.withTimeZone : (timeZone: Temporal.TimeZoneLike) => Temporal.ZonedDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>zdt1 : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>withTimeZone : (timeZone: Temporal.TimeZoneLike) => Temporal.ZonedDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"+00" : "+00" +> : ^^^^^ +} + +{ + let zdt: Temporal.ZonedDateTime; +>zdt : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : any +> : ^^^ + + zdt = Temporal.ZonedDateTime.from({ year: 2019, month: 12, day: 1, hour: 12, timeZone: "Africa/Lagos" }); +>zdt = Temporal.ZonedDateTime.from({ year: 2019, month: 12, day: 1, hour: 12, timeZone: "Africa/Lagos" }) : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>zdt : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.ZonedDateTime.from({ year: 2019, month: 12, day: 1, hour: 12, timeZone: "Africa/Lagos" }) : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.ZonedDateTime.from : (item: Temporal.ZonedDateTimeLike, options?: Temporal.ZonedDateTimeFromOptions) => Temporal.ZonedDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.ZonedDateTime : Temporal.ZonedDateTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>ZonedDateTime : Temporal.ZonedDateTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.ZonedDateTimeLike, options?: Temporal.ZonedDateTimeFromOptions) => Temporal.ZonedDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ year: 2019, month: 12, day: 1, hour: 12, timeZone: "Africa/Lagos" } : { year: number; month: number; day: number; hour: number; timeZone: string; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>year : number +> : ^^^^^^ +>2019 : 2019 +> : ^^^^ +>month : number +> : ^^^^^^ +>12 : 12 +> : ^^ +>day : number +> : ^^^^^^ +>1 : 1 +> : ^ +>hour : number +> : ^^^^^^ +>12 : 12 +> : ^^ +>timeZone : string +> : ^^^^^^ +>"Africa/Lagos" : "Africa/Lagos" +> : ^^^^^^^^^^^^^^ + + zdt.toString(); // => '2019-12-01T12:00:00+01:00[Africa/Lagos]' +>zdt.toString() : string +> : ^^^^^^ +>zdt.toString : (options?: Temporal.ZonedDateTimeToStringOptions) => string +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>zdt : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>toString : (options?: Temporal.ZonedDateTimeToStringOptions) => string +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + zdt = zdt.withCalendar("japanese"); +>zdt = zdt.withCalendar("japanese") : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>zdt : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>zdt.withCalendar("japanese") : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>zdt.withCalendar : (calendar: Temporal.CalendarLike) => Temporal.ZonedDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>zdt : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>withCalendar : (calendar: Temporal.CalendarLike) => Temporal.ZonedDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"japanese" : "japanese" +> : ^^^^^^^^^^ + + zdt.toString(); // => '2019-12-01T12:00:00+01:00[Africa/Lagos][u-ca=japanese]' +>zdt.toString() : string +> : ^^^^^^ +>zdt.toString : (options?: Temporal.ZonedDateTimeToStringOptions) => string +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>zdt : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>toString : (options?: Temporal.ZonedDateTimeToStringOptions) => string +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +} + +{ + const zdt = Temporal.ZonedDateTime.from("2019-12-01T12:00+01:00[Europe/Berlin]"); +>zdt : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.ZonedDateTime.from("2019-12-01T12:00+01:00[Europe/Berlin]") : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.ZonedDateTime.from : (item: Temporal.ZonedDateTimeLike, options?: Temporal.ZonedDateTimeFromOptions) => Temporal.ZonedDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.ZonedDateTime : Temporal.ZonedDateTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>ZonedDateTime : Temporal.ZonedDateTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.ZonedDateTimeLike, options?: Temporal.ZonedDateTimeFromOptions) => Temporal.ZonedDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"2019-12-01T12:00+01:00[Europe/Berlin]" : "2019-12-01T12:00+01:00[Europe/Berlin]" +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + zdt.toLocaleString(); // example output: 12/1/2019, 12:00:00 PM +>zdt.toLocaleString() : string +> : ^^^^^^ +>zdt.toLocaleString : (locales?: Intl.LocalesArgument, options?: Intl.DateTimeFormatOptions) => string +> : ^ ^^^ ^^ ^^^ ^^^^^ +>zdt : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>toLocaleString : (locales?: Intl.LocalesArgument, options?: Intl.DateTimeFormatOptions) => string +> : ^ ^^^ ^^ ^^^ ^^^^^ + + zdt.toLocaleString("de-DE"); // => '1.12.2019, 12:00:00 MEZ' +>zdt.toLocaleString("de-DE") : string +> : ^^^^^^ +>zdt.toLocaleString : (locales?: Intl.LocalesArgument, options?: Intl.DateTimeFormatOptions) => string +> : ^ ^^^ ^^ ^^^ ^^^^^ +>zdt : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>toLocaleString : (locales?: Intl.LocalesArgument, options?: Intl.DateTimeFormatOptions) => string +> : ^ ^^^ ^^ ^^^ ^^^^^ +>"de-DE" : "de-DE" +> : ^^^^^^^ + + const options = { weekday: "long", year: "numeric", month: "long", day: "numeric" } as const; +>options : { readonly weekday: "long"; readonly year: "numeric"; readonly month: "long"; readonly day: "numeric"; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ weekday: "long", year: "numeric", month: "long", day: "numeric" } as const : { readonly weekday: "long"; readonly year: "numeric"; readonly month: "long"; readonly day: "numeric"; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ weekday: "long", year: "numeric", month: "long", day: "numeric" } : { readonly weekday: "long"; readonly year: "numeric"; readonly month: "long"; readonly day: "numeric"; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>weekday : "long" +> : ^^^^^^ +>"long" : "long" +> : ^^^^^^ +>year : "numeric" +> : ^^^^^^^^^ +>"numeric" : "numeric" +> : ^^^^^^^^^ +>month : "long" +> : ^^^^^^ +>"long" : "long" +> : ^^^^^^ +>day : "numeric" +> : ^^^^^^^^^ +>"numeric" : "numeric" +> : ^^^^^^^^^ + + zdt.toLocaleString("de-DE", options); // => 'Sonntag, 1. Dezember 2019' +>zdt.toLocaleString("de-DE", options) : string +> : ^^^^^^ +>zdt.toLocaleString : (locales?: Intl.LocalesArgument, options?: Intl.DateTimeFormatOptions) => string +> : ^ ^^^ ^^ ^^^ ^^^^^ +>zdt : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>toLocaleString : (locales?: Intl.LocalesArgument, options?: Intl.DateTimeFormatOptions) => string +> : ^ ^^^ ^^ ^^^ ^^^^^ +>"de-DE" : "de-DE" +> : ^^^^^^^ +>options : { readonly weekday: "long"; readonly year: "numeric"; readonly month: "long"; readonly day: "numeric"; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + /* WRONG */ zdt.toLocaleString("de-DE", { timeZone: "Pacific/Auckland" }); +>zdt.toLocaleString("de-DE", { timeZone: "Pacific/Auckland" }) : string +> : ^^^^^^ +>zdt.toLocaleString : (locales?: Intl.LocalesArgument, options?: Intl.DateTimeFormatOptions) => string +> : ^ ^^^ ^^ ^^^ ^^^^^ +>zdt : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>toLocaleString : (locales?: Intl.LocalesArgument, options?: Intl.DateTimeFormatOptions) => string +> : ^ ^^^ ^^ ^^^ ^^^^^ +>"de-DE" : "de-DE" +> : ^^^^^^^ +>{ timeZone: "Pacific/Auckland" } : { timeZone: string; } +> : ^^^^^^^^^^^^^^^^^^^^^ +>timeZone : string +> : ^^^^^^ +>"Pacific/Auckland" : "Pacific/Auckland" +> : ^^^^^^^^^^^^^^^^^^ + + // => RangeError: Time zone option Pacific/Auckland does not match actual time zone Europe/Berlin + zdt.withTimeZone("Pacific/Auckland").toLocaleString("de-DE"); // => '2.12.2019, 0:00:00 GMT+13' +>zdt.withTimeZone("Pacific/Auckland").toLocaleString("de-DE") : string +> : ^^^^^^ +>zdt.withTimeZone("Pacific/Auckland").toLocaleString : (locales?: Intl.LocalesArgument, options?: Intl.DateTimeFormatOptions) => string +> : ^ ^^^ ^^ ^^^ ^^^^^ +>zdt.withTimeZone("Pacific/Auckland") : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>zdt.withTimeZone : (timeZone: Temporal.TimeZoneLike) => Temporal.ZonedDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>zdt : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>withTimeZone : (timeZone: Temporal.TimeZoneLike) => Temporal.ZonedDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"Pacific/Auckland" : "Pacific/Auckland" +> : ^^^^^^^^^^^^^^^^^^ +>toLocaleString : (locales?: Intl.LocalesArgument, options?: Intl.DateTimeFormatOptions) => string +> : ^ ^^^ ^^ ^^^ ^^^^^ +>"de-DE" : "de-DE" +> : ^^^^^^^ + + zdt.toLocaleString("en-US-u-nu-fullwide-hc-h12"); // => '12/1/2019, 12:00:00 PM GMT+1' +>zdt.toLocaleString("en-US-u-nu-fullwide-hc-h12") : string +> : ^^^^^^ +>zdt.toLocaleString : (locales?: Intl.LocalesArgument, options?: Intl.DateTimeFormatOptions) => string +> : ^ ^^^ ^^ ^^^ ^^^^^ +>zdt : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>toLocaleString : (locales?: Intl.LocalesArgument, options?: Intl.DateTimeFormatOptions) => string +> : ^ ^^^ ^^ ^^^ ^^^^^ +>"en-US-u-nu-fullwide-hc-h12" : "en-US-u-nu-fullwide-hc-h12" +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +} + +{ + const zdt = Temporal.ZonedDateTime.from("1995-12-07T03:24:30+02:00[Africa/Johannesburg]"); +>zdt : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.ZonedDateTime.from("1995-12-07T03:24:30+02:00[Africa/Johannesburg]") : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.ZonedDateTime.from : (item: Temporal.ZonedDateTimeLike, options?: Temporal.ZonedDateTimeFromOptions) => Temporal.ZonedDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.ZonedDateTime : Temporal.ZonedDateTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>ZonedDateTime : Temporal.ZonedDateTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.ZonedDateTimeLike, options?: Temporal.ZonedDateTimeFromOptions) => Temporal.ZonedDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"1995-12-07T03:24:30+02:00[Africa/Johannesburg]" : "1995-12-07T03:24:30+02:00[Africa/Johannesburg]" +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + zdt.toInstant(); // => 1995-12-07T01:24:30Z +>zdt.toInstant() : Temporal.Instant +> : ^^^^^^^^^^^^^^^^ +>zdt.toInstant : () => Temporal.Instant +> : ^^^^^^^^^^^^^^^^^^^^^^ +>zdt : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>toInstant : () => Temporal.Instant +> : ^^^^^^^^^^^^^^^^^^^^^^ + + zdt.toPlainDateTime(); // => 1995-12-07T03:24:30 +>zdt.toPlainDateTime() : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>zdt.toPlainDateTime : () => Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>zdt : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>toPlainDateTime : () => Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + zdt.toPlainDate(); // => 1995-12-07 +>zdt.toPlainDate() : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>zdt.toPlainDate : () => Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^^^^^^^ +>zdt : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>toPlainDate : () => Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^^^^^^^ + + zdt.toPlainTime(); // => 03:24:30 +>zdt.toPlainTime() : Temporal.PlainTime +> : ^^^^^^^^^^^^^^^^^^ +>zdt.toPlainTime : () => Temporal.PlainTime +> : ^^^^^^^^^^^^^^^^^^^^^^^^ +>zdt : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>toPlainTime : () => Temporal.PlainTime +> : ^^^^^^^^^^^^^^^^^^^^^^^^ + + zdt.toPlainDate().toPlainYearMonth(); // => 1995-12 +>zdt.toPlainDate().toPlainYearMonth() : Temporal.PlainYearMonth +> : ^^^^^^^^^^^^^^^^^^^^^^^ +>zdt.toPlainDate().toPlainYearMonth : () => Temporal.PlainYearMonth +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>zdt.toPlainDate() : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>zdt.toPlainDate : () => Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^^^^^^^ +>zdt : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>toPlainDate : () => Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^^^^^^^ +>toPlainYearMonth : () => Temporal.PlainYearMonth +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + zdt.toPlainDate().toPlainMonthDay(); // => 12-07 +>zdt.toPlainDate().toPlainMonthDay() : Temporal.PlainMonthDay +> : ^^^^^^^^^^^^^^^^^^^^^^ +>zdt.toPlainDate().toPlainMonthDay : () => Temporal.PlainMonthDay +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>zdt.toPlainDate() : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>zdt.toPlainDate : () => Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^^^^^^^ +>zdt : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>toPlainDate : () => Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^^^^^^^ +>toPlainMonthDay : () => Temporal.PlainMonthDay +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +} + +{ + // Pi day in 2020 + const date = new Temporal.PlainDate(2020, 3, 14); // => 2020-03-14 +>date : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>new Temporal.PlainDate(2020, 3, 14) : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDate : Temporal.PlainDateConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>PlainDate : Temporal.PlainDateConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>2020 : 2020 +> : ^^^^ +>3 : 3 +> : ^ +>14 : 14 +> : ^^ +} + +{ + let date: Temporal.PlainDate; +>date : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>Temporal : any +> : ^^^ + + date = Temporal.PlainDate.from("2006-08-24"); // => 2006-08-24 +>date = Temporal.PlainDate.from("2006-08-24") : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>date : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDate.from("2006-08-24") : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDate.from : (item: Temporal.PlainDateLike, options?: Temporal.OverflowOptions) => Temporal.PlainDate +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDate : Temporal.PlainDateConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>PlainDate : Temporal.PlainDateConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.PlainDateLike, options?: Temporal.OverflowOptions) => Temporal.PlainDate +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"2006-08-24" : "2006-08-24" +> : ^^^^^^^^^^^^ + + date = Temporal.PlainDate.from("20060824"); // => 2006-08-24 +>date = Temporal.PlainDate.from("20060824") : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>date : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDate.from("20060824") : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDate.from : (item: Temporal.PlainDateLike, options?: Temporal.OverflowOptions) => Temporal.PlainDate +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDate : Temporal.PlainDateConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>PlainDate : Temporal.PlainDateConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.PlainDateLike, options?: Temporal.OverflowOptions) => Temporal.PlainDate +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"20060824" : "20060824" +> : ^^^^^^^^^^ + + date = Temporal.PlainDate.from("2006-08-24T15:43:27"); // => 2006-08-24 +>date = Temporal.PlainDate.from("2006-08-24T15:43:27") : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>date : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDate.from("2006-08-24T15:43:27") : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDate.from : (item: Temporal.PlainDateLike, options?: Temporal.OverflowOptions) => Temporal.PlainDate +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDate : Temporal.PlainDateConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>PlainDate : Temporal.PlainDateConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.PlainDateLike, options?: Temporal.OverflowOptions) => Temporal.PlainDate +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"2006-08-24T15:43:27" : "2006-08-24T15:43:27" +> : ^^^^^^^^^^^^^^^^^^^^^ + + date = Temporal.PlainDate.from("2006-08-24T15:43:27+01:00[Europe/Brussels]"); +>date = Temporal.PlainDate.from("2006-08-24T15:43:27+01:00[Europe/Brussels]") : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>date : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDate.from("2006-08-24T15:43:27+01:00[Europe/Brussels]") : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDate.from : (item: Temporal.PlainDateLike, options?: Temporal.OverflowOptions) => Temporal.PlainDate +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDate : Temporal.PlainDateConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>PlainDate : Temporal.PlainDateConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.PlainDateLike, options?: Temporal.OverflowOptions) => Temporal.PlainDate +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"2006-08-24T15:43:27+01:00[Europe/Brussels]" : "2006-08-24T15:43:27+01:00[Europe/Brussels]" +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + // => 2006-08-24 + date === Temporal.PlainDate.from(date); // => false +>date === Temporal.PlainDate.from(date) : boolean +> : ^^^^^^^ +>date : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDate.from(date) : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDate.from : (item: Temporal.PlainDateLike, options?: Temporal.OverflowOptions) => Temporal.PlainDate +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDate : Temporal.PlainDateConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>PlainDate : Temporal.PlainDateConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.PlainDateLike, options?: Temporal.OverflowOptions) => Temporal.PlainDate +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>date : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ + + date = Temporal.PlainDate.from({ year: 2006, month: 8, day: 24 }); // => 2006-08-24 +>date = Temporal.PlainDate.from({ year: 2006, month: 8, day: 24 }) : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>date : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDate.from({ year: 2006, month: 8, day: 24 }) : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDate.from : (item: Temporal.PlainDateLike, options?: Temporal.OverflowOptions) => Temporal.PlainDate +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDate : Temporal.PlainDateConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>PlainDate : Temporal.PlainDateConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.PlainDateLike, options?: Temporal.OverflowOptions) => Temporal.PlainDate +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ year: 2006, month: 8, day: 24 } : { year: number; month: number; day: number; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>year : number +> : ^^^^^^ +>2006 : 2006 +> : ^^^^ +>month : number +> : ^^^^^^ +>8 : 8 +> : ^ +>day : number +> : ^^^^^^ +>24 : 24 +> : ^^ + + date = Temporal.PlainDate.from(Temporal.PlainDateTime.from("2006-08-24T15:43:27")); +>date = Temporal.PlainDate.from(Temporal.PlainDateTime.from("2006-08-24T15:43:27")) : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>date : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDate.from(Temporal.PlainDateTime.from("2006-08-24T15:43:27")) : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDate.from : (item: Temporal.PlainDateLike, options?: Temporal.OverflowOptions) => Temporal.PlainDate +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDate : Temporal.PlainDateConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>PlainDate : Temporal.PlainDateConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.PlainDateLike, options?: Temporal.OverflowOptions) => Temporal.PlainDate +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDateTime.from("2006-08-24T15:43:27") : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDateTime.from : (item: Temporal.PlainDateTimeLike, options?: Temporal.OverflowOptions) => Temporal.PlainDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDateTime : Temporal.PlainDateTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>PlainDateTime : Temporal.PlainDateTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.PlainDateTimeLike, options?: Temporal.OverflowOptions) => Temporal.PlainDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"2006-08-24T15:43:27" : "2006-08-24T15:43:27" +> : ^^^^^^^^^^^^^^^^^^^^^ + + // => 2006-08-24 + // same as above; Temporal.PlainDateTime has year, month, and day properties + + date = Temporal.PlainDate.from({ year: 1427, month: 8, day: 1, calendar: "islamic" }); +>date = Temporal.PlainDate.from({ year: 1427, month: 8, day: 1, calendar: "islamic" }) : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>date : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDate.from({ year: 1427, month: 8, day: 1, calendar: "islamic" }) : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDate.from : (item: Temporal.PlainDateLike, options?: Temporal.OverflowOptions) => Temporal.PlainDate +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDate : Temporal.PlainDateConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>PlainDate : Temporal.PlainDateConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.PlainDateLike, options?: Temporal.OverflowOptions) => Temporal.PlainDate +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ year: 1427, month: 8, day: 1, calendar: "islamic" } : { year: number; month: number; day: number; calendar: string; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>year : number +> : ^^^^^^ +>1427 : 1427 +> : ^^^^ +>month : number +> : ^^^^^^ +>8 : 8 +> : ^ +>day : number +> : ^^^^^^ +>1 : 1 +> : ^ +>calendar : string +> : ^^^^^^ +>"islamic" : "islamic" +> : ^^^^^^^^^ + + // => 2006-08-24[u-ca=islamic] + + // Different overflow modes + date = Temporal.PlainDate.from({ year: 2001, month: 13, day: 1 }, { overflow: "constrain" }); +>date = Temporal.PlainDate.from({ year: 2001, month: 13, day: 1 }, { overflow: "constrain" }) : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>date : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDate.from({ year: 2001, month: 13, day: 1 }, { overflow: "constrain" }) : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDate.from : (item: Temporal.PlainDateLike, options?: Temporal.OverflowOptions) => Temporal.PlainDate +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDate : Temporal.PlainDateConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>PlainDate : Temporal.PlainDateConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.PlainDateLike, options?: Temporal.OverflowOptions) => Temporal.PlainDate +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ year: 2001, month: 13, day: 1 } : { year: number; month: number; day: number; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>year : number +> : ^^^^^^ +>2001 : 2001 +> : ^^^^ +>month : number +> : ^^^^^^ +>13 : 13 +> : ^^ +>day : number +> : ^^^^^^ +>1 : 1 +> : ^ +>{ overflow: "constrain" } : { overflow: "constrain"; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^ +>overflow : "constrain" +> : ^^^^^^^^^^^ +>"constrain" : "constrain" +> : ^^^^^^^^^^^ + + // => 2001-12-01 + date = Temporal.PlainDate.from({ year: 2001, month: 1, day: 32 }, { overflow: "constrain" }); +>date = Temporal.PlainDate.from({ year: 2001, month: 1, day: 32 }, { overflow: "constrain" }) : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>date : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDate.from({ year: 2001, month: 1, day: 32 }, { overflow: "constrain" }) : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDate.from : (item: Temporal.PlainDateLike, options?: Temporal.OverflowOptions) => Temporal.PlainDate +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDate : Temporal.PlainDateConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>PlainDate : Temporal.PlainDateConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.PlainDateLike, options?: Temporal.OverflowOptions) => Temporal.PlainDate +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ year: 2001, month: 1, day: 32 } : { year: number; month: number; day: number; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>year : number +> : ^^^^^^ +>2001 : 2001 +> : ^^^^ +>month : number +> : ^^^^^^ +>1 : 1 +> : ^ +>day : number +> : ^^^^^^ +>32 : 32 +> : ^^ +>{ overflow: "constrain" } : { overflow: "constrain"; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^ +>overflow : "constrain" +> : ^^^^^^^^^^^ +>"constrain" : "constrain" +> : ^^^^^^^^^^^ + + // => 2001-01-31 + date = Temporal.PlainDate.from({ year: 2001, month: 13, day: 1 }, { overflow: "reject" }); +>date = Temporal.PlainDate.from({ year: 2001, month: 13, day: 1 }, { overflow: "reject" }) : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>date : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDate.from({ year: 2001, month: 13, day: 1 }, { overflow: "reject" }) : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDate.from : (item: Temporal.PlainDateLike, options?: Temporal.OverflowOptions) => Temporal.PlainDate +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDate : Temporal.PlainDateConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>PlainDate : Temporal.PlainDateConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.PlainDateLike, options?: Temporal.OverflowOptions) => Temporal.PlainDate +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ year: 2001, month: 13, day: 1 } : { year: number; month: number; day: number; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>year : number +> : ^^^^^^ +>2001 : 2001 +> : ^^^^ +>month : number +> : ^^^^^^ +>13 : 13 +> : ^^ +>day : number +> : ^^^^^^ +>1 : 1 +> : ^ +>{ overflow: "reject" } : { overflow: "reject"; } +> : ^^^^^^^^^^^^^^^^^^^^^^^ +>overflow : "reject" +> : ^^^^^^^^ +>"reject" : "reject" +> : ^^^^^^^^ + + // => throws + date = Temporal.PlainDate.from({ year: 2001, month: 1, day: 32 }, { overflow: "reject" }); +>date = Temporal.PlainDate.from({ year: 2001, month: 1, day: 32 }, { overflow: "reject" }) : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>date : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDate.from({ year: 2001, month: 1, day: 32 }, { overflow: "reject" }) : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDate.from : (item: Temporal.PlainDateLike, options?: Temporal.OverflowOptions) => Temporal.PlainDate +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDate : Temporal.PlainDateConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>PlainDate : Temporal.PlainDateConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.PlainDateLike, options?: Temporal.OverflowOptions) => Temporal.PlainDate +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ year: 2001, month: 1, day: 32 } : { year: number; month: number; day: number; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>year : number +> : ^^^^^^ +>2001 : 2001 +> : ^^^^ +>month : number +> : ^^^^^^ +>1 : 1 +> : ^ +>day : number +> : ^^^^^^ +>32 : 32 +> : ^^ +>{ overflow: "reject" } : { overflow: "reject"; } +> : ^^^^^^^^^^^^^^^^^^^^^^^ +>overflow : "reject" +> : ^^^^^^^^ +>"reject" : "reject" +> : ^^^^^^^^ + + // => throws +} + +{ + const one = Temporal.PlainDate.from("2006-08-24"); +>one : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDate.from("2006-08-24") : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDate.from : (item: Temporal.PlainDateLike, options?: Temporal.OverflowOptions) => Temporal.PlainDate +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDate : Temporal.PlainDateConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>PlainDate : Temporal.PlainDateConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.PlainDateLike, options?: Temporal.OverflowOptions) => Temporal.PlainDate +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"2006-08-24" : "2006-08-24" +> : ^^^^^^^^^^^^ + + const two = Temporal.PlainDate.from("2015-07-14"); +>two : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDate.from("2015-07-14") : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDate.from : (item: Temporal.PlainDateLike, options?: Temporal.OverflowOptions) => Temporal.PlainDate +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDate : Temporal.PlainDateConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>PlainDate : Temporal.PlainDateConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.PlainDateLike, options?: Temporal.OverflowOptions) => Temporal.PlainDate +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"2015-07-14" : "2015-07-14" +> : ^^^^^^^^^^^^ + + const three = Temporal.PlainDate.from("1930-02-18"); +>three : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDate.from("1930-02-18") : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDate.from : (item: Temporal.PlainDateLike, options?: Temporal.OverflowOptions) => Temporal.PlainDate +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDate : Temporal.PlainDateConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>PlainDate : Temporal.PlainDateConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.PlainDateLike, options?: Temporal.OverflowOptions) => Temporal.PlainDate +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"1930-02-18" : "1930-02-18" +> : ^^^^^^^^^^^^ + + const sorted = [one, two, three].sort(Temporal.PlainDate.compare); +>sorted : Temporal.PlainDate[] +> : ^^^^^^^^^^^^^^^^^^^^ +>[one, two, three].sort(Temporal.PlainDate.compare) : Temporal.PlainDate[] +> : ^^^^^^^^^^^^^^^^^^^^ +>[one, two, three].sort : (compareFn?: ((a: Temporal.PlainDate, b: Temporal.PlainDate) => number) | undefined) => Temporal.PlainDate[] +> : ^ ^^^^^ ^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>[one, two, three] : Temporal.PlainDate[] +> : ^^^^^^^^^^^^^^^^^^^^ +>one : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>two : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>three : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>sort : (compareFn?: ((a: Temporal.PlainDate, b: Temporal.PlainDate) => number) | undefined) => Temporal.PlainDate[] +> : ^ ^^^^^ ^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDate.compare : (one: Temporal.PlainDateLike, two: Temporal.PlainDateLike) => number +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDate : Temporal.PlainDateConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>PlainDate : Temporal.PlainDateConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>compare : (one: Temporal.PlainDateLike, two: Temporal.PlainDateLike) => number +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + sorted.join(" "); // => '1930-02-18 2006-08-24 2015-07-14' +>sorted.join(" ") : string +> : ^^^^^^ +>sorted.join : (separator?: string) => string +> : ^ ^^^ ^^^^^ +>sorted : Temporal.PlainDate[] +> : ^^^^^^^^^^^^^^^^^^^^ +>join : (separator?: string) => string +> : ^ ^^^ ^^^^^ +>" " : " " +> : ^^^ +} + +{ + let date: Temporal.PlainDate; +>date : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>Temporal : any +> : ^^^ + + date = Temporal.PlainDate.from("2006-08-24"); +>date = Temporal.PlainDate.from("2006-08-24") : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>date : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDate.from("2006-08-24") : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDate.from : (item: Temporal.PlainDateLike, options?: Temporal.OverflowOptions) => Temporal.PlainDate +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDate : Temporal.PlainDateConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>PlainDate : Temporal.PlainDateConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.PlainDateLike, options?: Temporal.OverflowOptions) => Temporal.PlainDate +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"2006-08-24" : "2006-08-24" +> : ^^^^^^^^^^^^ + + date.year; // => 2006 +>date.year : number +> : ^^^^^^ +>date : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>year : number +> : ^^^^^^ + + date.month; // => 8 +>date.month : number +> : ^^^^^^ +>date : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>month : number +> : ^^^^^^ + + date.monthCode; // => 'M08' +>date.monthCode : string +> : ^^^^^^ +>date : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>monthCode : string +> : ^^^^^^ + + date.day; // => 24 +>date.day : number +> : ^^^^^^ +>date : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>day : number +> : ^^^^^^ + + date = Temporal.PlainDate.from("2019-02-23[u-ca=hebrew]"); +>date = Temporal.PlainDate.from("2019-02-23[u-ca=hebrew]") : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>date : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDate.from("2019-02-23[u-ca=hebrew]") : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDate.from : (item: Temporal.PlainDateLike, options?: Temporal.OverflowOptions) => Temporal.PlainDate +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDate : Temporal.PlainDateConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>PlainDate : Temporal.PlainDateConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.PlainDateLike, options?: Temporal.OverflowOptions) => Temporal.PlainDate +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"2019-02-23[u-ca=hebrew]" : "2019-02-23[u-ca=hebrew]" +> : ^^^^^^^^^^^^^^^^^^^^^^^^^ + + date.year; // => 5779 +>date.year : number +> : ^^^^^^ +>date : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>year : number +> : ^^^^^^ + + date.month; // => 6 +>date.month : number +> : ^^^^^^ +>date : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>month : number +> : ^^^^^^ + + date.monthCode; // => 'M05L' +>date.monthCode : string +> : ^^^^^^ +>date : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>monthCode : string +> : ^^^^^^ + + date.day; // => 18 +>date.day : number +> : ^^^^^^ +>date : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>day : number +> : ^^^^^^ +} + +{ + const date = Temporal.PlainDate.from("-000015-01-01[u-ca=gregory]"); +>date : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDate.from("-000015-01-01[u-ca=gregory]") : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDate.from : (item: Temporal.PlainDateLike, options?: Temporal.OverflowOptions) => Temporal.PlainDate +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDate : Temporal.PlainDateConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>PlainDate : Temporal.PlainDateConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.PlainDateLike, options?: Temporal.OverflowOptions) => Temporal.PlainDate +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"-000015-01-01[u-ca=gregory]" : "-000015-01-01[u-ca=gregory]" +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + date.era; +>date.era : string | undefined +> : ^^^^^^^^^^^^^^^^^^ +>date : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>era : string | undefined +> : ^^^^^^^^^^^^^^^^^^ + + // => 'bce' + date.eraYear; +>date.eraYear : number | undefined +> : ^^^^^^^^^^^^^^^^^^ +>date : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>eraYear : number | undefined +> : ^^^^^^^^^^^^^^^^^^ + + // => 16 + date.year; +>date.year : number +> : ^^^^^^ +>date : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>year : number +> : ^^^^^^ + + // => -15 +} + +{ + const date = Temporal.PlainDate.from("2006-08-24"); +>date : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDate.from("2006-08-24") : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDate.from : (item: Temporal.PlainDateLike, options?: Temporal.OverflowOptions) => Temporal.PlainDate +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDate : Temporal.PlainDateConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>PlainDate : Temporal.PlainDateConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.PlainDateLike, options?: Temporal.OverflowOptions) => Temporal.PlainDate +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"2006-08-24" : "2006-08-24" +> : ^^^^^^^^^^^^ + + ["MON", "TUE", "WED", "THU", "FRI", "SAT", "SUN"][date.dayOfWeek - 1]; // => 'THU' +>["MON", "TUE", "WED", "THU", "FRI", "SAT", "SUN"][date.dayOfWeek - 1] : string +> : ^^^^^^ +>["MON", "TUE", "WED", "THU", "FRI", "SAT", "SUN"] : string[] +> : ^^^^^^^^ +>"MON" : "MON" +> : ^^^^^ +>"TUE" : "TUE" +> : ^^^^^ +>"WED" : "WED" +> : ^^^^^ +>"THU" : "THU" +> : ^^^^^ +>"FRI" : "FRI" +> : ^^^^^ +>"SAT" : "SAT" +> : ^^^^^ +>"SUN" : "SUN" +> : ^^^^^ +>date.dayOfWeek - 1 : number +> : ^^^^^^ +>date.dayOfWeek : number +> : ^^^^^^ +>date : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>dayOfWeek : number +> : ^^^^^^ +>1 : 1 +> : ^ +} + +{ + const date = Temporal.PlainDate.from("2006-08-24"); +>date : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDate.from("2006-08-24") : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDate.from : (item: Temporal.PlainDateLike, options?: Temporal.OverflowOptions) => Temporal.PlainDate +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDate : Temporal.PlainDateConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>PlainDate : Temporal.PlainDateConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.PlainDateLike, options?: Temporal.OverflowOptions) => Temporal.PlainDate +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"2006-08-24" : "2006-08-24" +> : ^^^^^^^^^^^^ + + // ISO ordinal date + console.log(date.year, date.dayOfYear); // => '2006 236' +>console.log(date.year, date.dayOfYear) : void +> : ^^^^ +>console.log : (...data: any[]) => void +> : ^^^^ ^^ ^^^^^ +>console : Console +> : ^^^^^^^ +>log : (...data: any[]) => void +> : ^^^^ ^^ ^^^^^ +>date.year : number +> : ^^^^^^ +>date : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>year : number +> : ^^^^^^ +>date.dayOfYear : number +> : ^^^^^^ +>date : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>dayOfYear : number +> : ^^^^^^ +} + +{ + const date = Temporal.PlainDate.from("2022-01-01"); +>date : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDate.from("2022-01-01") : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDate.from : (item: Temporal.PlainDateLike, options?: Temporal.OverflowOptions) => Temporal.PlainDate +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDate : Temporal.PlainDateConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>PlainDate : Temporal.PlainDateConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.PlainDateLike, options?: Temporal.OverflowOptions) => Temporal.PlainDate +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"2022-01-01" : "2022-01-01" +> : ^^^^^^^^^^^^ + + // ISO week date + console.log(date.yearOfWeek, date.weekOfYear, date.dayOfWeek); // => '2021 52 6' +>console.log(date.yearOfWeek, date.weekOfYear, date.dayOfWeek) : void +> : ^^^^ +>console.log : (...data: any[]) => void +> : ^^^^ ^^ ^^^^^ +>console : Console +> : ^^^^^^^ +>log : (...data: any[]) => void +> : ^^^^ ^^ ^^^^^ +>date.yearOfWeek : number | undefined +> : ^^^^^^^^^^^^^^^^^^ +>date : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>yearOfWeek : number | undefined +> : ^^^^^^^^^^^^^^^^^^ +>date.weekOfYear : number | undefined +> : ^^^^^^^^^^^^^^^^^^ +>date : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>weekOfYear : number | undefined +> : ^^^^^^^^^^^^^^^^^^ +>date.dayOfWeek : number +> : ^^^^^^ +>date : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>dayOfWeek : number +> : ^^^^^^ +} + +{ + const date = Temporal.PlainDate.from("2006-08-24"); +>date : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDate.from("2006-08-24") : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDate.from : (item: Temporal.PlainDateLike, options?: Temporal.OverflowOptions) => Temporal.PlainDate +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDate : Temporal.PlainDateConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>PlainDate : Temporal.PlainDateConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.PlainDateLike, options?: Temporal.OverflowOptions) => Temporal.PlainDate +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"2006-08-24" : "2006-08-24" +> : ^^^^^^^^^^^^ + + date.daysInWeek; // => 7 +>date.daysInWeek : number +> : ^^^^^^ +>date : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>daysInWeek : number +> : ^^^^^^ +} + +{ + // Attempt to write some mnemonic poetry + const monthsByDays: Record = {}; +>monthsByDays : Record +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : any +> : ^^^ +>{} : {} +> : ^^ + + for (let month = 1; month <= 12; month++) { +>month : number +> : ^^^^^^ +>1 : 1 +> : ^ +>month <= 12 : boolean +> : ^^^^^^^ +>month : number +> : ^^^^^^ +>12 : 12 +> : ^^ +>month++ : number +> : ^^^^^^ +>month : number +> : ^^^^^^ + + const date = Temporal.Now.plainDateISO().with({ month }); +>date : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>Temporal.Now.plainDateISO().with({ month }) : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>Temporal.Now.plainDateISO().with : (dateLike: Temporal.PartialTemporalLike, options?: Temporal.OverflowOptions) => Temporal.PlainDate +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.Now.plainDateISO() : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>Temporal.Now.plainDateISO : (timeZone?: Temporal.TimeZoneLike) => Temporal.PlainDate +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.Now : typeof Temporal.Now +> : ^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>Now : typeof Temporal.Now +> : ^^^^^^^^^^^^^^^^^^^ +>plainDateISO : (timeZone?: Temporal.TimeZoneLike) => Temporal.PlainDate +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>with : (dateLike: Temporal.PartialTemporalLike, options?: Temporal.OverflowOptions) => Temporal.PlainDate +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ month } : { month: number; } +> : ^^^^^^^^^^^^^^^^^^ +>month : number +> : ^^^^^^ + + monthsByDays[date.daysInMonth] = (monthsByDays[date.daysInMonth] || []).concat(date); +>monthsByDays[date.daysInMonth] = (monthsByDays[date.daysInMonth] || []).concat(date) : Temporal.PlainDate[] +> : ^^^^^^^^^^^^^^^^^^^^ +>monthsByDays[date.daysInMonth] : Temporal.PlainDate[] +> : ^^^^^^^^^^^^^^^^^^^^ +>monthsByDays : Record +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>date.daysInMonth : number +> : ^^^^^^ +>date : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>daysInMonth : number +> : ^^^^^^ +>(monthsByDays[date.daysInMonth] || []).concat(date) : Temporal.PlainDate[] +> : ^^^^^^^^^^^^^^^^^^^^ +>(monthsByDays[date.daysInMonth] || []).concat : { (...items: ConcatArray[]): Temporal.PlainDate[]; (...items: (Temporal.PlainDate | ConcatArray)[]): Temporal.PlainDate[]; } +> : ^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>(monthsByDays[date.daysInMonth] || []) : Temporal.PlainDate[] +> : ^^^^^^^^^^^^^^^^^^^^ +>monthsByDays[date.daysInMonth] || [] : Temporal.PlainDate[] +> : ^^^^^^^^^^^^^^^^^^^^ +>monthsByDays[date.daysInMonth] : Temporal.PlainDate[] +> : ^^^^^^^^^^^^^^^^^^^^ +>monthsByDays : Record +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>date.daysInMonth : number +> : ^^^^^^ +>date : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>daysInMonth : number +> : ^^^^^^ +>[] : never[] +> : ^^^^^^^ +>concat : { (...items: ConcatArray[]): Temporal.PlainDate[]; (...items: (Temporal.PlainDate | ConcatArray)[]): Temporal.PlainDate[]; } +> : ^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>date : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ + } + + const strings = monthsByDays[30].map(date => date.toLocaleString("en", { month: "long" })); +>strings : string[] +> : ^^^^^^^^ +>monthsByDays[30].map(date => date.toLocaleString("en", { month: "long" })) : string[] +> : ^^^^^^^^ +>monthsByDays[30].map : (callbackfn: (value: Temporal.PlainDate, index: number, array: Temporal.PlainDate[]) => U, thisArg?: any) => U[] +> : ^ ^^ ^^^ ^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^ ^^^^^^^^ +>monthsByDays[30] : Temporal.PlainDate[] +> : ^^^^^^^^^^^^^^^^^^^^ +>monthsByDays : Record +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>30 : 30 +> : ^^ +>map : (callbackfn: (value: Temporal.PlainDate, index: number, array: Temporal.PlainDate[]) => U, thisArg?: any) => U[] +> : ^ ^^ ^^^ ^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^ ^^^^^^^^ +>date => date.toLocaleString("en", { month: "long" }) : (date: Temporal.PlainDate) => string +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>date : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>date.toLocaleString("en", { month: "long" }) : string +> : ^^^^^^ +>date.toLocaleString : (locales?: Intl.LocalesArgument, options?: Intl.DateTimeFormatOptions) => string +> : ^ ^^^ ^^ ^^^ ^^^^^ +>date : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>toLocaleString : (locales?: Intl.LocalesArgument, options?: Intl.DateTimeFormatOptions) => string +> : ^ ^^^ ^^ ^^^ ^^^^^ +>"en" : "en" +> : ^^^^ +>{ month: "long" } : { month: "long"; } +> : ^^^^^^^^^^^^^^^^^^ +>month : "long" +> : ^^^^^^ +>"long" : "long" +> : ^^^^^^ + + // Shuffle to improve poem as determined empirically + strings.unshift(strings.pop()!); +>strings.unshift(strings.pop()!) : number +> : ^^^^^^ +>strings.unshift : (...items: string[]) => number +> : ^^^^ ^^^^^^^^^^^^^^^ +>strings : string[] +> : ^^^^^^^^ +>unshift : (...items: string[]) => number +> : ^^^^ ^^^^^^^^^^^^^^^ +>strings.pop()! : string +> : ^^^^^^ +>strings.pop() : string | undefined +> : ^^^^^^^^^^^^^^^^^^ +>strings.pop : () => string | undefined +> : ^^^^^^^^^^^^^^^^^^^^^^^^ +>strings : string[] +> : ^^^^^^^^ +>pop : () => string | undefined +> : ^^^^^^^^^^^^^^^^^^^^^^^^ + + const format = new Intl.ListFormat("en"); +>format : Intl.ListFormat +> : ^^^^^^^^^^^^^^^ +>new Intl.ListFormat("en") : Intl.ListFormat +> : ^^^^^^^^^^^^^^^ +>Intl.ListFormat : { new (locales?: Intl.LocalesArgument, options?: Intl.ListFormatOptions): Intl.ListFormat; prototype: Intl.ListFormat; supportedLocalesOf(locales: Intl.LocalesArgument, options?: Pick): Intl.UnicodeBCP47LocaleIdentifier[]; } +> : ^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^ ^^^ ^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^ +>Intl : typeof Intl +> : ^^^^^^^^^^^ +>ListFormat : { new (locales?: Intl.LocalesArgument, options?: Intl.ListFormatOptions): Intl.ListFormat; prototype: Intl.ListFormat; supportedLocalesOf(locales: Intl.LocalesArgument, options?: Pick): Intl.UnicodeBCP47LocaleIdentifier[]; } +> : ^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^ ^^^ ^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^ +>"en" : "en" +> : ^^^^ + + const poem = `Thirty days hath ${format.format(strings)}`; +>poem : string +> : ^^^^^^ +>`Thirty days hath ${format.format(strings)}` : string +> : ^^^^^^ +>format.format(strings) : string +> : ^^^^^^ +>format.format : (list: Iterable) => string +> : ^ ^^ ^^^^^ +>format : Intl.ListFormat +> : ^^^^^^^^^^^^^^^ +>format : (list: Iterable) => string +> : ^ ^^ ^^^^^ +>strings : string[] +> : ^^^^^^^^ + + console.log(poem); +>console.log(poem) : void +> : ^^^^ +>console.log : (...data: any[]) => void +> : ^^^^ ^^ ^^^^^ +>console : Console +> : ^^^^^^^ +>log : (...data: any[]) => void +> : ^^^^ ^^ ^^^^^ +>poem : string +> : ^^^^^^ +} + +{ + const date = Temporal.Now.plainDateISO(); +>date : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>Temporal.Now.plainDateISO() : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>Temporal.Now.plainDateISO : (timeZone?: Temporal.TimeZoneLike) => Temporal.PlainDate +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.Now : typeof Temporal.Now +> : ^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>Now : typeof Temporal.Now +> : ^^^^^^^^^^^^^^^^^^^ +>plainDateISO : (timeZone?: Temporal.TimeZoneLike) => Temporal.PlainDate +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + const percent = date.dayOfYear / date.daysInYear; +>percent : number +> : ^^^^^^ +>date.dayOfYear / date.daysInYear : number +> : ^^^^^^ +>date.dayOfYear : number +> : ^^^^^^ +>date : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>dayOfYear : number +> : ^^^^^^ +>date.daysInYear : number +> : ^^^^^^ +>date : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>daysInYear : number +> : ^^^^^^ + + `The year is ${percent.toLocaleString("en", { style: "percent" })} over!`; +>`The year is ${percent.toLocaleString("en", { style: "percent" })} over!` : string +> : ^^^^^^ +>percent.toLocaleString("en", { style: "percent" }) : string +> : ^^^^^^ +>percent.toLocaleString : (locales?: string | string[], options?: Intl.NumberFormatOptions) => string +> : ^ ^^^ ^^ ^^^ ^^^^^ +>percent : number +> : ^^^^^^ +>toLocaleString : (locales?: string | string[], options?: Intl.NumberFormatOptions) => string +> : ^ ^^^ ^^ ^^^ ^^^^^ +>"en" : "en" +> : ^^^^ +>{ style: "percent" } : { style: "percent"; } +> : ^^^^^^^^^^^^^^^^^^^^^ +>style : "percent" +> : ^^^^^^^^^ +>"percent" : "percent" +> : ^^^^^^^^^ + + // example output: "The year is 10% over!" +} + +{ + const date = Temporal.PlainDate.from("1900-01-01"); +>date : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDate.from("1900-01-01") : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDate.from : (item: Temporal.PlainDateLike, options?: Temporal.OverflowOptions) => Temporal.PlainDate +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDate : Temporal.PlainDateConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>PlainDate : Temporal.PlainDateConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.PlainDateLike, options?: Temporal.OverflowOptions) => Temporal.PlainDate +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"1900-01-01" : "1900-01-01" +> : ^^^^^^^^^^^^ + + date.monthsInYear; // => 12 +>date.monthsInYear : number +> : ^^^^^^ +>date : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>monthsInYear : number +> : ^^^^^^ +} + +{ + // Is this year a leap year? + const date = Temporal.Now.plainDateISO(); +>date : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>Temporal.Now.plainDateISO() : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>Temporal.Now.plainDateISO : (timeZone?: Temporal.TimeZoneLike) => Temporal.PlainDate +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.Now : typeof Temporal.Now +> : ^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>Now : typeof Temporal.Now +> : ^^^^^^^^^^^^^^^^^^^ +>plainDateISO : (timeZone?: Temporal.TimeZoneLike) => Temporal.PlainDate +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + date.inLeapYear; // example output: true +>date.inLeapYear : boolean +> : ^^^^^^^ +>date : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>inLeapYear : boolean +> : ^^^^^^^ + + // Is 2100 a leap year? (no, because it's divisible by 100 and not 400) + date.with({ year: 2100 }).inLeapYear; // => false +>date.with({ year: 2100 }).inLeapYear : boolean +> : ^^^^^^^ +>date.with({ year: 2100 }) : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>date.with : (dateLike: Temporal.PartialTemporalLike, options?: Temporal.OverflowOptions) => Temporal.PlainDate +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>date : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>with : (dateLike: Temporal.PartialTemporalLike, options?: Temporal.OverflowOptions) => Temporal.PlainDate +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ year: 2100 } : { year: number; } +> : ^^^^^^^^^^^^^^^^^ +>year : number +> : ^^^^^^ +>2100 : 2100 +> : ^^^^ +>inLeapYear : boolean +> : ^^^^^^^ +} + +{ + const date = Temporal.PlainDate.from("2006-01-24"); +>date : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDate.from("2006-01-24") : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDate.from : (item: Temporal.PlainDateLike, options?: Temporal.OverflowOptions) => Temporal.PlainDate +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDate : Temporal.PlainDateConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>PlainDate : Temporal.PlainDateConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.PlainDateLike, options?: Temporal.OverflowOptions) => Temporal.PlainDate +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"2006-01-24" : "2006-01-24" +> : ^^^^^^^^^^^^ + + // What's the first day of this month? + date.with({ day: 1 }); // => 2006-01-01 +>date.with({ day: 1 }) : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>date.with : (dateLike: Temporal.PartialTemporalLike, options?: Temporal.OverflowOptions) => Temporal.PlainDate +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>date : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>with : (dateLike: Temporal.PartialTemporalLike, options?: Temporal.OverflowOptions) => Temporal.PlainDate +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ day: 1 } : { day: number; } +> : ^^^^^^^^^^^^^^^^ +>day : number +> : ^^^^^^ +>1 : 1 +> : ^ + + // What's the last day of the next month? + const nextMonthDate = date.add({ months: 1 }); +>nextMonthDate : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>date.add({ months: 1 }) : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>date.add : (duration: Temporal.DurationLike, options?: Temporal.OverflowOptions) => Temporal.PlainDate +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>date : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>add : (duration: Temporal.DurationLike, options?: Temporal.OverflowOptions) => Temporal.PlainDate +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ months: 1 } : { months: number; } +> : ^^^^^^^^^^^^^^^^^^^ +>months : number +> : ^^^^^^ +>1 : 1 +> : ^ + + nextMonthDate.with({ day: nextMonthDate.daysInMonth }); // => 2006-02-28 +>nextMonthDate.with({ day: nextMonthDate.daysInMonth }) : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>nextMonthDate.with : (dateLike: Temporal.PartialTemporalLike, options?: Temporal.OverflowOptions) => Temporal.PlainDate +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>nextMonthDate : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>with : (dateLike: Temporal.PartialTemporalLike, options?: Temporal.OverflowOptions) => Temporal.PlainDate +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ day: nextMonthDate.daysInMonth } : { day: number; } +> : ^^^^^^^^^^^^^^^^ +>day : number +> : ^^^^^^ +>nextMonthDate.daysInMonth : number +> : ^^^^^^ +>nextMonthDate : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>daysInMonth : number +> : ^^^^^^ +} + +{ + const date = Temporal.PlainDate.from("2006-08-24[u-ca=japanese]"); +>date : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDate.from("2006-08-24[u-ca=japanese]") : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDate.from : (item: Temporal.PlainDateLike, options?: Temporal.OverflowOptions) => Temporal.PlainDate +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDate : Temporal.PlainDateConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>PlainDate : Temporal.PlainDateConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.PlainDateLike, options?: Temporal.OverflowOptions) => Temporal.PlainDate +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"2006-08-24[u-ca=japanese]" : "2006-08-24[u-ca=japanese]" +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + date.withCalendar("iso8601"); // => 2006-08-24 +>date.withCalendar("iso8601") : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>date.withCalendar : (calendarLike: Temporal.CalendarLike) => Temporal.PlainDate +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>date : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>withCalendar : (calendarLike: Temporal.CalendarLike) => Temporal.PlainDate +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"iso8601" : "iso8601" +> : ^^^^^^^^^ +} + +{ + let date: Temporal.PlainDate; +>date : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>Temporal : any +> : ^^^ + + date = Temporal.PlainDate.from("2006-08-24"); +>date = Temporal.PlainDate.from("2006-08-24") : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>date : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDate.from("2006-08-24") : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDate.from : (item: Temporal.PlainDateLike, options?: Temporal.OverflowOptions) => Temporal.PlainDate +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDate : Temporal.PlainDateConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>PlainDate : Temporal.PlainDateConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.PlainDateLike, options?: Temporal.OverflowOptions) => Temporal.PlainDate +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"2006-08-24" : "2006-08-24" +> : ^^^^^^^^^^^^ + + date.add({ years: 20, months: 4 }); // => 2026-12-24 +>date.add({ years: 20, months: 4 }) : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>date.add : (duration: Temporal.DurationLike, options?: Temporal.OverflowOptions) => Temporal.PlainDate +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>date : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>add : (duration: Temporal.DurationLike, options?: Temporal.OverflowOptions) => Temporal.PlainDate +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ years: 20, months: 4 } : { years: number; months: number; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>years : number +> : ^^^^^^ +>20 : 20 +> : ^^ +>months : number +> : ^^^^^^ +>4 : 4 +> : ^ + + date = Temporal.PlainDate.from("2019-01-31"); +>date = Temporal.PlainDate.from("2019-01-31") : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>date : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDate.from("2019-01-31") : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDate.from : (item: Temporal.PlainDateLike, options?: Temporal.OverflowOptions) => Temporal.PlainDate +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDate : Temporal.PlainDateConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>PlainDate : Temporal.PlainDateConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.PlainDateLike, options?: Temporal.OverflowOptions) => Temporal.PlainDate +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"2019-01-31" : "2019-01-31" +> : ^^^^^^^^^^^^ + + date.add({ months: 1 }); // => 2019-02-28 +>date.add({ months: 1 }) : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>date.add : (duration: Temporal.DurationLike, options?: Temporal.OverflowOptions) => Temporal.PlainDate +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>date : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>add : (duration: Temporal.DurationLike, options?: Temporal.OverflowOptions) => Temporal.PlainDate +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ months: 1 } : { months: number; } +> : ^^^^^^^^^^^^^^^^^^^ +>months : number +> : ^^^^^^ +>1 : 1 +> : ^ + + date.add({ months: 1 }, { overflow: "reject" }); // => throws +>date.add({ months: 1 }, { overflow: "reject" }) : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>date.add : (duration: Temporal.DurationLike, options?: Temporal.OverflowOptions) => Temporal.PlainDate +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>date : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>add : (duration: Temporal.DurationLike, options?: Temporal.OverflowOptions) => Temporal.PlainDate +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ months: 1 } : { months: number; } +> : ^^^^^^^^^^^^^^^^^^^ +>months : number +> : ^^^^^^ +>1 : 1 +> : ^ +>{ overflow: "reject" } : { overflow: "reject"; } +> : ^^^^^^^^^^^^^^^^^^^^^^^ +>overflow : "reject" +> : ^^^^^^^^ +>"reject" : "reject" +> : ^^^^^^^^ +} + +{ + let date: Temporal.PlainDate; +>date : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>Temporal : any +> : ^^^ + + date = Temporal.PlainDate.from("2006-08-24"); +>date = Temporal.PlainDate.from("2006-08-24") : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>date : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDate.from("2006-08-24") : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDate.from : (item: Temporal.PlainDateLike, options?: Temporal.OverflowOptions) => Temporal.PlainDate +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDate : Temporal.PlainDateConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>PlainDate : Temporal.PlainDateConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.PlainDateLike, options?: Temporal.OverflowOptions) => Temporal.PlainDate +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"2006-08-24" : "2006-08-24" +> : ^^^^^^^^^^^^ + + date.subtract({ years: 20, months: 4 }); // => 1986-04-24 +>date.subtract({ years: 20, months: 4 }) : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>date.subtract : (duration: Temporal.DurationLike, options?: Temporal.OverflowOptions) => Temporal.PlainDate +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>date : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>subtract : (duration: Temporal.DurationLike, options?: Temporal.OverflowOptions) => Temporal.PlainDate +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ years: 20, months: 4 } : { years: number; months: number; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>years : number +> : ^^^^^^ +>20 : 20 +> : ^^ +>months : number +> : ^^^^^^ +>4 : 4 +> : ^ + + date = Temporal.PlainDate.from("2019-03-31"); +>date = Temporal.PlainDate.from("2019-03-31") : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>date : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDate.from("2019-03-31") : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDate.from : (item: Temporal.PlainDateLike, options?: Temporal.OverflowOptions) => Temporal.PlainDate +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDate : Temporal.PlainDateConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>PlainDate : Temporal.PlainDateConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.PlainDateLike, options?: Temporal.OverflowOptions) => Temporal.PlainDate +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"2019-03-31" : "2019-03-31" +> : ^^^^^^^^^^^^ + + date.subtract({ months: 1 }); // => 2019-02-28 +>date.subtract({ months: 1 }) : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>date.subtract : (duration: Temporal.DurationLike, options?: Temporal.OverflowOptions) => Temporal.PlainDate +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>date : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>subtract : (duration: Temporal.DurationLike, options?: Temporal.OverflowOptions) => Temporal.PlainDate +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ months: 1 } : { months: number; } +> : ^^^^^^^^^^^^^^^^^^^ +>months : number +> : ^^^^^^ +>1 : 1 +> : ^ + + date.subtract({ months: 1 }, { overflow: "reject" }); // => throws +>date.subtract({ months: 1 }, { overflow: "reject" }) : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>date.subtract : (duration: Temporal.DurationLike, options?: Temporal.OverflowOptions) => Temporal.PlainDate +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>date : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>subtract : (duration: Temporal.DurationLike, options?: Temporal.OverflowOptions) => Temporal.PlainDate +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ months: 1 } : { months: number; } +> : ^^^^^^^^^^^^^^^^^^^ +>months : number +> : ^^^^^^ +>1 : 1 +> : ^ +>{ overflow: "reject" } : { overflow: "reject"; } +> : ^^^^^^^^^^^^^^^^^^^^^^^ +>overflow : "reject" +> : ^^^^^^^^ +>"reject" : "reject" +> : ^^^^^^^^ +} + +{ + const earlier = Temporal.PlainDate.from("2006-08-24"); +>earlier : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDate.from("2006-08-24") : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDate.from : (item: Temporal.PlainDateLike, options?: Temporal.OverflowOptions) => Temporal.PlainDate +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDate : Temporal.PlainDateConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>PlainDate : Temporal.PlainDateConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.PlainDateLike, options?: Temporal.OverflowOptions) => Temporal.PlainDate +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"2006-08-24" : "2006-08-24" +> : ^^^^^^^^^^^^ + + const later = Temporal.PlainDate.from("2019-01-31"); +>later : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDate.from("2019-01-31") : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDate.from : (item: Temporal.PlainDateLike, options?: Temporal.OverflowOptions) => Temporal.PlainDate +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDate : Temporal.PlainDateConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>PlainDate : Temporal.PlainDateConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.PlainDateLike, options?: Temporal.OverflowOptions) => Temporal.PlainDate +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"2019-01-31" : "2019-01-31" +> : ^^^^^^^^^^^^ + + earlier.until(later); // => P4543D +>earlier.until(later) : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>earlier.until : (other: Temporal.PlainDateLike, options?: Temporal.RoundingOptionsWithLargestUnit) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^ +>earlier : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>until : (other: Temporal.PlainDateLike, options?: Temporal.RoundingOptionsWithLargestUnit) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^ +>later : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ + + earlier.until(later, { largestUnit: "year" }); // => P12Y5M7D +>earlier.until(later, { largestUnit: "year" }) : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>earlier.until : (other: Temporal.PlainDateLike, options?: Temporal.RoundingOptionsWithLargestUnit) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^ +>earlier : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>until : (other: Temporal.PlainDateLike, options?: Temporal.RoundingOptionsWithLargestUnit) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^ +>later : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>{ largestUnit: "year" } : { largestUnit: "year"; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^ +>largestUnit : "year" +> : ^^^^^^ +>"year" : "year" +> : ^^^^^^ + + later.until(earlier, { largestUnit: "year" }); // => -P12Y5M7D +>later.until(earlier, { largestUnit: "year" }) : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>later.until : (other: Temporal.PlainDateLike, options?: Temporal.RoundingOptionsWithLargestUnit) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^ +>later : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>until : (other: Temporal.PlainDateLike, options?: Temporal.RoundingOptionsWithLargestUnit) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^ +>earlier : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>{ largestUnit: "year" } : { largestUnit: "year"; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^ +>largestUnit : "year" +> : ^^^^^^ +>"year" : "year" +> : ^^^^^^ + + // If you really need to calculate the difference between two Dates in + // hours, you can eliminate the ambiguity by explicitly choosing the + // point in time from which you want to reckon the difference. For + // example, using noon: + const noon = Temporal.PlainTime.from("12:00"); +>noon : Temporal.PlainTime +> : ^^^^^^^^^^^^^^^^^^ +>Temporal.PlainTime.from("12:00") : Temporal.PlainTime +> : ^^^^^^^^^^^^^^^^^^ +>Temporal.PlainTime.from : (item: Temporal.PlainTimeLike, options?: Temporal.OverflowOptions) => Temporal.PlainTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainTime : Temporal.PlainTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>PlainTime : Temporal.PlainTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.PlainTimeLike, options?: Temporal.OverflowOptions) => Temporal.PlainTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"12:00" : "12:00" +> : ^^^^^^^ + + earlier.toPlainDateTime(noon).until(later.toPlainDateTime(noon), { largestUnit: "hour" }); +>earlier.toPlainDateTime(noon).until(later.toPlainDateTime(noon), { largestUnit: "hour" }) : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>earlier.toPlainDateTime(noon).until : (other: Temporal.PlainDateTimeLike, options?: Temporal.RoundingOptionsWithLargestUnit) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^ +>earlier.toPlainDateTime(noon) : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>earlier.toPlainDateTime : (time?: Temporal.PlainTimeLike) => Temporal.PlainDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>earlier : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>toPlainDateTime : (time?: Temporal.PlainTimeLike) => Temporal.PlainDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>noon : Temporal.PlainTime +> : ^^^^^^^^^^^^^^^^^^ +>until : (other: Temporal.PlainDateTimeLike, options?: Temporal.RoundingOptionsWithLargestUnit) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^ +>later.toPlainDateTime(noon) : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>later.toPlainDateTime : (time?: Temporal.PlainTimeLike) => Temporal.PlainDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>later : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>toPlainDateTime : (time?: Temporal.PlainTimeLike) => Temporal.PlainDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>noon : Temporal.PlainTime +> : ^^^^^^^^^^^^^^^^^^ +>{ largestUnit: "hour" } : { largestUnit: "hour"; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^ +>largestUnit : "hour" +> : ^^^^^^ +>"hour" : "hour" +> : ^^^^^^ + + // => PT109032H + + const newyear = Temporal.PlainDate.from("2020-01-01"); +>newyear : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDate.from("2020-01-01") : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDate.from : (item: Temporal.PlainDateLike, options?: Temporal.OverflowOptions) => Temporal.PlainDate +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDate : Temporal.PlainDateConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>PlainDate : Temporal.PlainDateConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.PlainDateLike, options?: Temporal.OverflowOptions) => Temporal.PlainDate +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"2020-01-01" : "2020-01-01" +> : ^^^^^^^^^^^^ + + newyear.until("2020-01-15", { smallestUnit: "month", roundingMode: "halfExpand" }); +>newyear.until("2020-01-15", { smallestUnit: "month", roundingMode: "halfExpand" }) : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>newyear.until : (other: Temporal.PlainDateLike, options?: Temporal.RoundingOptionsWithLargestUnit) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^ +>newyear : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>until : (other: Temporal.PlainDateLike, options?: Temporal.RoundingOptionsWithLargestUnit) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^ +>"2020-01-15" : "2020-01-15" +> : ^^^^^^^^^^^^ +>{ smallestUnit: "month", roundingMode: "halfExpand" } : { smallestUnit: "month"; roundingMode: "halfExpand"; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>smallestUnit : "month" +> : ^^^^^^^ +>"month" : "month" +> : ^^^^^^^ +>roundingMode : "halfExpand" +> : ^^^^^^^^^^^^ +>"halfExpand" : "halfExpand" +> : ^^^^^^^^^^^^ + + // => PT0S + newyear.until("2020-01-16", { smallestUnit: "month", roundingMode: "halfExpand" }); +>newyear.until("2020-01-16", { smallestUnit: "month", roundingMode: "halfExpand" }) : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>newyear.until : (other: Temporal.PlainDateLike, options?: Temporal.RoundingOptionsWithLargestUnit) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^ +>newyear : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>until : (other: Temporal.PlainDateLike, options?: Temporal.RoundingOptionsWithLargestUnit) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^ +>"2020-01-16" : "2020-01-16" +> : ^^^^^^^^^^^^ +>{ smallestUnit: "month", roundingMode: "halfExpand" } : { smallestUnit: "month"; roundingMode: "halfExpand"; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>smallestUnit : "month" +> : ^^^^^^^ +>"month" : "month" +> : ^^^^^^^ +>roundingMode : "halfExpand" +> : ^^^^^^^^^^^^ +>"halfExpand" : "halfExpand" +> : ^^^^^^^^^^^^ + + // => PT0S (mid-month dates rounded down to match `Temporal.PlainDateTime` behavior) + newyear.until("2020-01-17", { smallestUnit: "month", roundingMode: "halfExpand" }); +>newyear.until("2020-01-17", { smallestUnit: "month", roundingMode: "halfExpand" }) : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>newyear.until : (other: Temporal.PlainDateLike, options?: Temporal.RoundingOptionsWithLargestUnit) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^ +>newyear : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>until : (other: Temporal.PlainDateLike, options?: Temporal.RoundingOptionsWithLargestUnit) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^ +>"2020-01-17" : "2020-01-17" +> : ^^^^^^^^^^^^ +>{ smallestUnit: "month", roundingMode: "halfExpand" } : { smallestUnit: "month"; roundingMode: "halfExpand"; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>smallestUnit : "month" +> : ^^^^^^^ +>"month" : "month" +> : ^^^^^^^ +>roundingMode : "halfExpand" +> : ^^^^^^^^^^^^ +>"halfExpand" : "halfExpand" +> : ^^^^^^^^^^^^ + + // => PT1M +} + +{ + const earlier = Temporal.PlainDate.from("2006-08-24"); +>earlier : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDate.from("2006-08-24") : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDate.from : (item: Temporal.PlainDateLike, options?: Temporal.OverflowOptions) => Temporal.PlainDate +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDate : Temporal.PlainDateConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>PlainDate : Temporal.PlainDateConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.PlainDateLike, options?: Temporal.OverflowOptions) => Temporal.PlainDate +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"2006-08-24" : "2006-08-24" +> : ^^^^^^^^^^^^ + + const later = Temporal.PlainDate.from("2019-01-31"); +>later : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDate.from("2019-01-31") : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDate.from : (item: Temporal.PlainDateLike, options?: Temporal.OverflowOptions) => Temporal.PlainDate +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDate : Temporal.PlainDateConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>PlainDate : Temporal.PlainDateConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.PlainDateLike, options?: Temporal.OverflowOptions) => Temporal.PlainDate +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"2019-01-31" : "2019-01-31" +> : ^^^^^^^^^^^^ + + later.since(earlier); // => P4543D +>later.since(earlier) : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>later.since : (other: Temporal.PlainDateLike, options?: Temporal.RoundingOptionsWithLargestUnit) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^ +>later : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>since : (other: Temporal.PlainDateLike, options?: Temporal.RoundingOptionsWithLargestUnit) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^ +>earlier : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +} + +{ + const date = Temporal.PlainDate.from("2006-08-24"); +>date : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDate.from("2006-08-24") : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDate.from : (item: Temporal.PlainDateLike, options?: Temporal.OverflowOptions) => Temporal.PlainDate +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDate : Temporal.PlainDateConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>PlainDate : Temporal.PlainDateConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.PlainDateLike, options?: Temporal.OverflowOptions) => Temporal.PlainDate +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"2006-08-24" : "2006-08-24" +> : ^^^^^^^^^^^^ + + const other = Temporal.PlainDate.from("2019-01-31"); +>other : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDate.from("2019-01-31") : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDate.from : (item: Temporal.PlainDateLike, options?: Temporal.OverflowOptions) => Temporal.PlainDate +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDate : Temporal.PlainDateConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>PlainDate : Temporal.PlainDateConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.PlainDateLike, options?: Temporal.OverflowOptions) => Temporal.PlainDate +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"2019-01-31" : "2019-01-31" +> : ^^^^^^^^^^^^ + + date.equals(other); // => false +>date.equals(other) : boolean +> : ^^^^^^^ +>date.equals : (other: Temporal.PlainDateLike) => boolean +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>date : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>equals : (other: Temporal.PlainDateLike) => boolean +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>other : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ + + date.equals(date); // => true +>date.equals(date) : boolean +> : ^^^^^^^ +>date.equals : (other: Temporal.PlainDateLike) => boolean +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>date : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>equals : (other: Temporal.PlainDateLike) => boolean +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>date : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +} + +{ + const date = Temporal.PlainDate.from("2006-08-24"); +>date : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDate.from("2006-08-24") : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDate.from : (item: Temporal.PlainDateLike, options?: Temporal.OverflowOptions) => Temporal.PlainDate +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDate : Temporal.PlainDateConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>PlainDate : Temporal.PlainDateConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.PlainDateLike, options?: Temporal.OverflowOptions) => Temporal.PlainDate +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"2006-08-24" : "2006-08-24" +> : ^^^^^^^^^^^^ + + date.toString(); // => '2006-08-24' +>date.toString() : string +> : ^^^^^^ +>date.toString : (options?: Temporal.PlainDateToStringOptions) => string +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>date : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>toString : (options?: Temporal.PlainDateToStringOptions) => string +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +} + +{ + const date = Temporal.PlainDate.from("2006-08-24"); +>date : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDate.from("2006-08-24") : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDate.from : (item: Temporal.PlainDateLike, options?: Temporal.OverflowOptions) => Temporal.PlainDate +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDate : Temporal.PlainDateConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>PlainDate : Temporal.PlainDateConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.PlainDateLike, options?: Temporal.OverflowOptions) => Temporal.PlainDate +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"2006-08-24" : "2006-08-24" +> : ^^^^^^^^^^^^ + + date.toLocaleString(); // example output: 8/24/2006 +>date.toLocaleString() : string +> : ^^^^^^ +>date.toLocaleString : (locales?: Intl.LocalesArgument, options?: Intl.DateTimeFormatOptions) => string +> : ^ ^^^ ^^ ^^^ ^^^^^ +>date : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>toLocaleString : (locales?: Intl.LocalesArgument, options?: Intl.DateTimeFormatOptions) => string +> : ^ ^^^ ^^ ^^^ ^^^^^ + + date.toLocaleString("de-DE"); // example output: '24.8.2006' +>date.toLocaleString("de-DE") : string +> : ^^^^^^ +>date.toLocaleString : (locales?: Intl.LocalesArgument, options?: Intl.DateTimeFormatOptions) => string +> : ^ ^^^ ^^ ^^^ ^^^^^ +>date : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>toLocaleString : (locales?: Intl.LocalesArgument, options?: Intl.DateTimeFormatOptions) => string +> : ^ ^^^ ^^ ^^^ ^^^^^ +>"de-DE" : "de-DE" +> : ^^^^^^^ + + date.toLocaleString("de-DE", { weekday: "long" }); // => 'Donnerstag' +>date.toLocaleString("de-DE", { weekday: "long" }) : string +> : ^^^^^^ +>date.toLocaleString : (locales?: Intl.LocalesArgument, options?: Intl.DateTimeFormatOptions) => string +> : ^ ^^^ ^^ ^^^ ^^^^^ +>date : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>toLocaleString : (locales?: Intl.LocalesArgument, options?: Intl.DateTimeFormatOptions) => string +> : ^ ^^^ ^^ ^^^ ^^^^^ +>"de-DE" : "de-DE" +> : ^^^^^^^ +>{ weekday: "long" } : { weekday: "long"; } +> : ^^^^^^^^^^^^^^^^^^^^ +>weekday : "long" +> : ^^^^^^ +>"long" : "long" +> : ^^^^^^ + + date.toLocaleString("en-US-u-nu-fullwide"); // => '8/24/2006' +>date.toLocaleString("en-US-u-nu-fullwide") : string +> : ^^^^^^ +>date.toLocaleString : (locales?: Intl.LocalesArgument, options?: Intl.DateTimeFormatOptions) => string +> : ^ ^^^ ^^ ^^^ ^^^^^ +>date : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>toLocaleString : (locales?: Intl.LocalesArgument, options?: Intl.DateTimeFormatOptions) => string +> : ^ ^^^ ^^ ^^^ ^^^^^ +>"en-US-u-nu-fullwide" : "en-US-u-nu-fullwide" +> : ^^^^^^^^^^^^^^^^^^^^^ +} + +{ + const plainDate = Temporal.PlainDate.from("2006-08-24"); +>plainDate : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDate.from("2006-08-24") : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDate.from : (item: Temporal.PlainDateLike, options?: Temporal.OverflowOptions) => Temporal.PlainDate +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDate : Temporal.PlainDateConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>PlainDate : Temporal.PlainDateConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.PlainDateLike, options?: Temporal.OverflowOptions) => Temporal.PlainDate +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"2006-08-24" : "2006-08-24" +> : ^^^^^^^^^^^^ + + const plainTime = Temporal.PlainTime.from("15:23:30.003"); +>plainTime : Temporal.PlainTime +> : ^^^^^^^^^^^^^^^^^^ +>Temporal.PlainTime.from("15:23:30.003") : Temporal.PlainTime +> : ^^^^^^^^^^^^^^^^^^ +>Temporal.PlainTime.from : (item: Temporal.PlainTimeLike, options?: Temporal.OverflowOptions) => Temporal.PlainTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainTime : Temporal.PlainTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>PlainTime : Temporal.PlainTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.PlainTimeLike, options?: Temporal.OverflowOptions) => Temporal.PlainTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"15:23:30.003" : "15:23:30.003" +> : ^^^^^^^^^^^^^^ + + plainDate.toZonedDateTime({ timeZone: "America/Los_Angeles", plainTime }); +>plainDate.toZonedDateTime({ timeZone: "America/Los_Angeles", plainTime }) : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>plainDate.toZonedDateTime : { (timeZone: Temporal.TimeZoneLike): Temporal.ZonedDateTime; (item: Temporal.PlainDateToZonedDateTimeOptions): Temporal.ZonedDateTime; } +> : ^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>plainDate : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>toZonedDateTime : { (timeZone: Temporal.TimeZoneLike): Temporal.ZonedDateTime; (item: Temporal.PlainDateToZonedDateTimeOptions): Temporal.ZonedDateTime; } +> : ^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ timeZone: "America/Los_Angeles", plainTime } : { timeZone: string; plainTime: Temporal.PlainTime; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>timeZone : string +> : ^^^^^^ +>"America/Los_Angeles" : "America/Los_Angeles" +> : ^^^^^^^^^^^^^^^^^^^^^ +>plainTime : Temporal.PlainTime +> : ^^^^^^^^^^^^^^^^^^ + + // => 2006-08-24T15:23:30.003-07:00[America/Los_Angeles] + plainDate.toZonedDateTime({ timeZone: "America/Los_Angeles" }); +>plainDate.toZonedDateTime({ timeZone: "America/Los_Angeles" }) : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>plainDate.toZonedDateTime : { (timeZone: Temporal.TimeZoneLike): Temporal.ZonedDateTime; (item: Temporal.PlainDateToZonedDateTimeOptions): Temporal.ZonedDateTime; } +> : ^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>plainDate : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>toZonedDateTime : { (timeZone: Temporal.TimeZoneLike): Temporal.ZonedDateTime; (item: Temporal.PlainDateToZonedDateTimeOptions): Temporal.ZonedDateTime; } +> : ^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ timeZone: "America/Los_Angeles" } : { timeZone: string; } +> : ^^^^^^^^^^^^^^^^^^^^^ +>timeZone : string +> : ^^^^^^ +>"America/Los_Angeles" : "America/Los_Angeles" +> : ^^^^^^^^^^^^^^^^^^^^^ + + // => 2006-08-24T00:00:00-07:00[America/Los_Angeles] +} + +{ + const date = Temporal.PlainDate.from("2006-08-24"); +>date : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDate.from("2006-08-24") : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDate.from : (item: Temporal.PlainDateLike, options?: Temporal.OverflowOptions) => Temporal.PlainDate +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDate : Temporal.PlainDateConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>PlainDate : Temporal.PlainDateConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.PlainDateLike, options?: Temporal.OverflowOptions) => Temporal.PlainDate +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"2006-08-24" : "2006-08-24" +> : ^^^^^^^^^^^^ + + const time = Temporal.PlainTime.from("15:23:30.003"); +>time : Temporal.PlainTime +> : ^^^^^^^^^^^^^^^^^^ +>Temporal.PlainTime.from("15:23:30.003") : Temporal.PlainTime +> : ^^^^^^^^^^^^^^^^^^ +>Temporal.PlainTime.from : (item: Temporal.PlainTimeLike, options?: Temporal.OverflowOptions) => Temporal.PlainTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainTime : Temporal.PlainTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>PlainTime : Temporal.PlainTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.PlainTimeLike, options?: Temporal.OverflowOptions) => Temporal.PlainTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"15:23:30.003" : "15:23:30.003" +> : ^^^^^^^^^^^^^^ + + date.toPlainDateTime(time); // => 2006-08-24T15:23:30.003 +>date.toPlainDateTime(time) : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>date.toPlainDateTime : (time?: Temporal.PlainTimeLike) => Temporal.PlainDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>date : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>toPlainDateTime : (time?: Temporal.PlainTimeLike) => Temporal.PlainDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>time : Temporal.PlainTime +> : ^^^^^^^^^^^^^^^^^^ + + date.toPlainDateTime(); // => 2006-08-24T00:00:00 +>date.toPlainDateTime() : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>date.toPlainDateTime : (time?: Temporal.PlainTimeLike) => Temporal.PlainDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>date : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>toPlainDateTime : (time?: Temporal.PlainTimeLike) => Temporal.PlainDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +} + +{ + const date = Temporal.PlainDate.from("2006-08-24"); +>date : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDate.from("2006-08-24") : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDate.from : (item: Temporal.PlainDateLike, options?: Temporal.OverflowOptions) => Temporal.PlainDate +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDate : Temporal.PlainDateConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>PlainDate : Temporal.PlainDateConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.PlainDateLike, options?: Temporal.OverflowOptions) => Temporal.PlainDate +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"2006-08-24" : "2006-08-24" +> : ^^^^^^^^^^^^ + + date.toPlainYearMonth(); // => 2006-08 +>date.toPlainYearMonth() : Temporal.PlainYearMonth +> : ^^^^^^^^^^^^^^^^^^^^^^^ +>date.toPlainYearMonth : () => Temporal.PlainYearMonth +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>date : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>toPlainYearMonth : () => Temporal.PlainYearMonth +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + date.toPlainMonthDay(); // => 08-24 +>date.toPlainMonthDay() : Temporal.PlainMonthDay +> : ^^^^^^^^^^^^^^^^^^^^^^ +>date.toPlainMonthDay : () => Temporal.PlainMonthDay +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>date : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>toPlainMonthDay : () => Temporal.PlainMonthDay +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +} + +{ + // Leet hour + const time = new Temporal.PlainTime(13, 37); // => 13:37:00 +>time : Temporal.PlainTime +> : ^^^^^^^^^^^^^^^^^^ +>new Temporal.PlainTime(13, 37) : Temporal.PlainTime +> : ^^^^^^^^^^^^^^^^^^ +>Temporal.PlainTime : Temporal.PlainTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>PlainTime : Temporal.PlainTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>13 : 13 +> : ^^ +>37 : 37 +> : ^^ +} + +{ + let time: Temporal.PlainTime; +>time : Temporal.PlainTime +> : ^^^^^^^^^^^^^^^^^^ +>Temporal : any +> : ^^^ + + time = Temporal.PlainTime.from("03:24:30"); // => 03:24:30 +>time = Temporal.PlainTime.from("03:24:30") : Temporal.PlainTime +> : ^^^^^^^^^^^^^^^^^^ +>time : Temporal.PlainTime +> : ^^^^^^^^^^^^^^^^^^ +>Temporal.PlainTime.from("03:24:30") : Temporal.PlainTime +> : ^^^^^^^^^^^^^^^^^^ +>Temporal.PlainTime.from : (item: Temporal.PlainTimeLike, options?: Temporal.OverflowOptions) => Temporal.PlainTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainTime : Temporal.PlainTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>PlainTime : Temporal.PlainTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.PlainTimeLike, options?: Temporal.OverflowOptions) => Temporal.PlainTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"03:24:30" : "03:24:30" +> : ^^^^^^^^^^ + + time = Temporal.PlainTime.from("032430"); // => 03:24:30 +>time = Temporal.PlainTime.from("032430") : Temporal.PlainTime +> : ^^^^^^^^^^^^^^^^^^ +>time : Temporal.PlainTime +> : ^^^^^^^^^^^^^^^^^^ +>Temporal.PlainTime.from("032430") : Temporal.PlainTime +> : ^^^^^^^^^^^^^^^^^^ +>Temporal.PlainTime.from : (item: Temporal.PlainTimeLike, options?: Temporal.OverflowOptions) => Temporal.PlainTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainTime : Temporal.PlainTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>PlainTime : Temporal.PlainTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.PlainTimeLike, options?: Temporal.OverflowOptions) => Temporal.PlainTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"032430" : "032430" +> : ^^^^^^^^ + + time = Temporal.PlainTime.from("1995-12-07T03:24:30"); // => 03:24:30 +>time = Temporal.PlainTime.from("1995-12-07T03:24:30") : Temporal.PlainTime +> : ^^^^^^^^^^^^^^^^^^ +>time : Temporal.PlainTime +> : ^^^^^^^^^^^^^^^^^^ +>Temporal.PlainTime.from("1995-12-07T03:24:30") : Temporal.PlainTime +> : ^^^^^^^^^^^^^^^^^^ +>Temporal.PlainTime.from : (item: Temporal.PlainTimeLike, options?: Temporal.OverflowOptions) => Temporal.PlainTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainTime : Temporal.PlainTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>PlainTime : Temporal.PlainTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.PlainTimeLike, options?: Temporal.OverflowOptions) => Temporal.PlainTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"1995-12-07T03:24:30" : "1995-12-07T03:24:30" +> : ^^^^^^^^^^^^^^^^^^^^^ + + time = Temporal.PlainTime.from("1995-12-07T03:24:30+01:00[Europe/Brussels]"); +>time = Temporal.PlainTime.from("1995-12-07T03:24:30+01:00[Europe/Brussels]") : Temporal.PlainTime +> : ^^^^^^^^^^^^^^^^^^ +>time : Temporal.PlainTime +> : ^^^^^^^^^^^^^^^^^^ +>Temporal.PlainTime.from("1995-12-07T03:24:30+01:00[Europe/Brussels]") : Temporal.PlainTime +> : ^^^^^^^^^^^^^^^^^^ +>Temporal.PlainTime.from : (item: Temporal.PlainTimeLike, options?: Temporal.OverflowOptions) => Temporal.PlainTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainTime : Temporal.PlainTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>PlainTime : Temporal.PlainTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.PlainTimeLike, options?: Temporal.OverflowOptions) => Temporal.PlainTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"1995-12-07T03:24:30+01:00[Europe/Brussels]" : "1995-12-07T03:24:30+01:00[Europe/Brussels]" +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + // => 03:24:30 + // (same as above; time zone is ignored) + time === Temporal.PlainTime.from(time); // => false +>time === Temporal.PlainTime.from(time) : boolean +> : ^^^^^^^ +>time : Temporal.PlainTime +> : ^^^^^^^^^^^^^^^^^^ +>Temporal.PlainTime.from(time) : Temporal.PlainTime +> : ^^^^^^^^^^^^^^^^^^ +>Temporal.PlainTime.from : (item: Temporal.PlainTimeLike, options?: Temporal.OverflowOptions) => Temporal.PlainTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainTime : Temporal.PlainTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>PlainTime : Temporal.PlainTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.PlainTimeLike, options?: Temporal.OverflowOptions) => Temporal.PlainTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>time : Temporal.PlainTime +> : ^^^^^^^^^^^^^^^^^^ + + time = Temporal.PlainTime.from({ +>time = Temporal.PlainTime.from({ hour: 19, minute: 39, second: 9, millisecond: 68, microsecond: 346, nanosecond: 205, }) : Temporal.PlainTime +> : ^^^^^^^^^^^^^^^^^^ +>time : Temporal.PlainTime +> : ^^^^^^^^^^^^^^^^^^ +>Temporal.PlainTime.from({ hour: 19, minute: 39, second: 9, millisecond: 68, microsecond: 346, nanosecond: 205, }) : Temporal.PlainTime +> : ^^^^^^^^^^^^^^^^^^ +>Temporal.PlainTime.from : (item: Temporal.PlainTimeLike, options?: Temporal.OverflowOptions) => Temporal.PlainTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainTime : Temporal.PlainTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>PlainTime : Temporal.PlainTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.PlainTimeLike, options?: Temporal.OverflowOptions) => Temporal.PlainTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ hour: 19, minute: 39, second: 9, millisecond: 68, microsecond: 346, nanosecond: 205, } : { hour: number; minute: number; second: number; millisecond: number; microsecond: number; nanosecond: number; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + hour: 19, +>hour : number +> : ^^^^^^ +>19 : 19 +> : ^^ + + minute: 39, +>minute : number +> : ^^^^^^ +>39 : 39 +> : ^^ + + second: 9, +>second : number +> : ^^^^^^ +>9 : 9 +> : ^ + + millisecond: 68, +>millisecond : number +> : ^^^^^^ +>68 : 68 +> : ^^ + + microsecond: 346, +>microsecond : number +> : ^^^^^^ +>346 : 346 +> : ^^^ + + nanosecond: 205, +>nanosecond : number +> : ^^^^^^ +>205 : 205 +> : ^^^ + + }); // => 19:39:09.068346205 + time = Temporal.PlainTime.from({ hour: 19, minute: 39, second: 9 }); // => 19:39:09 +>time = Temporal.PlainTime.from({ hour: 19, minute: 39, second: 9 }) : Temporal.PlainTime +> : ^^^^^^^^^^^^^^^^^^ +>time : Temporal.PlainTime +> : ^^^^^^^^^^^^^^^^^^ +>Temporal.PlainTime.from({ hour: 19, minute: 39, second: 9 }) : Temporal.PlainTime +> : ^^^^^^^^^^^^^^^^^^ +>Temporal.PlainTime.from : (item: Temporal.PlainTimeLike, options?: Temporal.OverflowOptions) => Temporal.PlainTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainTime : Temporal.PlainTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>PlainTime : Temporal.PlainTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.PlainTimeLike, options?: Temporal.OverflowOptions) => Temporal.PlainTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ hour: 19, minute: 39, second: 9 } : { hour: number; minute: number; second: number; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>hour : number +> : ^^^^^^ +>19 : 19 +> : ^^ +>minute : number +> : ^^^^^^ +>39 : 39 +> : ^^ +>second : number +> : ^^^^^^ +>9 : 9 +> : ^ + + time = Temporal.PlainTime.from(Temporal.PlainDateTime.from("2020-02-15T19:39:09")); +>time = Temporal.PlainTime.from(Temporal.PlainDateTime.from("2020-02-15T19:39:09")) : Temporal.PlainTime +> : ^^^^^^^^^^^^^^^^^^ +>time : Temporal.PlainTime +> : ^^^^^^^^^^^^^^^^^^ +>Temporal.PlainTime.from(Temporal.PlainDateTime.from("2020-02-15T19:39:09")) : Temporal.PlainTime +> : ^^^^^^^^^^^^^^^^^^ +>Temporal.PlainTime.from : (item: Temporal.PlainTimeLike, options?: Temporal.OverflowOptions) => Temporal.PlainTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainTime : Temporal.PlainTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>PlainTime : Temporal.PlainTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.PlainTimeLike, options?: Temporal.OverflowOptions) => Temporal.PlainTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDateTime.from("2020-02-15T19:39:09") : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDateTime.from : (item: Temporal.PlainDateTimeLike, options?: Temporal.OverflowOptions) => Temporal.PlainDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDateTime : Temporal.PlainDateTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>PlainDateTime : Temporal.PlainDateTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.PlainDateTimeLike, options?: Temporal.OverflowOptions) => Temporal.PlainDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"2020-02-15T19:39:09" : "2020-02-15T19:39:09" +> : ^^^^^^^^^^^^^^^^^^^^^ + + // => 19:39:09 + // (same as above; Temporal.PlainDateTime has hour, minute, etc. properties) + + // Different overflow modes + time = Temporal.PlainTime.from({ hour: 15, minute: 60 }, { overflow: "constrain" }); +>time = Temporal.PlainTime.from({ hour: 15, minute: 60 }, { overflow: "constrain" }) : Temporal.PlainTime +> : ^^^^^^^^^^^^^^^^^^ +>time : Temporal.PlainTime +> : ^^^^^^^^^^^^^^^^^^ +>Temporal.PlainTime.from({ hour: 15, minute: 60 }, { overflow: "constrain" }) : Temporal.PlainTime +> : ^^^^^^^^^^^^^^^^^^ +>Temporal.PlainTime.from : (item: Temporal.PlainTimeLike, options?: Temporal.OverflowOptions) => Temporal.PlainTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainTime : Temporal.PlainTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>PlainTime : Temporal.PlainTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.PlainTimeLike, options?: Temporal.OverflowOptions) => Temporal.PlainTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ hour: 15, minute: 60 } : { hour: number; minute: number; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>hour : number +> : ^^^^^^ +>15 : 15 +> : ^^ +>minute : number +> : ^^^^^^ +>60 : 60 +> : ^^ +>{ overflow: "constrain" } : { overflow: "constrain"; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^ +>overflow : "constrain" +> : ^^^^^^^^^^^ +>"constrain" : "constrain" +> : ^^^^^^^^^^^ + + // => 15:59:00 + time = Temporal.PlainTime.from({ hour: 15, minute: -1 }, { overflow: "constrain" }); +>time = Temporal.PlainTime.from({ hour: 15, minute: -1 }, { overflow: "constrain" }) : Temporal.PlainTime +> : ^^^^^^^^^^^^^^^^^^ +>time : Temporal.PlainTime +> : ^^^^^^^^^^^^^^^^^^ +>Temporal.PlainTime.from({ hour: 15, minute: -1 }, { overflow: "constrain" }) : Temporal.PlainTime +> : ^^^^^^^^^^^^^^^^^^ +>Temporal.PlainTime.from : (item: Temporal.PlainTimeLike, options?: Temporal.OverflowOptions) => Temporal.PlainTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainTime : Temporal.PlainTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>PlainTime : Temporal.PlainTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.PlainTimeLike, options?: Temporal.OverflowOptions) => Temporal.PlainTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ hour: 15, minute: -1 } : { hour: number; minute: number; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>hour : number +> : ^^^^^^ +>15 : 15 +> : ^^ +>minute : number +> : ^^^^^^ +>-1 : -1 +> : ^^ +>1 : 1 +> : ^ +>{ overflow: "constrain" } : { overflow: "constrain"; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^ +>overflow : "constrain" +> : ^^^^^^^^^^^ +>"constrain" : "constrain" +> : ^^^^^^^^^^^ + + // => 15:00:00 + time = Temporal.PlainTime.from({ hour: 15, minute: 60 }, { overflow: "reject" }); +>time = Temporal.PlainTime.from({ hour: 15, minute: 60 }, { overflow: "reject" }) : Temporal.PlainTime +> : ^^^^^^^^^^^^^^^^^^ +>time : Temporal.PlainTime +> : ^^^^^^^^^^^^^^^^^^ +>Temporal.PlainTime.from({ hour: 15, minute: 60 }, { overflow: "reject" }) : Temporal.PlainTime +> : ^^^^^^^^^^^^^^^^^^ +>Temporal.PlainTime.from : (item: Temporal.PlainTimeLike, options?: Temporal.OverflowOptions) => Temporal.PlainTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainTime : Temporal.PlainTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>PlainTime : Temporal.PlainTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.PlainTimeLike, options?: Temporal.OverflowOptions) => Temporal.PlainTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ hour: 15, minute: 60 } : { hour: number; minute: number; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>hour : number +> : ^^^^^^ +>15 : 15 +> : ^^ +>minute : number +> : ^^^^^^ +>60 : 60 +> : ^^ +>{ overflow: "reject" } : { overflow: "reject"; } +> : ^^^^^^^^^^^^^^^^^^^^^^^ +>overflow : "reject" +> : ^^^^^^^^ +>"reject" : "reject" +> : ^^^^^^^^ + + // => throws + time = Temporal.PlainTime.from({ hour: 15, minute: -1 }, { overflow: "reject" }); +>time = Temporal.PlainTime.from({ hour: 15, minute: -1 }, { overflow: "reject" }) : Temporal.PlainTime +> : ^^^^^^^^^^^^^^^^^^ +>time : Temporal.PlainTime +> : ^^^^^^^^^^^^^^^^^^ +>Temporal.PlainTime.from({ hour: 15, minute: -1 }, { overflow: "reject" }) : Temporal.PlainTime +> : ^^^^^^^^^^^^^^^^^^ +>Temporal.PlainTime.from : (item: Temporal.PlainTimeLike, options?: Temporal.OverflowOptions) => Temporal.PlainTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainTime : Temporal.PlainTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>PlainTime : Temporal.PlainTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.PlainTimeLike, options?: Temporal.OverflowOptions) => Temporal.PlainTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ hour: 15, minute: -1 } : { hour: number; minute: number; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>hour : number +> : ^^^^^^ +>15 : 15 +> : ^^ +>minute : number +> : ^^^^^^ +>-1 : -1 +> : ^^ +>1 : 1 +> : ^ +>{ overflow: "reject" } : { overflow: "reject"; } +> : ^^^^^^^^^^^^^^^^^^^^^^^ +>overflow : "reject" +> : ^^^^^^^^ +>"reject" : "reject" +> : ^^^^^^^^ + + // => throws +} + +{ + const one = Temporal.PlainTime.from("03:24"); +>one : Temporal.PlainTime +> : ^^^^^^^^^^^^^^^^^^ +>Temporal.PlainTime.from("03:24") : Temporal.PlainTime +> : ^^^^^^^^^^^^^^^^^^ +>Temporal.PlainTime.from : (item: Temporal.PlainTimeLike, options?: Temporal.OverflowOptions) => Temporal.PlainTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainTime : Temporal.PlainTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>PlainTime : Temporal.PlainTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.PlainTimeLike, options?: Temporal.OverflowOptions) => Temporal.PlainTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"03:24" : "03:24" +> : ^^^^^^^ + + const two = Temporal.PlainTime.from("01:24"); +>two : Temporal.PlainTime +> : ^^^^^^^^^^^^^^^^^^ +>Temporal.PlainTime.from("01:24") : Temporal.PlainTime +> : ^^^^^^^^^^^^^^^^^^ +>Temporal.PlainTime.from : (item: Temporal.PlainTimeLike, options?: Temporal.OverflowOptions) => Temporal.PlainTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainTime : Temporal.PlainTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>PlainTime : Temporal.PlainTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.PlainTimeLike, options?: Temporal.OverflowOptions) => Temporal.PlainTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"01:24" : "01:24" +> : ^^^^^^^ + + const three = Temporal.PlainTime.from("01:24:05"); +>three : Temporal.PlainTime +> : ^^^^^^^^^^^^^^^^^^ +>Temporal.PlainTime.from("01:24:05") : Temporal.PlainTime +> : ^^^^^^^^^^^^^^^^^^ +>Temporal.PlainTime.from : (item: Temporal.PlainTimeLike, options?: Temporal.OverflowOptions) => Temporal.PlainTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainTime : Temporal.PlainTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>PlainTime : Temporal.PlainTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.PlainTimeLike, options?: Temporal.OverflowOptions) => Temporal.PlainTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"01:24:05" : "01:24:05" +> : ^^^^^^^^^^ + + const sorted = [one, two, three].sort(Temporal.PlainTime.compare); +>sorted : Temporal.PlainTime[] +> : ^^^^^^^^^^^^^^^^^^^^ +>[one, two, three].sort(Temporal.PlainTime.compare) : Temporal.PlainTime[] +> : ^^^^^^^^^^^^^^^^^^^^ +>[one, two, three].sort : (compareFn?: ((a: Temporal.PlainTime, b: Temporal.PlainTime) => number) | undefined) => Temporal.PlainTime[] +> : ^ ^^^^^ ^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>[one, two, three] : Temporal.PlainTime[] +> : ^^^^^^^^^^^^^^^^^^^^ +>one : Temporal.PlainTime +> : ^^^^^^^^^^^^^^^^^^ +>two : Temporal.PlainTime +> : ^^^^^^^^^^^^^^^^^^ +>three : Temporal.PlainTime +> : ^^^^^^^^^^^^^^^^^^ +>sort : (compareFn?: ((a: Temporal.PlainTime, b: Temporal.PlainTime) => number) | undefined) => Temporal.PlainTime[] +> : ^ ^^^^^ ^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainTime.compare : (one: Temporal.PlainTimeLike, two: Temporal.PlainTimeLike) => number +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainTime : Temporal.PlainTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>PlainTime : Temporal.PlainTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>compare : (one: Temporal.PlainTimeLike, two: Temporal.PlainTimeLike) => number +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + sorted.join(" "); // => '01:24:00 01:24:05 03:24:00' +>sorted.join(" ") : string +> : ^^^^^^ +>sorted.join : (separator?: string) => string +> : ^ ^^^ ^^^^^ +>sorted : Temporal.PlainTime[] +> : ^^^^^^^^^^^^^^^^^^^^ +>join : (separator?: string) => string +> : ^ ^^^ ^^^^^ +>" " : " " +> : ^^^ +} + +{ + // Backward transitions will repeat clock times + const zdtDst = Temporal.ZonedDateTime.from("2020-11-01T01:45-07:00[America/Los_Angeles]"); +>zdtDst : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.ZonedDateTime.from("2020-11-01T01:45-07:00[America/Los_Angeles]") : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.ZonedDateTime.from : (item: Temporal.ZonedDateTimeLike, options?: Temporal.ZonedDateTimeFromOptions) => Temporal.ZonedDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.ZonedDateTime : Temporal.ZonedDateTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>ZonedDateTime : Temporal.ZonedDateTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.ZonedDateTimeLike, options?: Temporal.ZonedDateTimeFromOptions) => Temporal.ZonedDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"2020-11-01T01:45-07:00[America/Los_Angeles]" : "2020-11-01T01:45-07:00[America/Los_Angeles]" +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + const zdtStandard = Temporal.ZonedDateTime.from("2020-11-01T01:30-08:00[America/Los_Angeles]"); +>zdtStandard : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.ZonedDateTime.from("2020-11-01T01:30-08:00[America/Los_Angeles]") : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.ZonedDateTime.from : (item: Temporal.ZonedDateTimeLike, options?: Temporal.ZonedDateTimeFromOptions) => Temporal.ZonedDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.ZonedDateTime : Temporal.ZonedDateTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>ZonedDateTime : Temporal.ZonedDateTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.ZonedDateTimeLike, options?: Temporal.ZonedDateTimeFromOptions) => Temporal.ZonedDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"2020-11-01T01:30-08:00[America/Los_Angeles]" : "2020-11-01T01:30-08:00[America/Los_Angeles]" +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + // The "first" 1:45 (in Daylight Time) is earlier than the "second" 1:30 (in Standard Time) + Temporal.ZonedDateTime.compare(zdtDst, zdtStandard); // => -1 +>Temporal.ZonedDateTime.compare(zdtDst, zdtStandard) : number +> : ^^^^^^ +>Temporal.ZonedDateTime.compare : (one: Temporal.ZonedDateTimeLike, two: Temporal.ZonedDateTimeLike) => number +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.ZonedDateTime : Temporal.ZonedDateTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>ZonedDateTime : Temporal.ZonedDateTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>compare : (one: Temporal.ZonedDateTimeLike, two: Temporal.ZonedDateTimeLike) => number +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>zdtDst : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>zdtStandard : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ + + // 1:45 is later than 1:30 when looking at a wall clock + Temporal.PlainTime.compare(zdtDst, zdtStandard); // => 1 +>Temporal.PlainTime.compare(zdtDst, zdtStandard) : number +> : ^^^^^^ +>Temporal.PlainTime.compare : (one: Temporal.PlainTimeLike, two: Temporal.PlainTimeLike) => number +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainTime : Temporal.PlainTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>PlainTime : Temporal.PlainTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>compare : (one: Temporal.PlainTimeLike, two: Temporal.PlainTimeLike) => number +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>zdtDst : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>zdtStandard : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ + + // Forward transitions will skip clock times. Skipped times will be disambiguated. + const zdtBase = Temporal.ZonedDateTime.from("2020-03-08[America/Los_Angeles]"); +>zdtBase : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.ZonedDateTime.from("2020-03-08[America/Los_Angeles]") : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.ZonedDateTime.from : (item: Temporal.ZonedDateTimeLike, options?: Temporal.ZonedDateTimeFromOptions) => Temporal.ZonedDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.ZonedDateTime : Temporal.ZonedDateTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>ZonedDateTime : Temporal.ZonedDateTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.ZonedDateTimeLike, options?: Temporal.ZonedDateTimeFromOptions) => Temporal.ZonedDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"2020-03-08[America/Los_Angeles]" : "2020-03-08[America/Los_Angeles]" +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + const timeSkipped = Temporal.PlainTime.from("02:30"); +>timeSkipped : Temporal.PlainTime +> : ^^^^^^^^^^^^^^^^^^ +>Temporal.PlainTime.from("02:30") : Temporal.PlainTime +> : ^^^^^^^^^^^^^^^^^^ +>Temporal.PlainTime.from : (item: Temporal.PlainTimeLike, options?: Temporal.OverflowOptions) => Temporal.PlainTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainTime : Temporal.PlainTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>PlainTime : Temporal.PlainTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.PlainTimeLike, options?: Temporal.OverflowOptions) => Temporal.PlainTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"02:30" : "02:30" +> : ^^^^^^^ + + const timeValid = Temporal.PlainTime.from("03:30"); +>timeValid : Temporal.PlainTime +> : ^^^^^^^^^^^^^^^^^^ +>Temporal.PlainTime.from("03:30") : Temporal.PlainTime +> : ^^^^^^^^^^^^^^^^^^ +>Temporal.PlainTime.from : (item: Temporal.PlainTimeLike, options?: Temporal.OverflowOptions) => Temporal.PlainTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainTime : Temporal.PlainTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>PlainTime : Temporal.PlainTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.PlainTimeLike, options?: Temporal.OverflowOptions) => Temporal.PlainTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"03:30" : "03:30" +> : ^^^^^^^ + + const zdtSkipped = zdtBase.withPlainTime(timeSkipped); +>zdtSkipped : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>zdtBase.withPlainTime(timeSkipped) : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>zdtBase.withPlainTime : (plainTime?: Temporal.PlainTimeLike) => Temporal.ZonedDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>zdtBase : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>withPlainTime : (plainTime?: Temporal.PlainTimeLike) => Temporal.ZonedDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>timeSkipped : Temporal.PlainTime +> : ^^^^^^^^^^^^^^^^^^ + + const zdtValid = zdtBase.withPlainTime(timeValid); +>zdtValid : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>zdtBase.withPlainTime(timeValid) : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>zdtBase.withPlainTime : (plainTime?: Temporal.PlainTimeLike) => Temporal.ZonedDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>zdtBase : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>withPlainTime : (plainTime?: Temporal.PlainTimeLike) => Temporal.ZonedDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>timeValid : Temporal.PlainTime +> : ^^^^^^^^^^^^^^^^^^ + + // The skipped time 2:30AM is disambiguated to 3:30AM, so the instants are equal + Temporal.ZonedDateTime.compare(zdtSkipped, zdtValid); // => 0 +>Temporal.ZonedDateTime.compare(zdtSkipped, zdtValid) : number +> : ^^^^^^ +>Temporal.ZonedDateTime.compare : (one: Temporal.ZonedDateTimeLike, two: Temporal.ZonedDateTimeLike) => number +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.ZonedDateTime : Temporal.ZonedDateTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>ZonedDateTime : Temporal.ZonedDateTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>compare : (one: Temporal.ZonedDateTimeLike, two: Temporal.ZonedDateTimeLike) => number +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>zdtSkipped : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>zdtValid : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ + + // 2:30 is earlier than 3:30 on a wall clock + Temporal.PlainTime.compare(timeSkipped, timeValid); // => -1 +>Temporal.PlainTime.compare(timeSkipped, timeValid) : number +> : ^^^^^^ +>Temporal.PlainTime.compare : (one: Temporal.PlainTimeLike, two: Temporal.PlainTimeLike) => number +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainTime : Temporal.PlainTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>PlainTime : Temporal.PlainTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>compare : (one: Temporal.PlainTimeLike, two: Temporal.PlainTimeLike) => number +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>timeSkipped : Temporal.PlainTime +> : ^^^^^^^^^^^^^^^^^^ +>timeValid : Temporal.PlainTime +> : ^^^^^^^^^^^^^^^^^^ +} + +{ + const time = Temporal.PlainTime.from("19:39:09.068346205"); +>time : Temporal.PlainTime +> : ^^^^^^^^^^^^^^^^^^ +>Temporal.PlainTime.from("19:39:09.068346205") : Temporal.PlainTime +> : ^^^^^^^^^^^^^^^^^^ +>Temporal.PlainTime.from : (item: Temporal.PlainTimeLike, options?: Temporal.OverflowOptions) => Temporal.PlainTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainTime : Temporal.PlainTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>PlainTime : Temporal.PlainTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.PlainTimeLike, options?: Temporal.OverflowOptions) => Temporal.PlainTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"19:39:09.068346205" : "19:39:09.068346205" +> : ^^^^^^^^^^^^^^^^^^^^ + + time.hour; // => 19 +>time.hour : number +> : ^^^^^^ +>time : Temporal.PlainTime +> : ^^^^^^^^^^^^^^^^^^ +>hour : number +> : ^^^^^^ + + time.minute; // => 39 +>time.minute : number +> : ^^^^^^ +>time : Temporal.PlainTime +> : ^^^^^^^^^^^^^^^^^^ +>minute : number +> : ^^^^^^ + + time.second; // => 9 +>time.second : number +> : ^^^^^^ +>time : Temporal.PlainTime +> : ^^^^^^^^^^^^^^^^^^ +>second : number +> : ^^^^^^ + + time.millisecond; // => 68 +>time.millisecond : number +> : ^^^^^^ +>time : Temporal.PlainTime +> : ^^^^^^^^^^^^^^^^^^ +>millisecond : number +> : ^^^^^^ + + time.microsecond; // => 346 +>time.microsecond : number +> : ^^^^^^ +>time : Temporal.PlainTime +> : ^^^^^^^^^^^^^^^^^^ +>microsecond : number +> : ^^^^^^ + + time.nanosecond; // => 205 +>time.nanosecond : number +> : ^^^^^^ +>time : Temporal.PlainTime +> : ^^^^^^^^^^^^^^^^^^ +>nanosecond : number +> : ^^^^^^ +} + +{ + const time = Temporal.PlainTime.from("19:39:09.068346205"); +>time : Temporal.PlainTime +> : ^^^^^^^^^^^^^^^^^^ +>Temporal.PlainTime.from("19:39:09.068346205") : Temporal.PlainTime +> : ^^^^^^^^^^^^^^^^^^ +>Temporal.PlainTime.from : (item: Temporal.PlainTimeLike, options?: Temporal.OverflowOptions) => Temporal.PlainTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainTime : Temporal.PlainTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>PlainTime : Temporal.PlainTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.PlainTimeLike, options?: Temporal.OverflowOptions) => Temporal.PlainTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"19:39:09.068346205" : "19:39:09.068346205" +> : ^^^^^^^^^^^^^^^^^^^^ + + // What's the top of the next hour? + time.add({ hours: 1 }).with({ +>time.add({ hours: 1 }).with({ minute: 0, second: 0, millisecond: 0, microsecond: 0, nanosecond: 0, }) : Temporal.PlainTime +> : ^^^^^^^^^^^^^^^^^^ +>time.add({ hours: 1 }).with : (timeLike: Temporal.PartialTemporalLike, options?: Temporal.OverflowOptions) => Temporal.PlainTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>time.add({ hours: 1 }) : Temporal.PlainTime +> : ^^^^^^^^^^^^^^^^^^ +>time.add : (duration: Temporal.DurationLike) => Temporal.PlainTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>time : Temporal.PlainTime +> : ^^^^^^^^^^^^^^^^^^ +>add : (duration: Temporal.DurationLike) => Temporal.PlainTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ hours: 1 } : { hours: number; } +> : ^^^^^^^^^^^^^^^^^^ +>hours : number +> : ^^^^^^ +>1 : 1 +> : ^ +>with : (timeLike: Temporal.PartialTemporalLike, options?: Temporal.OverflowOptions) => Temporal.PlainTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ minute: 0, second: 0, millisecond: 0, microsecond: 0, nanosecond: 0, } : { minute: number; second: number; millisecond: number; microsecond: number; nanosecond: number; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + minute: 0, +>minute : number +> : ^^^^^^ +>0 : 0 +> : ^ + + second: 0, +>second : number +> : ^^^^^^ +>0 : 0 +> : ^ + + millisecond: 0, +>millisecond : number +> : ^^^^^^ +>0 : 0 +> : ^ + + microsecond: 0, +>microsecond : number +> : ^^^^^^ +>0 : 0 +> : ^ + + nanosecond: 0, +>nanosecond : number +> : ^^^^^^ +>0 : 0 +> : ^ + + }); // => 20:00:00 +} + +{ + const time = Temporal.PlainTime.from("19:39:09.068346205"); +>time : Temporal.PlainTime +> : ^^^^^^^^^^^^^^^^^^ +>Temporal.PlainTime.from("19:39:09.068346205") : Temporal.PlainTime +> : ^^^^^^^^^^^^^^^^^^ +>Temporal.PlainTime.from : (item: Temporal.PlainTimeLike, options?: Temporal.OverflowOptions) => Temporal.PlainTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainTime : Temporal.PlainTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>PlainTime : Temporal.PlainTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.PlainTimeLike, options?: Temporal.OverflowOptions) => Temporal.PlainTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"19:39:09.068346205" : "19:39:09.068346205" +> : ^^^^^^^^^^^^^^^^^^^^ + + time.add({ minutes: 5, nanoseconds: 800 }); // => 19:44:09.068347005 +>time.add({ minutes: 5, nanoseconds: 800 }) : Temporal.PlainTime +> : ^^^^^^^^^^^^^^^^^^ +>time.add : (duration: Temporal.DurationLike) => Temporal.PlainTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>time : Temporal.PlainTime +> : ^^^^^^^^^^^^^^^^^^ +>add : (duration: Temporal.DurationLike) => Temporal.PlainTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ minutes: 5, nanoseconds: 800 } : { minutes: number; nanoseconds: number; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>minutes : number +> : ^^^^^^ +>5 : 5 +> : ^ +>nanoseconds : number +> : ^^^^^^ +>800 : 800 +> : ^^^ +} + +{ + const time = Temporal.PlainTime.from("19:39:09.068346205"); +>time : Temporal.PlainTime +> : ^^^^^^^^^^^^^^^^^^ +>Temporal.PlainTime.from("19:39:09.068346205") : Temporal.PlainTime +> : ^^^^^^^^^^^^^^^^^^ +>Temporal.PlainTime.from : (item: Temporal.PlainTimeLike, options?: Temporal.OverflowOptions) => Temporal.PlainTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainTime : Temporal.PlainTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>PlainTime : Temporal.PlainTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.PlainTimeLike, options?: Temporal.OverflowOptions) => Temporal.PlainTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"19:39:09.068346205" : "19:39:09.068346205" +> : ^^^^^^^^^^^^^^^^^^^^ + + time.subtract({ minutes: 5, nanoseconds: 800 }); // => 19:34:09.068345405 +>time.subtract({ minutes: 5, nanoseconds: 800 }) : Temporal.PlainTime +> : ^^^^^^^^^^^^^^^^^^ +>time.subtract : (duration: Temporal.DurationLike) => Temporal.PlainTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>time : Temporal.PlainTime +> : ^^^^^^^^^^^^^^^^^^ +>subtract : (duration: Temporal.DurationLike) => Temporal.PlainTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ minutes: 5, nanoseconds: 800 } : { minutes: number; nanoseconds: number; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>minutes : number +> : ^^^^^^ +>5 : 5 +> : ^ +>nanoseconds : number +> : ^^^^^^ +>800 : 800 +> : ^^^ +} + +{ + const time = Temporal.PlainTime.from("20:13:20.971398099"); +>time : Temporal.PlainTime +> : ^^^^^^^^^^^^^^^^^^ +>Temporal.PlainTime.from("20:13:20.971398099") : Temporal.PlainTime +> : ^^^^^^^^^^^^^^^^^^ +>Temporal.PlainTime.from : (item: Temporal.PlainTimeLike, options?: Temporal.OverflowOptions) => Temporal.PlainTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainTime : Temporal.PlainTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>PlainTime : Temporal.PlainTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.PlainTimeLike, options?: Temporal.OverflowOptions) => Temporal.PlainTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"20:13:20.971398099" : "20:13:20.971398099" +> : ^^^^^^^^^^^^^^^^^^^^ + + time.until(Temporal.PlainTime.from("22:39:09.068346205")); // => PT2H25M48.096948106S +>time.until(Temporal.PlainTime.from("22:39:09.068346205")) : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>time.until : (other: Temporal.PlainTimeLike, options?: Temporal.RoundingOptionsWithLargestUnit) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^ +>time : Temporal.PlainTime +> : ^^^^^^^^^^^^^^^^^^ +>until : (other: Temporal.PlainTimeLike, options?: Temporal.RoundingOptionsWithLargestUnit) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainTime.from("22:39:09.068346205") : Temporal.PlainTime +> : ^^^^^^^^^^^^^^^^^^ +>Temporal.PlainTime.from : (item: Temporal.PlainTimeLike, options?: Temporal.OverflowOptions) => Temporal.PlainTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainTime : Temporal.PlainTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>PlainTime : Temporal.PlainTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.PlainTimeLike, options?: Temporal.OverflowOptions) => Temporal.PlainTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"22:39:09.068346205" : "22:39:09.068346205" +> : ^^^^^^^^^^^^^^^^^^^^ + + time.until(Temporal.PlainTime.from("19:39:09.068346205")); // => -PT34M11.903051894S +>time.until(Temporal.PlainTime.from("19:39:09.068346205")) : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>time.until : (other: Temporal.PlainTimeLike, options?: Temporal.RoundingOptionsWithLargestUnit) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^ +>time : Temporal.PlainTime +> : ^^^^^^^^^^^^^^^^^^ +>until : (other: Temporal.PlainTimeLike, options?: Temporal.RoundingOptionsWithLargestUnit) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainTime.from("19:39:09.068346205") : Temporal.PlainTime +> : ^^^^^^^^^^^^^^^^^^ +>Temporal.PlainTime.from : (item: Temporal.PlainTimeLike, options?: Temporal.OverflowOptions) => Temporal.PlainTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainTime : Temporal.PlainTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>PlainTime : Temporal.PlainTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.PlainTimeLike, options?: Temporal.OverflowOptions) => Temporal.PlainTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"19:39:09.068346205" : "19:39:09.068346205" +> : ^^^^^^^^^^^^^^^^^^^^ + + // Rounding, for example if you don't care about sub-seconds + time.until(Temporal.PlainTime.from("22:39:09.068346205"), { smallestUnit: "second" }); +>time.until(Temporal.PlainTime.from("22:39:09.068346205"), { smallestUnit: "second" }) : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>time.until : (other: Temporal.PlainTimeLike, options?: Temporal.RoundingOptionsWithLargestUnit) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^ +>time : Temporal.PlainTime +> : ^^^^^^^^^^^^^^^^^^ +>until : (other: Temporal.PlainTimeLike, options?: Temporal.RoundingOptionsWithLargestUnit) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainTime.from("22:39:09.068346205") : Temporal.PlainTime +> : ^^^^^^^^^^^^^^^^^^ +>Temporal.PlainTime.from : (item: Temporal.PlainTimeLike, options?: Temporal.OverflowOptions) => Temporal.PlainTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainTime : Temporal.PlainTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>PlainTime : Temporal.PlainTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.PlainTimeLike, options?: Temporal.OverflowOptions) => Temporal.PlainTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"22:39:09.068346205" : "22:39:09.068346205" +> : ^^^^^^^^^^^^^^^^^^^^ +>{ smallestUnit: "second" } : { smallestUnit: "second"; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>smallestUnit : "second" +> : ^^^^^^^^ +>"second" : "second" +> : ^^^^^^^^ + + // => PT2H25M48S +} + +{ + const time = Temporal.PlainTime.from("20:13:20.971398099"); +>time : Temporal.PlainTime +> : ^^^^^^^^^^^^^^^^^^ +>Temporal.PlainTime.from("20:13:20.971398099") : Temporal.PlainTime +> : ^^^^^^^^^^^^^^^^^^ +>Temporal.PlainTime.from : (item: Temporal.PlainTimeLike, options?: Temporal.OverflowOptions) => Temporal.PlainTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainTime : Temporal.PlainTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>PlainTime : Temporal.PlainTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.PlainTimeLike, options?: Temporal.OverflowOptions) => Temporal.PlainTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"20:13:20.971398099" : "20:13:20.971398099" +> : ^^^^^^^^^^^^^^^^^^^^ + + time.since(Temporal.PlainTime.from("19:39:09.068346205")); // => PT34M11.903051894S +>time.since(Temporal.PlainTime.from("19:39:09.068346205")) : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>time.since : (other: Temporal.PlainTimeLike, options?: Temporal.RoundingOptionsWithLargestUnit) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^ +>time : Temporal.PlainTime +> : ^^^^^^^^^^^^^^^^^^ +>since : (other: Temporal.PlainTimeLike, options?: Temporal.RoundingOptionsWithLargestUnit) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainTime.from("19:39:09.068346205") : Temporal.PlainTime +> : ^^^^^^^^^^^^^^^^^^ +>Temporal.PlainTime.from : (item: Temporal.PlainTimeLike, options?: Temporal.OverflowOptions) => Temporal.PlainTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainTime : Temporal.PlainTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>PlainTime : Temporal.PlainTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.PlainTimeLike, options?: Temporal.OverflowOptions) => Temporal.PlainTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"19:39:09.068346205" : "19:39:09.068346205" +> : ^^^^^^^^^^^^^^^^^^^^ + + time.since(Temporal.PlainTime.from("22:39:09.068346205")); // => -PT2H25M48.096948106S +>time.since(Temporal.PlainTime.from("22:39:09.068346205")) : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>time.since : (other: Temporal.PlainTimeLike, options?: Temporal.RoundingOptionsWithLargestUnit) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^ +>time : Temporal.PlainTime +> : ^^^^^^^^^^^^^^^^^^ +>since : (other: Temporal.PlainTimeLike, options?: Temporal.RoundingOptionsWithLargestUnit) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainTime.from("22:39:09.068346205") : Temporal.PlainTime +> : ^^^^^^^^^^^^^^^^^^ +>Temporal.PlainTime.from : (item: Temporal.PlainTimeLike, options?: Temporal.OverflowOptions) => Temporal.PlainTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainTime : Temporal.PlainTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>PlainTime : Temporal.PlainTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.PlainTimeLike, options?: Temporal.OverflowOptions) => Temporal.PlainTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"22:39:09.068346205" : "22:39:09.068346205" +> : ^^^^^^^^^^^^^^^^^^^^ +} + +{ + const time = Temporal.PlainTime.from("19:39:09.068346205"); +>time : Temporal.PlainTime +> : ^^^^^^^^^^^^^^^^^^ +>Temporal.PlainTime.from("19:39:09.068346205") : Temporal.PlainTime +> : ^^^^^^^^^^^^^^^^^^ +>Temporal.PlainTime.from : (item: Temporal.PlainTimeLike, options?: Temporal.OverflowOptions) => Temporal.PlainTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainTime : Temporal.PlainTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>PlainTime : Temporal.PlainTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.PlainTimeLike, options?: Temporal.OverflowOptions) => Temporal.PlainTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"19:39:09.068346205" : "19:39:09.068346205" +> : ^^^^^^^^^^^^^^^^^^^^ + + // Round to a particular unit + time.round({ smallestUnit: "hour" }); // => 20:00:00 +>time.round({ smallestUnit: "hour" }) : Temporal.PlainTime +> : ^^^^^^^^^^^^^^^^^^ +>time.round : { (roundTo: Temporal.TimeUnit): Temporal.PlainTime; (roundTo: Temporal.RoundingOptions): Temporal.PlainTime; } +> : ^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^ +>time : Temporal.PlainTime +> : ^^^^^^^^^^^^^^^^^^ +>round : { (roundTo: Temporal.TimeUnit): Temporal.PlainTime; (roundTo: Temporal.RoundingOptions): Temporal.PlainTime; } +> : ^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^ +>{ smallestUnit: "hour" } : { smallestUnit: "hour"; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^ +>smallestUnit : "hour" +> : ^^^^^^ +>"hour" : "hour" +> : ^^^^^^ + + // Round to an increment of a unit, e.g. half an hour: + time.round({ roundingIncrement: 30, smallestUnit: "minute" }); +>time.round({ roundingIncrement: 30, smallestUnit: "minute" }) : Temporal.PlainTime +> : ^^^^^^^^^^^^^^^^^^ +>time.round : { (roundTo: Temporal.TimeUnit): Temporal.PlainTime; (roundTo: Temporal.RoundingOptions): Temporal.PlainTime; } +> : ^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^ +>time : Temporal.PlainTime +> : ^^^^^^^^^^^^^^^^^^ +>round : { (roundTo: Temporal.TimeUnit): Temporal.PlainTime; (roundTo: Temporal.RoundingOptions): Temporal.PlainTime; } +> : ^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^ +>{ roundingIncrement: 30, smallestUnit: "minute" } : { roundingIncrement: number; smallestUnit: "minute"; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>roundingIncrement : number +> : ^^^^^^ +>30 : 30 +> : ^^ +>smallestUnit : "minute" +> : ^^^^^^^^ +>"minute" : "minute" +> : ^^^^^^^^ + + // => 19:30:00 + // Round to the same increment but round up instead: + time.round({ roundingIncrement: 30, smallestUnit: "minute", roundingMode: "ceil" }); +>time.round({ roundingIncrement: 30, smallestUnit: "minute", roundingMode: "ceil" }) : Temporal.PlainTime +> : ^^^^^^^^^^^^^^^^^^ +>time.round : { (roundTo: Temporal.TimeUnit): Temporal.PlainTime; (roundTo: Temporal.RoundingOptions): Temporal.PlainTime; } +> : ^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^ +>time : Temporal.PlainTime +> : ^^^^^^^^^^^^^^^^^^ +>round : { (roundTo: Temporal.TimeUnit): Temporal.PlainTime; (roundTo: Temporal.RoundingOptions): Temporal.PlainTime; } +> : ^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^ +>{ roundingIncrement: 30, smallestUnit: "minute", roundingMode: "ceil" } : { roundingIncrement: number; smallestUnit: "minute"; roundingMode: "ceil"; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>roundingIncrement : number +> : ^^^^^^ +>30 : 30 +> : ^^ +>smallestUnit : "minute" +> : ^^^^^^^^ +>"minute" : "minute" +> : ^^^^^^^^ +>roundingMode : "ceil" +> : ^^^^^^ +>"ceil" : "ceil" +> : ^^^^^^ + + // => 20:00:00 +} + +{ + const time = Temporal.PlainTime.from("19:39:09.068346205"); +>time : Temporal.PlainTime +> : ^^^^^^^^^^^^^^^^^^ +>Temporal.PlainTime.from("19:39:09.068346205") : Temporal.PlainTime +> : ^^^^^^^^^^^^^^^^^^ +>Temporal.PlainTime.from : (item: Temporal.PlainTimeLike, options?: Temporal.OverflowOptions) => Temporal.PlainTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainTime : Temporal.PlainTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>PlainTime : Temporal.PlainTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.PlainTimeLike, options?: Temporal.OverflowOptions) => Temporal.PlainTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"19:39:09.068346205" : "19:39:09.068346205" +> : ^^^^^^^^^^^^^^^^^^^^ + + const other = Temporal.PlainTime.from("20:13:20.971398099"); +>other : Temporal.PlainTime +> : ^^^^^^^^^^^^^^^^^^ +>Temporal.PlainTime.from("20:13:20.971398099") : Temporal.PlainTime +> : ^^^^^^^^^^^^^^^^^^ +>Temporal.PlainTime.from : (item: Temporal.PlainTimeLike, options?: Temporal.OverflowOptions) => Temporal.PlainTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainTime : Temporal.PlainTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>PlainTime : Temporal.PlainTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.PlainTimeLike, options?: Temporal.OverflowOptions) => Temporal.PlainTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"20:13:20.971398099" : "20:13:20.971398099" +> : ^^^^^^^^^^^^^^^^^^^^ + + time.equals(other); // => false +>time.equals(other) : boolean +> : ^^^^^^^ +>time.equals : (other: Temporal.PlainTimeLike) => boolean +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>time : Temporal.PlainTime +> : ^^^^^^^^^^^^^^^^^^ +>equals : (other: Temporal.PlainTimeLike) => boolean +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>other : Temporal.PlainTime +> : ^^^^^^^^^^^^^^^^^^ + + time.equals(time); // => true +>time.equals(time) : boolean +> : ^^^^^^^ +>time.equals : (other: Temporal.PlainTimeLike) => boolean +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>time : Temporal.PlainTime +> : ^^^^^^^^^^^^^^^^^^ +>equals : (other: Temporal.PlainTimeLike) => boolean +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>time : Temporal.PlainTime +> : ^^^^^^^^^^^^^^^^^^ +} + +{ + const time = Temporal.PlainTime.from("19:39:09.068346205"); +>time : Temporal.PlainTime +> : ^^^^^^^^^^^^^^^^^^ +>Temporal.PlainTime.from("19:39:09.068346205") : Temporal.PlainTime +> : ^^^^^^^^^^^^^^^^^^ +>Temporal.PlainTime.from : (item: Temporal.PlainTimeLike, options?: Temporal.OverflowOptions) => Temporal.PlainTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainTime : Temporal.PlainTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>PlainTime : Temporal.PlainTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.PlainTimeLike, options?: Temporal.OverflowOptions) => Temporal.PlainTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"19:39:09.068346205" : "19:39:09.068346205" +> : ^^^^^^^^^^^^^^^^^^^^ + + time.toString(); // => '19:39:09.068346205' +>time.toString() : string +> : ^^^^^^ +>time.toString : (options?: Temporal.PlainTimeToStringOptions) => string +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>time : Temporal.PlainTime +> : ^^^^^^^^^^^^^^^^^^ +>toString : (options?: Temporal.PlainTimeToStringOptions) => string +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + time.toString({ smallestUnit: "minute" }); // => '19:39' +>time.toString({ smallestUnit: "minute" }) : string +> : ^^^^^^ +>time.toString : (options?: Temporal.PlainTimeToStringOptions) => string +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>time : Temporal.PlainTime +> : ^^^^^^^^^^^^^^^^^^ +>toString : (options?: Temporal.PlainTimeToStringOptions) => string +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ smallestUnit: "minute" } : { smallestUnit: "minute"; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>smallestUnit : "minute" +> : ^^^^^^^^ +>"minute" : "minute" +> : ^^^^^^^^ + + time.toString({ fractionalSecondDigits: 0 }); // => '19:39:09' +>time.toString({ fractionalSecondDigits: 0 }) : string +> : ^^^^^^ +>time.toString : (options?: Temporal.PlainTimeToStringOptions) => string +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>time : Temporal.PlainTime +> : ^^^^^^^^^^^^^^^^^^ +>toString : (options?: Temporal.PlainTimeToStringOptions) => string +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ fractionalSecondDigits: 0 } : { fractionalSecondDigits: 0; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>fractionalSecondDigits : 0 +> : ^ +>0 : 0 +> : ^ + + time.toString({ fractionalSecondDigits: 4 }); // => '19:39:09.0683' +>time.toString({ fractionalSecondDigits: 4 }) : string +> : ^^^^^^ +>time.toString : (options?: Temporal.PlainTimeToStringOptions) => string +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>time : Temporal.PlainTime +> : ^^^^^^^^^^^^^^^^^^ +>toString : (options?: Temporal.PlainTimeToStringOptions) => string +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ fractionalSecondDigits: 4 } : { fractionalSecondDigits: 4; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>fractionalSecondDigits : 4 +> : ^ +>4 : 4 +> : ^ + + time.toString({ fractionalSecondDigits: 5, roundingMode: "halfExpand" }); +>time.toString({ fractionalSecondDigits: 5, roundingMode: "halfExpand" }) : string +> : ^^^^^^ +>time.toString : (options?: Temporal.PlainTimeToStringOptions) => string +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>time : Temporal.PlainTime +> : ^^^^^^^^^^^^^^^^^^ +>toString : (options?: Temporal.PlainTimeToStringOptions) => string +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ fractionalSecondDigits: 5, roundingMode: "halfExpand" } : { fractionalSecondDigits: 5; roundingMode: "halfExpand"; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>fractionalSecondDigits : 5 +> : ^ +>5 : 5 +> : ^ +>roundingMode : "halfExpand" +> : ^^^^^^^^^^^^ +>"halfExpand" : "halfExpand" +> : ^^^^^^^^^^^^ + + // => '19:39:09.06835' +} + +{ + const time = Temporal.PlainTime.from("19:39:09.068346205"); +>time : Temporal.PlainTime +> : ^^^^^^^^^^^^^^^^^^ +>Temporal.PlainTime.from("19:39:09.068346205") : Temporal.PlainTime +> : ^^^^^^^^^^^^^^^^^^ +>Temporal.PlainTime.from : (item: Temporal.PlainTimeLike, options?: Temporal.OverflowOptions) => Temporal.PlainTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainTime : Temporal.PlainTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>PlainTime : Temporal.PlainTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.PlainTimeLike, options?: Temporal.OverflowOptions) => Temporal.PlainTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"19:39:09.068346205" : "19:39:09.068346205" +> : ^^^^^^^^^^^^^^^^^^^^ + + time.toLocaleString(); // example output: '7:39:09 PM' +>time.toLocaleString() : string +> : ^^^^^^ +>time.toLocaleString : (locales?: Intl.LocalesArgument, options?: Intl.DateTimeFormatOptions) => string +> : ^ ^^^ ^^ ^^^ ^^^^^ +>time : Temporal.PlainTime +> : ^^^^^^^^^^^^^^^^^^ +>toLocaleString : (locales?: Intl.LocalesArgument, options?: Intl.DateTimeFormatOptions) => string +> : ^ ^^^ ^^ ^^^ ^^^^^ + + time.toLocaleString("de-DE"); // example output: '19:39:09' +>time.toLocaleString("de-DE") : string +> : ^^^^^^ +>time.toLocaleString : (locales?: Intl.LocalesArgument, options?: Intl.DateTimeFormatOptions) => string +> : ^ ^^^ ^^ ^^^ ^^^^^ +>time : Temporal.PlainTime +> : ^^^^^^^^^^^^^^^^^^ +>toLocaleString : (locales?: Intl.LocalesArgument, options?: Intl.DateTimeFormatOptions) => string +> : ^ ^^^ ^^ ^^^ ^^^^^ +>"de-DE" : "de-DE" +> : ^^^^^^^ + + time.toLocaleString("de-DE", { timeZone: "Europe/Berlin" }); // => '19:39:09' +>time.toLocaleString("de-DE", { timeZone: "Europe/Berlin" }) : string +> : ^^^^^^ +>time.toLocaleString : (locales?: Intl.LocalesArgument, options?: Intl.DateTimeFormatOptions) => string +> : ^ ^^^ ^^ ^^^ ^^^^^ +>time : Temporal.PlainTime +> : ^^^^^^^^^^^^^^^^^^ +>toLocaleString : (locales?: Intl.LocalesArgument, options?: Intl.DateTimeFormatOptions) => string +> : ^ ^^^ ^^ ^^^ ^^^^^ +>"de-DE" : "de-DE" +> : ^^^^^^^ +>{ timeZone: "Europe/Berlin" } : { timeZone: string; } +> : ^^^^^^^^^^^^^^^^^^^^^ +>timeZone : string +> : ^^^^^^ +>"Europe/Berlin" : "Europe/Berlin" +> : ^^^^^^^^^^^^^^^ + + time.toLocaleString("en-US-u-nu-fullwide-hc-h24"); // => '19:39:09' +>time.toLocaleString("en-US-u-nu-fullwide-hc-h24") : string +> : ^^^^^^ +>time.toLocaleString : (locales?: Intl.LocalesArgument, options?: Intl.DateTimeFormatOptions) => string +> : ^ ^^^ ^^ ^^^ ^^^^^ +>time : Temporal.PlainTime +> : ^^^^^^^^^^^^^^^^^^ +>toLocaleString : (locales?: Intl.LocalesArgument, options?: Intl.DateTimeFormatOptions) => string +> : ^ ^^^ ^^ ^^^ ^^^^^ +>"en-US-u-nu-fullwide-hc-h24" : "en-US-u-nu-fullwide-hc-h24" +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +} + +{ + // Leet hour on pi day in 2020 + const datetime = new Temporal.PlainDateTime(2020, 3, 14, 13, 37); // => 2020-03-14T13:37:00 +>datetime : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>new Temporal.PlainDateTime(2020, 3, 14, 13, 37) : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDateTime : Temporal.PlainDateTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>PlainDateTime : Temporal.PlainDateTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>2020 : 2020 +> : ^^^^ +>3 : 3 +> : ^ +>14 : 14 +> : ^^ +>13 : 13 +> : ^^ +>37 : 37 +> : ^^ +} + +{ + let dt: Temporal.PlainDateTime; +>dt : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : any +> : ^^^ + + dt = Temporal.PlainDateTime.from("1995-12-07T03:24:30"); +>dt = Temporal.PlainDateTime.from("1995-12-07T03:24:30") : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>dt : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDateTime.from("1995-12-07T03:24:30") : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDateTime.from : (item: Temporal.PlainDateTimeLike, options?: Temporal.OverflowOptions) => Temporal.PlainDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDateTime : Temporal.PlainDateTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>PlainDateTime : Temporal.PlainDateTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.PlainDateTimeLike, options?: Temporal.OverflowOptions) => Temporal.PlainDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"1995-12-07T03:24:30" : "1995-12-07T03:24:30" +> : ^^^^^^^^^^^^^^^^^^^^^ + + dt = Temporal.PlainDateTime.from("19951207T032430"); +>dt = Temporal.PlainDateTime.from("19951207T032430") : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>dt : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDateTime.from("19951207T032430") : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDateTime.from : (item: Temporal.PlainDateTimeLike, options?: Temporal.OverflowOptions) => Temporal.PlainDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDateTime : Temporal.PlainDateTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>PlainDateTime : Temporal.PlainDateTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.PlainDateTimeLike, options?: Temporal.OverflowOptions) => Temporal.PlainDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"19951207T032430" : "19951207T032430" +> : ^^^^^^^^^^^^^^^^^ + + dt = Temporal.PlainDateTime.from("1995-12-07T03:24:30+01:00[Europe/Brussels]"); +>dt = Temporal.PlainDateTime.from("1995-12-07T03:24:30+01:00[Europe/Brussels]") : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>dt : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDateTime.from("1995-12-07T03:24:30+01:00[Europe/Brussels]") : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDateTime.from : (item: Temporal.PlainDateTimeLike, options?: Temporal.OverflowOptions) => Temporal.PlainDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDateTime : Temporal.PlainDateTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>PlainDateTime : Temporal.PlainDateTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.PlainDateTimeLike, options?: Temporal.OverflowOptions) => Temporal.PlainDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"1995-12-07T03:24:30+01:00[Europe/Brussels]" : "1995-12-07T03:24:30+01:00[Europe/Brussels]" +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + // => 1995-12-07T03:24:30 + // same as above; time zone is ignored + dt === Temporal.PlainDateTime.from(dt); // => false +>dt === Temporal.PlainDateTime.from(dt) : boolean +> : ^^^^^^^ +>dt : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDateTime.from(dt) : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDateTime.from : (item: Temporal.PlainDateTimeLike, options?: Temporal.OverflowOptions) => Temporal.PlainDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDateTime : Temporal.PlainDateTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>PlainDateTime : Temporal.PlainDateTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.PlainDateTimeLike, options?: Temporal.OverflowOptions) => Temporal.PlainDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>dt : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ + + dt = Temporal.PlainDateTime.from({ +>dt = Temporal.PlainDateTime.from({ year: 1995, month: 12, day: 7, hour: 3, minute: 24, second: 30, millisecond: 0, microsecond: 3, nanosecond: 500, }) : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>dt : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDateTime.from({ year: 1995, month: 12, day: 7, hour: 3, minute: 24, second: 30, millisecond: 0, microsecond: 3, nanosecond: 500, }) : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDateTime.from : (item: Temporal.PlainDateTimeLike, options?: Temporal.OverflowOptions) => Temporal.PlainDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDateTime : Temporal.PlainDateTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>PlainDateTime : Temporal.PlainDateTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.PlainDateTimeLike, options?: Temporal.OverflowOptions) => Temporal.PlainDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ year: 1995, month: 12, day: 7, hour: 3, minute: 24, second: 30, millisecond: 0, microsecond: 3, nanosecond: 500, } : { year: number; month: number; day: number; hour: number; minute: number; second: number; millisecond: number; microsecond: number; nanosecond: number; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + year: 1995, +>year : number +> : ^^^^^^ +>1995 : 1995 +> : ^^^^ + + month: 12, +>month : number +> : ^^^^^^ +>12 : 12 +> : ^^ + + day: 7, +>day : number +> : ^^^^^^ +>7 : 7 +> : ^ + + hour: 3, +>hour : number +> : ^^^^^^ +>3 : 3 +> : ^ + + minute: 24, +>minute : number +> : ^^^^^^ +>24 : 24 +> : ^^ + + second: 30, +>second : number +> : ^^^^^^ +>30 : 30 +> : ^^ + + millisecond: 0, +>millisecond : number +> : ^^^^^^ +>0 : 0 +> : ^ + + microsecond: 3, +>microsecond : number +> : ^^^^^^ +>3 : 3 +> : ^ + + nanosecond: 500, +>nanosecond : number +> : ^^^^^^ +>500 : 500 +> : ^^^ + + }); // => 1995-12-07T03:24:30.0000035 + dt = Temporal.PlainDateTime.from({ year: 1995, month: 12, day: 7 }); // => 1995-12-07T00:00:00 +>dt = Temporal.PlainDateTime.from({ year: 1995, month: 12, day: 7 }) : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>dt : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDateTime.from({ year: 1995, month: 12, day: 7 }) : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDateTime.from : (item: Temporal.PlainDateTimeLike, options?: Temporal.OverflowOptions) => Temporal.PlainDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDateTime : Temporal.PlainDateTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>PlainDateTime : Temporal.PlainDateTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.PlainDateTimeLike, options?: Temporal.OverflowOptions) => Temporal.PlainDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ year: 1995, month: 12, day: 7 } : { year: number; month: number; day: number; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>year : number +> : ^^^^^^ +>1995 : 1995 +> : ^^^^ +>month : number +> : ^^^^^^ +>12 : 12 +> : ^^ +>day : number +> : ^^^^^^ +>7 : 7 +> : ^ + + dt = Temporal.PlainDateTime.from(Temporal.PlainDate.from("1995-12-07T03:24:30")); +>dt = Temporal.PlainDateTime.from(Temporal.PlainDate.from("1995-12-07T03:24:30")) : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>dt : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDateTime.from(Temporal.PlainDate.from("1995-12-07T03:24:30")) : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDateTime.from : (item: Temporal.PlainDateTimeLike, options?: Temporal.OverflowOptions) => Temporal.PlainDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDateTime : Temporal.PlainDateTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>PlainDateTime : Temporal.PlainDateTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.PlainDateTimeLike, options?: Temporal.OverflowOptions) => Temporal.PlainDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDate.from("1995-12-07T03:24:30") : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDate.from : (item: Temporal.PlainDateLike, options?: Temporal.OverflowOptions) => Temporal.PlainDate +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDate : Temporal.PlainDateConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>PlainDate : Temporal.PlainDateConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.PlainDateLike, options?: Temporal.OverflowOptions) => Temporal.PlainDate +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"1995-12-07T03:24:30" : "1995-12-07T03:24:30" +> : ^^^^^^^^^^^^^^^^^^^^^ + + // => 1995-12-07T00:00:00 + // same as above; Temporal.PlainDate has year, month, and day properties + + dt = Temporal.PlainDateTime.from({ year: 5756, month: 3, day: 14, hour: 3, minute: 24, second: 30, calendar: "hebrew" }); +>dt = Temporal.PlainDateTime.from({ year: 5756, month: 3, day: 14, hour: 3, minute: 24, second: 30, calendar: "hebrew" }) : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>dt : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDateTime.from({ year: 5756, month: 3, day: 14, hour: 3, minute: 24, second: 30, calendar: "hebrew" }) : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDateTime.from : (item: Temporal.PlainDateTimeLike, options?: Temporal.OverflowOptions) => Temporal.PlainDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDateTime : Temporal.PlainDateTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>PlainDateTime : Temporal.PlainDateTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.PlainDateTimeLike, options?: Temporal.OverflowOptions) => Temporal.PlainDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ year: 5756, month: 3, day: 14, hour: 3, minute: 24, second: 30, calendar: "hebrew" } : { year: number; month: number; day: number; hour: number; minute: number; second: number; calendar: string; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>year : number +> : ^^^^^^ +>5756 : 5756 +> : ^^^^ +>month : number +> : ^^^^^^ +>3 : 3 +> : ^ +>day : number +> : ^^^^^^ +>14 : 14 +> : ^^ +>hour : number +> : ^^^^^^ +>3 : 3 +> : ^ +>minute : number +> : ^^^^^^ +>24 : 24 +> : ^^ +>second : number +> : ^^^^^^ +>30 : 30 +> : ^^ +>calendar : string +> : ^^^^^^ +>"hebrew" : "hebrew" +> : ^^^^^^^^ + + // => 1995-12-07T03:24:30[u-ca=hebrew] + + // Different overflow modes + dt = Temporal.PlainDateTime.from({ year: 2001, month: 13, day: 1 }, { overflow: "constrain" }); +>dt = Temporal.PlainDateTime.from({ year: 2001, month: 13, day: 1 }, { overflow: "constrain" }) : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>dt : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDateTime.from({ year: 2001, month: 13, day: 1 }, { overflow: "constrain" }) : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDateTime.from : (item: Temporal.PlainDateTimeLike, options?: Temporal.OverflowOptions) => Temporal.PlainDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDateTime : Temporal.PlainDateTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>PlainDateTime : Temporal.PlainDateTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.PlainDateTimeLike, options?: Temporal.OverflowOptions) => Temporal.PlainDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ year: 2001, month: 13, day: 1 } : { year: number; month: number; day: number; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>year : number +> : ^^^^^^ +>2001 : 2001 +> : ^^^^ +>month : number +> : ^^^^^^ +>13 : 13 +> : ^^ +>day : number +> : ^^^^^^ +>1 : 1 +> : ^ +>{ overflow: "constrain" } : { overflow: "constrain"; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^ +>overflow : "constrain" +> : ^^^^^^^^^^^ +>"constrain" : "constrain" +> : ^^^^^^^^^^^ + + // => 2001-12-01T00:00:00 + dt = Temporal.PlainDateTime.from({ year: 2001, month: 1, day: 32 }, { overflow: "constrain" }); +>dt = Temporal.PlainDateTime.from({ year: 2001, month: 1, day: 32 }, { overflow: "constrain" }) : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>dt : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDateTime.from({ year: 2001, month: 1, day: 32 }, { overflow: "constrain" }) : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDateTime.from : (item: Temporal.PlainDateTimeLike, options?: Temporal.OverflowOptions) => Temporal.PlainDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDateTime : Temporal.PlainDateTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>PlainDateTime : Temporal.PlainDateTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.PlainDateTimeLike, options?: Temporal.OverflowOptions) => Temporal.PlainDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ year: 2001, month: 1, day: 32 } : { year: number; month: number; day: number; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>year : number +> : ^^^^^^ +>2001 : 2001 +> : ^^^^ +>month : number +> : ^^^^^^ +>1 : 1 +> : ^ +>day : number +> : ^^^^^^ +>32 : 32 +> : ^^ +>{ overflow: "constrain" } : { overflow: "constrain"; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^ +>overflow : "constrain" +> : ^^^^^^^^^^^ +>"constrain" : "constrain" +> : ^^^^^^^^^^^ + + // => 2001-01-31T00:00:00 + dt = Temporal.PlainDateTime.from({ year: 2001, month: 1, day: 1, hour: 25 }, { overflow: "constrain" }); +>dt = Temporal.PlainDateTime.from({ year: 2001, month: 1, day: 1, hour: 25 }, { overflow: "constrain" }) : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>dt : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDateTime.from({ year: 2001, month: 1, day: 1, hour: 25 }, { overflow: "constrain" }) : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDateTime.from : (item: Temporal.PlainDateTimeLike, options?: Temporal.OverflowOptions) => Temporal.PlainDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDateTime : Temporal.PlainDateTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>PlainDateTime : Temporal.PlainDateTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.PlainDateTimeLike, options?: Temporal.OverflowOptions) => Temporal.PlainDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ year: 2001, month: 1, day: 1, hour: 25 } : { year: number; month: number; day: number; hour: number; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>year : number +> : ^^^^^^ +>2001 : 2001 +> : ^^^^ +>month : number +> : ^^^^^^ +>1 : 1 +> : ^ +>day : number +> : ^^^^^^ +>1 : 1 +> : ^ +>hour : number +> : ^^^^^^ +>25 : 25 +> : ^^ +>{ overflow: "constrain" } : { overflow: "constrain"; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^ +>overflow : "constrain" +> : ^^^^^^^^^^^ +>"constrain" : "constrain" +> : ^^^^^^^^^^^ + + // => 2001-01-01T23:00:00 + dt = Temporal.PlainDateTime.from({ year: 2001, month: 1, day: 1, minute: 60 }, { overflow: "constrain" }); +>dt = Temporal.PlainDateTime.from({ year: 2001, month: 1, day: 1, minute: 60 }, { overflow: "constrain" }) : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>dt : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDateTime.from({ year: 2001, month: 1, day: 1, minute: 60 }, { overflow: "constrain" }) : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDateTime.from : (item: Temporal.PlainDateTimeLike, options?: Temporal.OverflowOptions) => Temporal.PlainDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDateTime : Temporal.PlainDateTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>PlainDateTime : Temporal.PlainDateTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.PlainDateTimeLike, options?: Temporal.OverflowOptions) => Temporal.PlainDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ year: 2001, month: 1, day: 1, minute: 60 } : { year: number; month: number; day: number; minute: number; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>year : number +> : ^^^^^^ +>2001 : 2001 +> : ^^^^ +>month : number +> : ^^^^^^ +>1 : 1 +> : ^ +>day : number +> : ^^^^^^ +>1 : 1 +> : ^ +>minute : number +> : ^^^^^^ +>60 : 60 +> : ^^ +>{ overflow: "constrain" } : { overflow: "constrain"; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^ +>overflow : "constrain" +> : ^^^^^^^^^^^ +>"constrain" : "constrain" +> : ^^^^^^^^^^^ + + // => 2001-01-01T00:59:00 + dt = Temporal.PlainDateTime.from({ year: 2001, month: 13, day: 1 }, { overflow: "reject" }); +>dt = Temporal.PlainDateTime.from({ year: 2001, month: 13, day: 1 }, { overflow: "reject" }) : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>dt : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDateTime.from({ year: 2001, month: 13, day: 1 }, { overflow: "reject" }) : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDateTime.from : (item: Temporal.PlainDateTimeLike, options?: Temporal.OverflowOptions) => Temporal.PlainDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDateTime : Temporal.PlainDateTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>PlainDateTime : Temporal.PlainDateTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.PlainDateTimeLike, options?: Temporal.OverflowOptions) => Temporal.PlainDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ year: 2001, month: 13, day: 1 } : { year: number; month: number; day: number; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>year : number +> : ^^^^^^ +>2001 : 2001 +> : ^^^^ +>month : number +> : ^^^^^^ +>13 : 13 +> : ^^ +>day : number +> : ^^^^^^ +>1 : 1 +> : ^ +>{ overflow: "reject" } : { overflow: "reject"; } +> : ^^^^^^^^^^^^^^^^^^^^^^^ +>overflow : "reject" +> : ^^^^^^^^ +>"reject" : "reject" +> : ^^^^^^^^ + + // => throws + dt = Temporal.PlainDateTime.from({ year: 2001, month: 1, day: 32 }, { overflow: "reject" }); +>dt = Temporal.PlainDateTime.from({ year: 2001, month: 1, day: 32 }, { overflow: "reject" }) : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>dt : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDateTime.from({ year: 2001, month: 1, day: 32 }, { overflow: "reject" }) : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDateTime.from : (item: Temporal.PlainDateTimeLike, options?: Temporal.OverflowOptions) => Temporal.PlainDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDateTime : Temporal.PlainDateTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>PlainDateTime : Temporal.PlainDateTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.PlainDateTimeLike, options?: Temporal.OverflowOptions) => Temporal.PlainDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ year: 2001, month: 1, day: 32 } : { year: number; month: number; day: number; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>year : number +> : ^^^^^^ +>2001 : 2001 +> : ^^^^ +>month : number +> : ^^^^^^ +>1 : 1 +> : ^ +>day : number +> : ^^^^^^ +>32 : 32 +> : ^^ +>{ overflow: "reject" } : { overflow: "reject"; } +> : ^^^^^^^^^^^^^^^^^^^^^^^ +>overflow : "reject" +> : ^^^^^^^^ +>"reject" : "reject" +> : ^^^^^^^^ + + // => throws + dt = Temporal.PlainDateTime.from({ year: 2001, month: 1, day: 1, hour: 25 }, { overflow: "reject" }); +>dt = Temporal.PlainDateTime.from({ year: 2001, month: 1, day: 1, hour: 25 }, { overflow: "reject" }) : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>dt : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDateTime.from({ year: 2001, month: 1, day: 1, hour: 25 }, { overflow: "reject" }) : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDateTime.from : (item: Temporal.PlainDateTimeLike, options?: Temporal.OverflowOptions) => Temporal.PlainDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDateTime : Temporal.PlainDateTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>PlainDateTime : Temporal.PlainDateTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.PlainDateTimeLike, options?: Temporal.OverflowOptions) => Temporal.PlainDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ year: 2001, month: 1, day: 1, hour: 25 } : { year: number; month: number; day: number; hour: number; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>year : number +> : ^^^^^^ +>2001 : 2001 +> : ^^^^ +>month : number +> : ^^^^^^ +>1 : 1 +> : ^ +>day : number +> : ^^^^^^ +>1 : 1 +> : ^ +>hour : number +> : ^^^^^^ +>25 : 25 +> : ^^ +>{ overflow: "reject" } : { overflow: "reject"; } +> : ^^^^^^^^^^^^^^^^^^^^^^^ +>overflow : "reject" +> : ^^^^^^^^ +>"reject" : "reject" +> : ^^^^^^^^ + + // => throws + dt = Temporal.PlainDateTime.from({ year: 2001, month: 1, day: 1, minute: 60 }, { overflow: "reject" }); +>dt = Temporal.PlainDateTime.from({ year: 2001, month: 1, day: 1, minute: 60 }, { overflow: "reject" }) : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>dt : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDateTime.from({ year: 2001, month: 1, day: 1, minute: 60 }, { overflow: "reject" }) : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDateTime.from : (item: Temporal.PlainDateTimeLike, options?: Temporal.OverflowOptions) => Temporal.PlainDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDateTime : Temporal.PlainDateTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>PlainDateTime : Temporal.PlainDateTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.PlainDateTimeLike, options?: Temporal.OverflowOptions) => Temporal.PlainDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ year: 2001, month: 1, day: 1, minute: 60 } : { year: number; month: number; day: number; minute: number; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>year : number +> : ^^^^^^ +>2001 : 2001 +> : ^^^^ +>month : number +> : ^^^^^^ +>1 : 1 +> : ^ +>day : number +> : ^^^^^^ +>1 : 1 +> : ^ +>minute : number +> : ^^^^^^ +>60 : 60 +> : ^^ +>{ overflow: "reject" } : { overflow: "reject"; } +> : ^^^^^^^^^^^^^^^^^^^^^^^ +>overflow : "reject" +> : ^^^^^^^^ +>"reject" : "reject" +> : ^^^^^^^^ + + // => throws +} + +{ + const one = Temporal.PlainDateTime.from("1995-12-07T03:24"); +>one : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDateTime.from("1995-12-07T03:24") : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDateTime.from : (item: Temporal.PlainDateTimeLike, options?: Temporal.OverflowOptions) => Temporal.PlainDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDateTime : Temporal.PlainDateTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>PlainDateTime : Temporal.PlainDateTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.PlainDateTimeLike, options?: Temporal.OverflowOptions) => Temporal.PlainDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"1995-12-07T03:24" : "1995-12-07T03:24" +> : ^^^^^^^^^^^^^^^^^^ + + const two = Temporal.PlainDateTime.from("1995-12-07T01:24"); +>two : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDateTime.from("1995-12-07T01:24") : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDateTime.from : (item: Temporal.PlainDateTimeLike, options?: Temporal.OverflowOptions) => Temporal.PlainDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDateTime : Temporal.PlainDateTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>PlainDateTime : Temporal.PlainDateTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.PlainDateTimeLike, options?: Temporal.OverflowOptions) => Temporal.PlainDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"1995-12-07T01:24" : "1995-12-07T01:24" +> : ^^^^^^^^^^^^^^^^^^ + + const three = Temporal.PlainDateTime.from("2015-12-07T01:24"); +>three : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDateTime.from("2015-12-07T01:24") : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDateTime.from : (item: Temporal.PlainDateTimeLike, options?: Temporal.OverflowOptions) => Temporal.PlainDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDateTime : Temporal.PlainDateTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>PlainDateTime : Temporal.PlainDateTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.PlainDateTimeLike, options?: Temporal.OverflowOptions) => Temporal.PlainDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"2015-12-07T01:24" : "2015-12-07T01:24" +> : ^^^^^^^^^^^^^^^^^^ + + const sorted = [one, two, three].sort(Temporal.PlainDateTime.compare); +>sorted : Temporal.PlainDateTime[] +> : ^^^^^^^^^^^^^^^^^^^^^^^^ +>[one, two, three].sort(Temporal.PlainDateTime.compare) : Temporal.PlainDateTime[] +> : ^^^^^^^^^^^^^^^^^^^^^^^^ +>[one, two, three].sort : (compareFn?: ((a: Temporal.PlainDateTime, b: Temporal.PlainDateTime) => number) | undefined) => Temporal.PlainDateTime[] +> : ^ ^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>[one, two, three] : Temporal.PlainDateTime[] +> : ^^^^^^^^^^^^^^^^^^^^^^^^ +>one : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>two : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>three : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>sort : (compareFn?: ((a: Temporal.PlainDateTime, b: Temporal.PlainDateTime) => number) | undefined) => Temporal.PlainDateTime[] +> : ^ ^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDateTime.compare : (one: Temporal.PlainDateTimeLike, two: Temporal.PlainDateTimeLike) => number +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDateTime : Temporal.PlainDateTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>PlainDateTime : Temporal.PlainDateTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>compare : (one: Temporal.PlainDateTimeLike, two: Temporal.PlainDateTimeLike) => number +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + sorted.join(" "); +>sorted.join(" ") : string +> : ^^^^^^ +>sorted.join : (separator?: string) => string +> : ^ ^^^ ^^^^^ +>sorted : Temporal.PlainDateTime[] +> : ^^^^^^^^^^^^^^^^^^^^^^^^ +>join : (separator?: string) => string +> : ^ ^^^ ^^^^^ +>" " : " " +> : ^^^ + + // => '1995-12-07T01:24:00 1995-12-07T03:24:00 2015-12-07T01:24:00' +} + +{ + let dt: Temporal.PlainDateTime; +>dt : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : any +> : ^^^ + + dt = Temporal.PlainDateTime.from("1995-12-07T03:24:30.000003500"); +>dt = Temporal.PlainDateTime.from("1995-12-07T03:24:30.000003500") : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>dt : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDateTime.from("1995-12-07T03:24:30.000003500") : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDateTime.from : (item: Temporal.PlainDateTimeLike, options?: Temporal.OverflowOptions) => Temporal.PlainDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDateTime : Temporal.PlainDateTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>PlainDateTime : Temporal.PlainDateTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.PlainDateTimeLike, options?: Temporal.OverflowOptions) => Temporal.PlainDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"1995-12-07T03:24:30.000003500" : "1995-12-07T03:24:30.000003500" +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + dt.year; // => 1995 +>dt.year : number +> : ^^^^^^ +>dt : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>year : number +> : ^^^^^^ + + dt.month; // => 12 +>dt.month : number +> : ^^^^^^ +>dt : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>month : number +> : ^^^^^^ + + dt.monthCode; // => 'M12' +>dt.monthCode : string +> : ^^^^^^ +>dt : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>monthCode : string +> : ^^^^^^ + + dt.day; // => 7 +>dt.day : number +> : ^^^^^^ +>dt : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>day : number +> : ^^^^^^ + + dt.hour; // => 3 +>dt.hour : number +> : ^^^^^^ +>dt : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>hour : number +> : ^^^^^^ + + dt.minute; // => 24 +>dt.minute : number +> : ^^^^^^ +>dt : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>minute : number +> : ^^^^^^ + + dt.second; // => 30 +>dt.second : number +> : ^^^^^^ +>dt : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>second : number +> : ^^^^^^ + + dt.millisecond; // => 0 +>dt.millisecond : number +> : ^^^^^^ +>dt : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>millisecond : number +> : ^^^^^^ + + dt.microsecond; // => 3 +>dt.microsecond : number +> : ^^^^^^ +>dt : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>microsecond : number +> : ^^^^^^ + + dt.nanosecond; // => 500 +>dt.nanosecond : number +> : ^^^^^^ +>dt : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>nanosecond : number +> : ^^^^^^ + + dt = Temporal.PlainDateTime.from("2019-02-23T03:24:30.000003500[u-ca=hebrew]"); +>dt = Temporal.PlainDateTime.from("2019-02-23T03:24:30.000003500[u-ca=hebrew]") : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>dt : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDateTime.from("2019-02-23T03:24:30.000003500[u-ca=hebrew]") : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDateTime.from : (item: Temporal.PlainDateTimeLike, options?: Temporal.OverflowOptions) => Temporal.PlainDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDateTime : Temporal.PlainDateTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>PlainDateTime : Temporal.PlainDateTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.PlainDateTimeLike, options?: Temporal.OverflowOptions) => Temporal.PlainDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"2019-02-23T03:24:30.000003500[u-ca=hebrew]" : "2019-02-23T03:24:30.000003500[u-ca=hebrew]" +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + dt.year; // => 5779 +>dt.year : number +> : ^^^^^^ +>dt : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>year : number +> : ^^^^^^ + + dt.month; // => 6 +>dt.month : number +> : ^^^^^^ +>dt : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>month : number +> : ^^^^^^ + + dt.monthCode; // => 'M05L' +>dt.monthCode : string +> : ^^^^^^ +>dt : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>monthCode : string +> : ^^^^^^ + + dt.day; // => 18 +>dt.day : number +> : ^^^^^^ +>dt : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>day : number +> : ^^^^^^ + + dt.hour; // => 3 +>dt.hour : number +> : ^^^^^^ +>dt : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>hour : number +> : ^^^^^^ + + dt.minute; // => 24 +>dt.minute : number +> : ^^^^^^ +>dt : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>minute : number +> : ^^^^^^ + + dt.second; // => 30 +>dt.second : number +> : ^^^^^^ +>dt : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>second : number +> : ^^^^^^ + + dt.millisecond; // => 0 +>dt.millisecond : number +> : ^^^^^^ +>dt : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>millisecond : number +> : ^^^^^^ + + dt.microsecond; // => 3 +>dt.microsecond : number +> : ^^^^^^ +>dt : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>microsecond : number +> : ^^^^^^ + + dt.nanosecond; // => 500 +>dt.nanosecond : number +> : ^^^^^^ +>dt : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>nanosecond : number +> : ^^^^^^ +} + +{ + const date = Temporal.PlainDateTime.from("-000015-01-01T12:30[u-ca=gregory]"); +>date : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDateTime.from("-000015-01-01T12:30[u-ca=gregory]") : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDateTime.from : (item: Temporal.PlainDateTimeLike, options?: Temporal.OverflowOptions) => Temporal.PlainDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDateTime : Temporal.PlainDateTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>PlainDateTime : Temporal.PlainDateTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.PlainDateTimeLike, options?: Temporal.OverflowOptions) => Temporal.PlainDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"-000015-01-01T12:30[u-ca=gregory]" : "-000015-01-01T12:30[u-ca=gregory]" +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + date.era; +>date.era : string | undefined +> : ^^^^^^^^^^^^^^^^^^ +>date : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>era : string | undefined +> : ^^^^^^^^^^^^^^^^^^ + + // => 'bce' + date.eraYear; +>date.eraYear : number | undefined +> : ^^^^^^^^^^^^^^^^^^ +>date : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>eraYear : number | undefined +> : ^^^^^^^^^^^^^^^^^^ + + // => 16 + date.year; +>date.year : number +> : ^^^^^^ +>date : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>year : number +> : ^^^^^^ + + // => -15 +} + +{ + const dt = Temporal.PlainDateTime.from("1995-12-07T03:24:30.000003500"); +>dt : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDateTime.from("1995-12-07T03:24:30.000003500") : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDateTime.from : (item: Temporal.PlainDateTimeLike, options?: Temporal.OverflowOptions) => Temporal.PlainDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDateTime : Temporal.PlainDateTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>PlainDateTime : Temporal.PlainDateTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.PlainDateTimeLike, options?: Temporal.OverflowOptions) => Temporal.PlainDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"1995-12-07T03:24:30.000003500" : "1995-12-07T03:24:30.000003500" +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + ["MON", "TUE", "WED", "THU", "FRI", "SAT", "SUN"][dt.dayOfWeek - 1]; // => 'THU' +>["MON", "TUE", "WED", "THU", "FRI", "SAT", "SUN"][dt.dayOfWeek - 1] : string +> : ^^^^^^ +>["MON", "TUE", "WED", "THU", "FRI", "SAT", "SUN"] : string[] +> : ^^^^^^^^ +>"MON" : "MON" +> : ^^^^^ +>"TUE" : "TUE" +> : ^^^^^ +>"WED" : "WED" +> : ^^^^^ +>"THU" : "THU" +> : ^^^^^ +>"FRI" : "FRI" +> : ^^^^^ +>"SAT" : "SAT" +> : ^^^^^ +>"SUN" : "SUN" +> : ^^^^^ +>dt.dayOfWeek - 1 : number +> : ^^^^^^ +>dt.dayOfWeek : number +> : ^^^^^^ +>dt : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>dayOfWeek : number +> : ^^^^^^ +>1 : 1 +> : ^ +} + +{ + const dt = Temporal.PlainDateTime.from("1995-12-07T03:24:30.000003500"); +>dt : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDateTime.from("1995-12-07T03:24:30.000003500") : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDateTime.from : (item: Temporal.PlainDateTimeLike, options?: Temporal.OverflowOptions) => Temporal.PlainDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDateTime : Temporal.PlainDateTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>PlainDateTime : Temporal.PlainDateTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.PlainDateTimeLike, options?: Temporal.OverflowOptions) => Temporal.PlainDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"1995-12-07T03:24:30.000003500" : "1995-12-07T03:24:30.000003500" +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + // ISO ordinal date + console.log(dt.year, dt.dayOfYear); // => '1995 341' +>console.log(dt.year, dt.dayOfYear) : void +> : ^^^^ +>console.log : (...data: any[]) => void +> : ^^^^ ^^ ^^^^^ +>console : Console +> : ^^^^^^^ +>log : (...data: any[]) => void +> : ^^^^ ^^ ^^^^^ +>dt.year : number +> : ^^^^^^ +>dt : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>year : number +> : ^^^^^^ +>dt.dayOfYear : number +> : ^^^^^^ +>dt : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>dayOfYear : number +> : ^^^^^^ +} + +{ + const dt = Temporal.PlainDateTime.from("2022-01-01T03:24:30.000003500"); +>dt : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDateTime.from("2022-01-01T03:24:30.000003500") : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDateTime.from : (item: Temporal.PlainDateTimeLike, options?: Temporal.OverflowOptions) => Temporal.PlainDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDateTime : Temporal.PlainDateTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>PlainDateTime : Temporal.PlainDateTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.PlainDateTimeLike, options?: Temporal.OverflowOptions) => Temporal.PlainDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"2022-01-01T03:24:30.000003500" : "2022-01-01T03:24:30.000003500" +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + // ISO week date + console.log(dt.yearOfWeek, dt.weekOfYear, dt.dayOfWeek); // => '2021 52 6' +>console.log(dt.yearOfWeek, dt.weekOfYear, dt.dayOfWeek) : void +> : ^^^^ +>console.log : (...data: any[]) => void +> : ^^^^ ^^ ^^^^^ +>console : Console +> : ^^^^^^^ +>log : (...data: any[]) => void +> : ^^^^ ^^ ^^^^^ +>dt.yearOfWeek : number | undefined +> : ^^^^^^^^^^^^^^^^^^ +>dt : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>yearOfWeek : number | undefined +> : ^^^^^^^^^^^^^^^^^^ +>dt.weekOfYear : number | undefined +> : ^^^^^^^^^^^^^^^^^^ +>dt : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>weekOfYear : number | undefined +> : ^^^^^^^^^^^^^^^^^^ +>dt.dayOfWeek : number +> : ^^^^^^ +>dt : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>dayOfWeek : number +> : ^^^^^^ +} + +{ + const dt = Temporal.PlainDateTime.from("1995-12-07T03:24:30.000003500"); +>dt : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDateTime.from("1995-12-07T03:24:30.000003500") : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDateTime.from : (item: Temporal.PlainDateTimeLike, options?: Temporal.OverflowOptions) => Temporal.PlainDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDateTime : Temporal.PlainDateTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>PlainDateTime : Temporal.PlainDateTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.PlainDateTimeLike, options?: Temporal.OverflowOptions) => Temporal.PlainDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"1995-12-07T03:24:30.000003500" : "1995-12-07T03:24:30.000003500" +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + dt.daysInWeek; // => 7 +>dt.daysInWeek : number +> : ^^^^^^ +>dt : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>daysInWeek : number +> : ^^^^^^ +} + +{ + // Attempt to write some mnemonic poetry + const monthsByDays: Record = {}; +>monthsByDays : Record +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : any +> : ^^^ +>{} : {} +> : ^^ + + for (let month = 1; month <= 12; month++) { +>month : number +> : ^^^^^^ +>1 : 1 +> : ^ +>month <= 12 : boolean +> : ^^^^^^^ +>month : number +> : ^^^^^^ +>12 : 12 +> : ^^ +>month++ : number +> : ^^^^^^ +>month : number +> : ^^^^^^ + + const dt = Temporal.Now.plainDateTimeISO().with({ month }); +>dt : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.Now.plainDateTimeISO().with({ month }) : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.Now.plainDateTimeISO().with : (dateTimeLike: Temporal.PartialTemporalLike, options?: Temporal.OverflowOptions) => Temporal.PlainDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.Now.plainDateTimeISO() : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.Now.plainDateTimeISO : (timeZone?: Temporal.TimeZoneLike) => Temporal.PlainDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.Now : typeof Temporal.Now +> : ^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>Now : typeof Temporal.Now +> : ^^^^^^^^^^^^^^^^^^^ +>plainDateTimeISO : (timeZone?: Temporal.TimeZoneLike) => Temporal.PlainDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>with : (dateTimeLike: Temporal.PartialTemporalLike, options?: Temporal.OverflowOptions) => Temporal.PlainDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ month } : { month: number; } +> : ^^^^^^^^^^^^^^^^^^ +>month : number +> : ^^^^^^ + + monthsByDays[dt.daysInMonth] = (monthsByDays[dt.daysInMonth] || []).concat(dt); +>monthsByDays[dt.daysInMonth] = (monthsByDays[dt.daysInMonth] || []).concat(dt) : Temporal.PlainDateTime[] +> : ^^^^^^^^^^^^^^^^^^^^^^^^ +>monthsByDays[dt.daysInMonth] : Temporal.PlainDateTime[] +> : ^^^^^^^^^^^^^^^^^^^^^^^^ +>monthsByDays : Record +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>dt.daysInMonth : number +> : ^^^^^^ +>dt : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>daysInMonth : number +> : ^^^^^^ +>(monthsByDays[dt.daysInMonth] || []).concat(dt) : Temporal.PlainDateTime[] +> : ^^^^^^^^^^^^^^^^^^^^^^^^ +>(monthsByDays[dt.daysInMonth] || []).concat : { (...items: ConcatArray[]): Temporal.PlainDateTime[]; (...items: (Temporal.PlainDateTime | ConcatArray)[]): Temporal.PlainDateTime[]; } +> : ^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>(monthsByDays[dt.daysInMonth] || []) : Temporal.PlainDateTime[] +> : ^^^^^^^^^^^^^^^^^^^^^^^^ +>monthsByDays[dt.daysInMonth] || [] : Temporal.PlainDateTime[] +> : ^^^^^^^^^^^^^^^^^^^^^^^^ +>monthsByDays[dt.daysInMonth] : Temporal.PlainDateTime[] +> : ^^^^^^^^^^^^^^^^^^^^^^^^ +>monthsByDays : Record +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>dt.daysInMonth : number +> : ^^^^^^ +>dt : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>daysInMonth : number +> : ^^^^^^ +>[] : never[] +> : ^^^^^^^ +>concat : { (...items: ConcatArray[]): Temporal.PlainDateTime[]; (...items: (Temporal.PlainDateTime | ConcatArray)[]): Temporal.PlainDateTime[]; } +> : ^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>dt : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ + } + + const strings = monthsByDays[30].map(dt => dt.toLocaleString("en", { month: "long" })); +>strings : string[] +> : ^^^^^^^^ +>monthsByDays[30].map(dt => dt.toLocaleString("en", { month: "long" })) : string[] +> : ^^^^^^^^ +>monthsByDays[30].map : (callbackfn: (value: Temporal.PlainDateTime, index: number, array: Temporal.PlainDateTime[]) => U, thisArg?: any) => U[] +> : ^ ^^ ^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^ ^^^^^^^^ +>monthsByDays[30] : Temporal.PlainDateTime[] +> : ^^^^^^^^^^^^^^^^^^^^^^^^ +>monthsByDays : Record +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>30 : 30 +> : ^^ +>map : (callbackfn: (value: Temporal.PlainDateTime, index: number, array: Temporal.PlainDateTime[]) => U, thisArg?: any) => U[] +> : ^ ^^ ^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^ ^^^^^^^^ +>dt => dt.toLocaleString("en", { month: "long" }) : (dt: Temporal.PlainDateTime) => string +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>dt : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>dt.toLocaleString("en", { month: "long" }) : string +> : ^^^^^^ +>dt.toLocaleString : (locales?: Intl.LocalesArgument, options?: Intl.DateTimeFormatOptions) => string +> : ^ ^^^ ^^ ^^^ ^^^^^ +>dt : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>toLocaleString : (locales?: Intl.LocalesArgument, options?: Intl.DateTimeFormatOptions) => string +> : ^ ^^^ ^^ ^^^ ^^^^^ +>"en" : "en" +> : ^^^^ +>{ month: "long" } : { month: "long"; } +> : ^^^^^^^^^^^^^^^^^^ +>month : "long" +> : ^^^^^^ +>"long" : "long" +> : ^^^^^^ + + // Shuffle to improve poem as determined empirically + strings.unshift(strings.pop()!); +>strings.unshift(strings.pop()!) : number +> : ^^^^^^ +>strings.unshift : (...items: string[]) => number +> : ^^^^ ^^^^^^^^^^^^^^^ +>strings : string[] +> : ^^^^^^^^ +>unshift : (...items: string[]) => number +> : ^^^^ ^^^^^^^^^^^^^^^ +>strings.pop()! : string +> : ^^^^^^ +>strings.pop() : string | undefined +> : ^^^^^^^^^^^^^^^^^^ +>strings.pop : () => string | undefined +> : ^^^^^^^^^^^^^^^^^^^^^^^^ +>strings : string[] +> : ^^^^^^^^ +>pop : () => string | undefined +> : ^^^^^^^^^^^^^^^^^^^^^^^^ + + const format = new Intl.ListFormat("en"); +>format : Intl.ListFormat +> : ^^^^^^^^^^^^^^^ +>new Intl.ListFormat("en") : Intl.ListFormat +> : ^^^^^^^^^^^^^^^ +>Intl.ListFormat : { new (locales?: Intl.LocalesArgument, options?: Intl.ListFormatOptions): Intl.ListFormat; prototype: Intl.ListFormat; supportedLocalesOf(locales: Intl.LocalesArgument, options?: Pick): Intl.UnicodeBCP47LocaleIdentifier[]; } +> : ^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^ ^^^ ^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^ +>Intl : typeof Intl +> : ^^^^^^^^^^^ +>ListFormat : { new (locales?: Intl.LocalesArgument, options?: Intl.ListFormatOptions): Intl.ListFormat; prototype: Intl.ListFormat; supportedLocalesOf(locales: Intl.LocalesArgument, options?: Pick): Intl.UnicodeBCP47LocaleIdentifier[]; } +> : ^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^ ^^^ ^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^ +>"en" : "en" +> : ^^^^ + + const poem = `Thirty days hath ${format.format(strings)}`; +>poem : string +> : ^^^^^^ +>`Thirty days hath ${format.format(strings)}` : string +> : ^^^^^^ +>format.format(strings) : string +> : ^^^^^^ +>format.format : (list: Iterable) => string +> : ^ ^^ ^^^^^ +>format : Intl.ListFormat +> : ^^^^^^^^^^^^^^^ +>format : (list: Iterable) => string +> : ^ ^^ ^^^^^ +>strings : string[] +> : ^^^^^^^^ + + console.log(poem); +>console.log(poem) : void +> : ^^^^ +>console.log : (...data: any[]) => void +> : ^^^^ ^^ ^^^^^ +>console : Console +> : ^^^^^^^ +>log : (...data: any[]) => void +> : ^^^^ ^^ ^^^^^ +>poem : string +> : ^^^^^^ +} + +{ + const dt = Temporal.Now.plainDateTimeISO(); +>dt : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.Now.plainDateTimeISO() : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.Now.plainDateTimeISO : (timeZone?: Temporal.TimeZoneLike) => Temporal.PlainDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.Now : typeof Temporal.Now +> : ^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>Now : typeof Temporal.Now +> : ^^^^^^^^^^^^^^^^^^^ +>plainDateTimeISO : (timeZone?: Temporal.TimeZoneLike) => Temporal.PlainDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + const percent = dt.dayOfYear / dt.daysInYear; +>percent : number +> : ^^^^^^ +>dt.dayOfYear / dt.daysInYear : number +> : ^^^^^^ +>dt.dayOfYear : number +> : ^^^^^^ +>dt : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>dayOfYear : number +> : ^^^^^^ +>dt.daysInYear : number +> : ^^^^^^ +>dt : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>daysInYear : number +> : ^^^^^^ + + `The year is ${percent.toLocaleString("en", { style: "percent" })} over!`; +>`The year is ${percent.toLocaleString("en", { style: "percent" })} over!` : string +> : ^^^^^^ +>percent.toLocaleString("en", { style: "percent" }) : string +> : ^^^^^^ +>percent.toLocaleString : (locales?: string | string[], options?: Intl.NumberFormatOptions) => string +> : ^ ^^^ ^^ ^^^ ^^^^^ +>percent : number +> : ^^^^^^ +>toLocaleString : (locales?: string | string[], options?: Intl.NumberFormatOptions) => string +> : ^ ^^^ ^^ ^^^ ^^^^^ +>"en" : "en" +> : ^^^^ +>{ style: "percent" } : { style: "percent"; } +> : ^^^^^^^^^^^^^^^^^^^^^ +>style : "percent" +> : ^^^^^^^^^ +>"percent" : "percent" +> : ^^^^^^^^^ + + // example output: "The year is 10% over!" +} + +{ + const dt = Temporal.PlainDate.from("1900-01-01T12:00"); +>dt : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDate.from("1900-01-01T12:00") : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDate.from : (item: Temporal.PlainDateLike, options?: Temporal.OverflowOptions) => Temporal.PlainDate +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDate : Temporal.PlainDateConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>PlainDate : Temporal.PlainDateConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.PlainDateLike, options?: Temporal.OverflowOptions) => Temporal.PlainDate +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"1900-01-01T12:00" : "1900-01-01T12:00" +> : ^^^^^^^^^^^^^^^^^^ + + dt.monthsInYear; // => 12 +>dt.monthsInYear : number +> : ^^^^^^ +>dt : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>monthsInYear : number +> : ^^^^^^ +} + +{ + // Is this year a leap year? + const dt = Temporal.Now.plainDateTimeISO(); +>dt : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.Now.plainDateTimeISO() : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.Now.plainDateTimeISO : (timeZone?: Temporal.TimeZoneLike) => Temporal.PlainDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.Now : typeof Temporal.Now +> : ^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>Now : typeof Temporal.Now +> : ^^^^^^^^^^^^^^^^^^^ +>plainDateTimeISO : (timeZone?: Temporal.TimeZoneLike) => Temporal.PlainDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + dt.inLeapYear; // example output: true +>dt.inLeapYear : boolean +> : ^^^^^^^ +>dt : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>inLeapYear : boolean +> : ^^^^^^^ + + // Is 2100 a leap year? (no, because it's divisible by 100 and not 400) + dt.with({ year: 2100 }).inLeapYear; // => false +>dt.with({ year: 2100 }).inLeapYear : boolean +> : ^^^^^^^ +>dt.with({ year: 2100 }) : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>dt.with : (dateTimeLike: Temporal.PartialTemporalLike, options?: Temporal.OverflowOptions) => Temporal.PlainDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>dt : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>with : (dateTimeLike: Temporal.PartialTemporalLike, options?: Temporal.OverflowOptions) => Temporal.PlainDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ year: 2100 } : { year: number; } +> : ^^^^^^^^^^^^^^^^^ +>year : number +> : ^^^^^^ +>2100 : 2100 +> : ^^^^ +>inLeapYear : boolean +> : ^^^^^^^ +} + +{ + const dt = Temporal.PlainDateTime.from("1995-12-07T03:24:30.000003500"); +>dt : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDateTime.from("1995-12-07T03:24:30.000003500") : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDateTime.from : (item: Temporal.PlainDateTimeLike, options?: Temporal.OverflowOptions) => Temporal.PlainDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDateTime : Temporal.PlainDateTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>PlainDateTime : Temporal.PlainDateTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.PlainDateTimeLike, options?: Temporal.OverflowOptions) => Temporal.PlainDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"1995-12-07T03:24:30.000003500" : "1995-12-07T03:24:30.000003500" +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + dt.with({ year: 2015, second: 31 }); // => 2015-12-07T03:24:31.0000035 +>dt.with({ year: 2015, second: 31 }) : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>dt.with : (dateTimeLike: Temporal.PartialTemporalLike, options?: Temporal.OverflowOptions) => Temporal.PlainDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>dt : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>with : (dateTimeLike: Temporal.PartialTemporalLike, options?: Temporal.OverflowOptions) => Temporal.PlainDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ year: 2015, second: 31 } : { year: number; second: number; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>year : number +> : ^^^^^^ +>2015 : 2015 +> : ^^^^ +>second : number +> : ^^^^^^ +>31 : 31 +> : ^^ +} + +{ + const dt = Temporal.PlainDateTime.from("2015-12-07T03:24:30.000003500"); +>dt : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDateTime.from("2015-12-07T03:24:30.000003500") : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDateTime.from : (item: Temporal.PlainDateTimeLike, options?: Temporal.OverflowOptions) => Temporal.PlainDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDateTime : Temporal.PlainDateTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>PlainDateTime : Temporal.PlainDateTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.PlainDateTimeLike, options?: Temporal.OverflowOptions) => Temporal.PlainDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"2015-12-07T03:24:30.000003500" : "2015-12-07T03:24:30.000003500" +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + dt.withPlainTime({ hour: 10 }); // => 2015-12-07T10:00:00 +>dt.withPlainTime({ hour: 10 }) : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>dt.withPlainTime : (plainTime?: Temporal.PlainTimeLike) => Temporal.PlainDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>dt : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>withPlainTime : (plainTime?: Temporal.PlainTimeLike) => Temporal.PlainDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ hour: 10 } : { hour: number; } +> : ^^^^^^^^^^^^^^^^^ +>hour : number +> : ^^^^^^ +>10 : 10 +> : ^^ + + const time = Temporal.PlainTime.from("11:22"); +>time : Temporal.PlainTime +> : ^^^^^^^^^^^^^^^^^^ +>Temporal.PlainTime.from("11:22") : Temporal.PlainTime +> : ^^^^^^^^^^^^^^^^^^ +>Temporal.PlainTime.from : (item: Temporal.PlainTimeLike, options?: Temporal.OverflowOptions) => Temporal.PlainTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainTime : Temporal.PlainTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>PlainTime : Temporal.PlainTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.PlainTimeLike, options?: Temporal.OverflowOptions) => Temporal.PlainTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"11:22" : "11:22" +> : ^^^^^^^ + + dt.withPlainTime(time); // => 2015-12-07T11:22:00 +>dt.withPlainTime(time) : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>dt.withPlainTime : (plainTime?: Temporal.PlainTimeLike) => Temporal.PlainDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>dt : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>withPlainTime : (plainTime?: Temporal.PlainTimeLike) => Temporal.PlainDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>time : Temporal.PlainTime +> : ^^^^^^^^^^^^^^^^^^ + + dt.withPlainTime("12:34"); // => 2015-12-07T12:34:00 +>dt.withPlainTime("12:34") : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>dt.withPlainTime : (plainTime?: Temporal.PlainTimeLike) => Temporal.PlainDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>dt : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>withPlainTime : (plainTime?: Temporal.PlainTimeLike) => Temporal.PlainDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"12:34" : "12:34" +> : ^^^^^^^ + + // easier for chaining + dt.add({ days: 2, hours: 22 }).withPlainTime("00:00"); // => 2015-12-10T00:00:00 +>dt.add({ days: 2, hours: 22 }).withPlainTime("00:00") : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>dt.add({ days: 2, hours: 22 }).withPlainTime : (plainTime?: Temporal.PlainTimeLike) => Temporal.PlainDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>dt.add({ days: 2, hours: 22 }) : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>dt.add : (duration: Temporal.DurationLike, options?: Temporal.OverflowOptions) => Temporal.PlainDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>dt : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>add : (duration: Temporal.DurationLike, options?: Temporal.OverflowOptions) => Temporal.PlainDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ days: 2, hours: 22 } : { days: number; hours: number; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>days : number +> : ^^^^^^ +>2 : 2 +> : ^ +>hours : number +> : ^^^^^^ +>22 : 22 +> : ^^ +>withPlainTime : (plainTime?: Temporal.PlainTimeLike) => Temporal.PlainDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"00:00" : "00:00" +> : ^^^^^^^ +} + +{ + const dt = Temporal.PlainDateTime.from("1995-12-07T03:24:30.000003500[u-ca=japanese]"); +>dt : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDateTime.from("1995-12-07T03:24:30.000003500[u-ca=japanese]") : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDateTime.from : (item: Temporal.PlainDateTimeLike, options?: Temporal.OverflowOptions) => Temporal.PlainDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDateTime : Temporal.PlainDateTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>PlainDateTime : Temporal.PlainDateTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.PlainDateTimeLike, options?: Temporal.OverflowOptions) => Temporal.PlainDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"1995-12-07T03:24:30.000003500[u-ca=japanese]" : "1995-12-07T03:24:30.000003500[u-ca=japanese]" +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + dt.withCalendar("iso8601"); // => 1995-12-07T03:24:30.0000035 +>dt.withCalendar("iso8601") : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>dt.withCalendar : (calendar: Temporal.CalendarLike) => Temporal.PlainDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>dt : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>withCalendar : (calendar: Temporal.CalendarLike) => Temporal.PlainDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"iso8601" : "iso8601" +> : ^^^^^^^^^ +} + +{ + let dt: Temporal.PlainDateTime; +>dt : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : any +> : ^^^ + + dt = Temporal.PlainDateTime.from("1995-12-07T03:24:30.000003500"); +>dt = Temporal.PlainDateTime.from("1995-12-07T03:24:30.000003500") : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>dt : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDateTime.from("1995-12-07T03:24:30.000003500") : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDateTime.from : (item: Temporal.PlainDateTimeLike, options?: Temporal.OverflowOptions) => Temporal.PlainDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDateTime : Temporal.PlainDateTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>PlainDateTime : Temporal.PlainDateTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.PlainDateTimeLike, options?: Temporal.OverflowOptions) => Temporal.PlainDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"1995-12-07T03:24:30.000003500" : "1995-12-07T03:24:30.000003500" +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + dt.add({ years: 20, months: 4, nanoseconds: 500 }); // => 2016-04-07T03:24:30.000004 +>dt.add({ years: 20, months: 4, nanoseconds: 500 }) : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>dt.add : (duration: Temporal.DurationLike, options?: Temporal.OverflowOptions) => Temporal.PlainDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>dt : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>add : (duration: Temporal.DurationLike, options?: Temporal.OverflowOptions) => Temporal.PlainDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ years: 20, months: 4, nanoseconds: 500 } : { years: number; months: number; nanoseconds: number; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>years : number +> : ^^^^^^ +>20 : 20 +> : ^^ +>months : number +> : ^^^^^^ +>4 : 4 +> : ^ +>nanoseconds : number +> : ^^^^^^ +>500 : 500 +> : ^^^ + + dt = Temporal.PlainDateTime.from("2019-01-31T15:30"); +>dt = Temporal.PlainDateTime.from("2019-01-31T15:30") : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>dt : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDateTime.from("2019-01-31T15:30") : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDateTime.from : (item: Temporal.PlainDateTimeLike, options?: Temporal.OverflowOptions) => Temporal.PlainDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDateTime : Temporal.PlainDateTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>PlainDateTime : Temporal.PlainDateTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.PlainDateTimeLike, options?: Temporal.OverflowOptions) => Temporal.PlainDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"2019-01-31T15:30" : "2019-01-31T15:30" +> : ^^^^^^^^^^^^^^^^^^ + + dt.add({ months: 1 }); // => 2019-02-28T15:30:00 +>dt.add({ months: 1 }) : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>dt.add : (duration: Temporal.DurationLike, options?: Temporal.OverflowOptions) => Temporal.PlainDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>dt : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>add : (duration: Temporal.DurationLike, options?: Temporal.OverflowOptions) => Temporal.PlainDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ months: 1 } : { months: number; } +> : ^^^^^^^^^^^^^^^^^^^ +>months : number +> : ^^^^^^ +>1 : 1 +> : ^ + + dt.add({ months: 1 }, { overflow: "reject" }); // => throws +>dt.add({ months: 1 }, { overflow: "reject" }) : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>dt.add : (duration: Temporal.DurationLike, options?: Temporal.OverflowOptions) => Temporal.PlainDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>dt : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>add : (duration: Temporal.DurationLike, options?: Temporal.OverflowOptions) => Temporal.PlainDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ months: 1 } : { months: number; } +> : ^^^^^^^^^^^^^^^^^^^ +>months : number +> : ^^^^^^ +>1 : 1 +> : ^ +>{ overflow: "reject" } : { overflow: "reject"; } +> : ^^^^^^^^^^^^^^^^^^^^^^^ +>overflow : "reject" +> : ^^^^^^^^ +>"reject" : "reject" +> : ^^^^^^^^ +} + +{ + let dt: Temporal.PlainDateTime; +>dt : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : any +> : ^^^ + + dt = Temporal.PlainDateTime.from("1995-12-07T03:24:30.000003500"); +>dt = Temporal.PlainDateTime.from("1995-12-07T03:24:30.000003500") : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>dt : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDateTime.from("1995-12-07T03:24:30.000003500") : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDateTime.from : (item: Temporal.PlainDateTimeLike, options?: Temporal.OverflowOptions) => Temporal.PlainDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDateTime : Temporal.PlainDateTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>PlainDateTime : Temporal.PlainDateTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.PlainDateTimeLike, options?: Temporal.OverflowOptions) => Temporal.PlainDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"1995-12-07T03:24:30.000003500" : "1995-12-07T03:24:30.000003500" +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + dt.subtract({ years: 20, months: 4, nanoseconds: 500 }); // => 1975-08-07T03:24:30.000003 +>dt.subtract({ years: 20, months: 4, nanoseconds: 500 }) : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>dt.subtract : (duration: Temporal.DurationLike, options?: Temporal.OverflowOptions) => Temporal.PlainDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>dt : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>subtract : (duration: Temporal.DurationLike, options?: Temporal.OverflowOptions) => Temporal.PlainDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ years: 20, months: 4, nanoseconds: 500 } : { years: number; months: number; nanoseconds: number; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>years : number +> : ^^^^^^ +>20 : 20 +> : ^^ +>months : number +> : ^^^^^^ +>4 : 4 +> : ^ +>nanoseconds : number +> : ^^^^^^ +>500 : 500 +> : ^^^ + + dt = Temporal.PlainDateTime.from("2019-03-31T15:30"); +>dt = Temporal.PlainDateTime.from("2019-03-31T15:30") : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>dt : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDateTime.from("2019-03-31T15:30") : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDateTime.from : (item: Temporal.PlainDateTimeLike, options?: Temporal.OverflowOptions) => Temporal.PlainDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDateTime : Temporal.PlainDateTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>PlainDateTime : Temporal.PlainDateTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.PlainDateTimeLike, options?: Temporal.OverflowOptions) => Temporal.PlainDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"2019-03-31T15:30" : "2019-03-31T15:30" +> : ^^^^^^^^^^^^^^^^^^ + + dt.subtract({ months: 1 }); // => 2019-02-28T15:30:00 +>dt.subtract({ months: 1 }) : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>dt.subtract : (duration: Temporal.DurationLike, options?: Temporal.OverflowOptions) => Temporal.PlainDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>dt : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>subtract : (duration: Temporal.DurationLike, options?: Temporal.OverflowOptions) => Temporal.PlainDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ months: 1 } : { months: number; } +> : ^^^^^^^^^^^^^^^^^^^ +>months : number +> : ^^^^^^ +>1 : 1 +> : ^ + + dt.subtract({ months: 1 }, { overflow: "reject" }); // => throws +>dt.subtract({ months: 1 }, { overflow: "reject" }) : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>dt.subtract : (duration: Temporal.DurationLike, options?: Temporal.OverflowOptions) => Temporal.PlainDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>dt : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>subtract : (duration: Temporal.DurationLike, options?: Temporal.OverflowOptions) => Temporal.PlainDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ months: 1 } : { months: number; } +> : ^^^^^^^^^^^^^^^^^^^ +>months : number +> : ^^^^^^ +>1 : 1 +> : ^ +>{ overflow: "reject" } : { overflow: "reject"; } +> : ^^^^^^^^^^^^^^^^^^^^^^^ +>overflow : "reject" +> : ^^^^^^^^ +>"reject" : "reject" +> : ^^^^^^^^ +} + +{ + const dt1 = Temporal.PlainDateTime.from("1995-12-07T03:24:30.000003500"); +>dt1 : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDateTime.from("1995-12-07T03:24:30.000003500") : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDateTime.from : (item: Temporal.PlainDateTimeLike, options?: Temporal.OverflowOptions) => Temporal.PlainDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDateTime : Temporal.PlainDateTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>PlainDateTime : Temporal.PlainDateTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.PlainDateTimeLike, options?: Temporal.OverflowOptions) => Temporal.PlainDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"1995-12-07T03:24:30.000003500" : "1995-12-07T03:24:30.000003500" +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + const dt2 = Temporal.PlainDateTime.from("2019-01-31T15:30"); +>dt2 : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDateTime.from("2019-01-31T15:30") : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDateTime.from : (item: Temporal.PlainDateTimeLike, options?: Temporal.OverflowOptions) => Temporal.PlainDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDateTime : Temporal.PlainDateTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>PlainDateTime : Temporal.PlainDateTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.PlainDateTimeLike, options?: Temporal.OverflowOptions) => Temporal.PlainDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"2019-01-31T15:30" : "2019-01-31T15:30" +> : ^^^^^^^^^^^^^^^^^^ + + dt1.until(dt2); +>dt1.until(dt2) : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>dt1.until : (other: Temporal.PlainDateTimeLike, options?: Temporal.RoundingOptionsWithLargestUnit) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^ +>dt1 : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>until : (other: Temporal.PlainDateTimeLike, options?: Temporal.RoundingOptionsWithLargestUnit) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^ +>dt2 : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ + + // => P8456DT12H5M29.9999965S + dt1.until(dt2, { largestUnit: "year" }); +>dt1.until(dt2, { largestUnit: "year" }) : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>dt1.until : (other: Temporal.PlainDateTimeLike, options?: Temporal.RoundingOptionsWithLargestUnit) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^ +>dt1 : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>until : (other: Temporal.PlainDateTimeLike, options?: Temporal.RoundingOptionsWithLargestUnit) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^ +>dt2 : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>{ largestUnit: "year" } : { largestUnit: "year"; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^ +>largestUnit : "year" +> : ^^^^^^ +>"year" : "year" +> : ^^^^^^ + + // => P23Y1M24DT12H5M29.9999965S + dt2.until(dt1, { largestUnit: "year" }); +>dt2.until(dt1, { largestUnit: "year" }) : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>dt2.until : (other: Temporal.PlainDateTimeLike, options?: Temporal.RoundingOptionsWithLargestUnit) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^ +>dt2 : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>until : (other: Temporal.PlainDateTimeLike, options?: Temporal.RoundingOptionsWithLargestUnit) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^ +>dt1 : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>{ largestUnit: "year" } : { largestUnit: "year"; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^ +>largestUnit : "year" +> : ^^^^^^ +>"year" : "year" +> : ^^^^^^ + + // => -P23Y1M24DT12H5M29.9999965S + dt1.until(dt2, { largestUnit: "nanosecond" }); +>dt1.until(dt2, { largestUnit: "nanosecond" }) : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>dt1.until : (other: Temporal.PlainDateTimeLike, options?: Temporal.RoundingOptionsWithLargestUnit) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^ +>dt1 : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>until : (other: Temporal.PlainDateTimeLike, options?: Temporal.RoundingOptionsWithLargestUnit) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^ +>dt2 : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>{ largestUnit: "nanosecond" } : { largestUnit: "nanosecond"; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>largestUnit : "nanosecond" +> : ^^^^^^^^^^^^ +>"nanosecond" : "nanosecond" +> : ^^^^^^^^^^^^ + + // => PT730641929.999996544S + // (precision lost) + + // Rounding, for example if you don't care about sub-seconds + dt1.until(dt2, { smallestUnit: "second" }); +>dt1.until(dt2, { smallestUnit: "second" }) : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>dt1.until : (other: Temporal.PlainDateTimeLike, options?: Temporal.RoundingOptionsWithLargestUnit) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^ +>dt1 : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>until : (other: Temporal.PlainDateTimeLike, options?: Temporal.RoundingOptionsWithLargestUnit) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^ +>dt2 : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>{ smallestUnit: "second" } : { smallestUnit: "second"; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>smallestUnit : "second" +> : ^^^^^^^^ +>"second" : "second" +> : ^^^^^^^^ + + // => P8456DT12H5M29S + + // Months and years can be different lengths + const [jan1, feb1, mar1] = [1, 2, 3].map(month => Temporal.PlainDateTime.from({ year: 2020, month, day: 1 })); +>jan1 : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>feb1 : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>mar1 : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>[1, 2, 3].map(month => Temporal.PlainDateTime.from({ year: 2020, month, day: 1 })) : Temporal.PlainDateTime[] +> : ^^^^^^^^^^^^^^^^^^^^^^^^ +>[1, 2, 3].map : (callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any) => U[] +> : ^ ^^ ^^^ ^^^^^^^^^^ ^^ ^^ ^^^^^^^^^^^^^^^^^^ ^^^ ^^^^^^^^ +>[1, 2, 3] : number[] +> : ^^^^^^^^ +>1 : 1 +> : ^ +>2 : 2 +> : ^ +>3 : 3 +> : ^ +>map : (callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any) => U[] +> : ^ ^^ ^^^ ^^^^^^^^^^ ^^ ^^ ^^^^^^^^^^^^^^^^^^ ^^^ ^^^^^^^^ +>month => Temporal.PlainDateTime.from({ year: 2020, month, day: 1 }) : (month: number) => Temporal.PlainDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>month : number +> : ^^^^^^ +>Temporal.PlainDateTime.from({ year: 2020, month, day: 1 }) : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDateTime.from : (item: Temporal.PlainDateTimeLike, options?: Temporal.OverflowOptions) => Temporal.PlainDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDateTime : Temporal.PlainDateTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>PlainDateTime : Temporal.PlainDateTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.PlainDateTimeLike, options?: Temporal.OverflowOptions) => Temporal.PlainDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ year: 2020, month, day: 1 } : { year: number; month: number; day: number; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>year : number +> : ^^^^^^ +>2020 : 2020 +> : ^^^^ +>month : number +> : ^^^^^^ +>day : number +> : ^^^^^^ +>1 : 1 +> : ^ + + jan1.until(feb1); // => P31D +>jan1.until(feb1) : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>jan1.until : (other: Temporal.PlainDateTimeLike, options?: Temporal.RoundingOptionsWithLargestUnit) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^ +>jan1 : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>until : (other: Temporal.PlainDateTimeLike, options?: Temporal.RoundingOptionsWithLargestUnit) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^ +>feb1 : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ + + jan1.until(feb1, { largestUnit: "month" }); // => P1M +>jan1.until(feb1, { largestUnit: "month" }) : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>jan1.until : (other: Temporal.PlainDateTimeLike, options?: Temporal.RoundingOptionsWithLargestUnit) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^ +>jan1 : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>until : (other: Temporal.PlainDateTimeLike, options?: Temporal.RoundingOptionsWithLargestUnit) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^ +>feb1 : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>{ largestUnit: "month" } : { largestUnit: "month"; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^ +>largestUnit : "month" +> : ^^^^^^^ +>"month" : "month" +> : ^^^^^^^ + + feb1.until(mar1); // => P29D +>feb1.until(mar1) : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>feb1.until : (other: Temporal.PlainDateTimeLike, options?: Temporal.RoundingOptionsWithLargestUnit) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^ +>feb1 : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>until : (other: Temporal.PlainDateTimeLike, options?: Temporal.RoundingOptionsWithLargestUnit) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^ +>mar1 : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ + + feb1.until(mar1, { largestUnit: "month" }); // => P1M +>feb1.until(mar1, { largestUnit: "month" }) : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>feb1.until : (other: Temporal.PlainDateTimeLike, options?: Temporal.RoundingOptionsWithLargestUnit) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^ +>feb1 : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>until : (other: Temporal.PlainDateTimeLike, options?: Temporal.RoundingOptionsWithLargestUnit) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^ +>mar1 : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>{ largestUnit: "month" } : { largestUnit: "month"; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^ +>largestUnit : "month" +> : ^^^^^^^ +>"month" : "month" +> : ^^^^^^^ + + jan1.until(mar1); // => P60D +>jan1.until(mar1) : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>jan1.until : (other: Temporal.PlainDateTimeLike, options?: Temporal.RoundingOptionsWithLargestUnit) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^ +>jan1 : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>until : (other: Temporal.PlainDateTimeLike, options?: Temporal.RoundingOptionsWithLargestUnit) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^ +>mar1 : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +} + +{ + const dt1 = Temporal.PlainDateTime.from("1995-12-07T03:24:30.000003500"); +>dt1 : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDateTime.from("1995-12-07T03:24:30.000003500") : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDateTime.from : (item: Temporal.PlainDateTimeLike, options?: Temporal.OverflowOptions) => Temporal.PlainDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDateTime : Temporal.PlainDateTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>PlainDateTime : Temporal.PlainDateTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.PlainDateTimeLike, options?: Temporal.OverflowOptions) => Temporal.PlainDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"1995-12-07T03:24:30.000003500" : "1995-12-07T03:24:30.000003500" +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + const dt2 = Temporal.PlainDateTime.from("2019-01-31T15:30"); +>dt2 : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDateTime.from("2019-01-31T15:30") : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDateTime.from : (item: Temporal.PlainDateTimeLike, options?: Temporal.OverflowOptions) => Temporal.PlainDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDateTime : Temporal.PlainDateTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>PlainDateTime : Temporal.PlainDateTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.PlainDateTimeLike, options?: Temporal.OverflowOptions) => Temporal.PlainDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"2019-01-31T15:30" : "2019-01-31T15:30" +> : ^^^^^^^^^^^^^^^^^^ + + dt2.since(dt1); // => P8456DT12H5M29.9999965S +>dt2.since(dt1) : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>dt2.since : (other: Temporal.PlainDateTimeLike, options?: Temporal.RoundingOptionsWithLargestUnit) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^ +>dt2 : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>since : (other: Temporal.PlainDateTimeLike, options?: Temporal.RoundingOptionsWithLargestUnit) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^ +>dt1 : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +} + +{ + const dt = Temporal.PlainDateTime.from("1995-12-07T03:24:30.000003500"); +>dt : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDateTime.from("1995-12-07T03:24:30.000003500") : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDateTime.from : (item: Temporal.PlainDateTimeLike, options?: Temporal.OverflowOptions) => Temporal.PlainDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDateTime : Temporal.PlainDateTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>PlainDateTime : Temporal.PlainDateTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.PlainDateTimeLike, options?: Temporal.OverflowOptions) => Temporal.PlainDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"1995-12-07T03:24:30.000003500" : "1995-12-07T03:24:30.000003500" +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + // Round to a particular unit + dt.round({ smallestUnit: "hour" }); // => 1995-12-07T03:00:00 +>dt.round({ smallestUnit: "hour" }) : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>dt.round : { (roundTo: "day" | "days" | Temporal.TimeUnit): Temporal.PlainDateTime; (roundTo: Temporal.RoundingOptions<"day" | "days" | Temporal.TimeUnit>): Temporal.PlainDateTime; } +> : ^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>dt : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>round : { (roundTo: "day" | "days" | Temporal.TimeUnit): Temporal.PlainDateTime; (roundTo: Temporal.RoundingOptions<"day" | "days" | Temporal.TimeUnit>): Temporal.PlainDateTime; } +> : ^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ smallestUnit: "hour" } : { smallestUnit: "hour"; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^ +>smallestUnit : "hour" +> : ^^^^^^ +>"hour" : "hour" +> : ^^^^^^ + + // Round to an increment of a unit, e.g. half an hour: + dt.round({ roundingIncrement: 30, smallestUnit: "minute" }); +>dt.round({ roundingIncrement: 30, smallestUnit: "minute" }) : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>dt.round : { (roundTo: "day" | "days" | Temporal.TimeUnit): Temporal.PlainDateTime; (roundTo: Temporal.RoundingOptions<"day" | "days" | Temporal.TimeUnit>): Temporal.PlainDateTime; } +> : ^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>dt : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>round : { (roundTo: "day" | "days" | Temporal.TimeUnit): Temporal.PlainDateTime; (roundTo: Temporal.RoundingOptions<"day" | "days" | Temporal.TimeUnit>): Temporal.PlainDateTime; } +> : ^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ roundingIncrement: 30, smallestUnit: "minute" } : { roundingIncrement: number; smallestUnit: "minute"; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>roundingIncrement : number +> : ^^^^^^ +>30 : 30 +> : ^^ +>smallestUnit : "minute" +> : ^^^^^^^^ +>"minute" : "minute" +> : ^^^^^^^^ + + // => 1995-12-07T03:30:00 + // Round to the same increment but round down instead: + dt.round({ roundingIncrement: 30, smallestUnit: "minute", roundingMode: "floor" }); +>dt.round({ roundingIncrement: 30, smallestUnit: "minute", roundingMode: "floor" }) : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>dt.round : { (roundTo: "day" | "days" | Temporal.TimeUnit): Temporal.PlainDateTime; (roundTo: Temporal.RoundingOptions<"day" | "days" | Temporal.TimeUnit>): Temporal.PlainDateTime; } +> : ^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>dt : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>round : { (roundTo: "day" | "days" | Temporal.TimeUnit): Temporal.PlainDateTime; (roundTo: Temporal.RoundingOptions<"day" | "days" | Temporal.TimeUnit>): Temporal.PlainDateTime; } +> : ^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ roundingIncrement: 30, smallestUnit: "minute", roundingMode: "floor" } : { roundingIncrement: number; smallestUnit: "minute"; roundingMode: "floor"; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>roundingIncrement : number +> : ^^^^^^ +>30 : 30 +> : ^^ +>smallestUnit : "minute" +> : ^^^^^^^^ +>"minute" : "minute" +> : ^^^^^^^^ +>roundingMode : "floor" +> : ^^^^^^^ +>"floor" : "floor" +> : ^^^^^^^ + + // => 1995-12-07T03:00:00 +} + +{ + const dt1 = Temporal.PlainDateTime.from("1995-12-07T03:24:30.000003500"); +>dt1 : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDateTime.from("1995-12-07T03:24:30.000003500") : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDateTime.from : (item: Temporal.PlainDateTimeLike, options?: Temporal.OverflowOptions) => Temporal.PlainDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDateTime : Temporal.PlainDateTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>PlainDateTime : Temporal.PlainDateTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.PlainDateTimeLike, options?: Temporal.OverflowOptions) => Temporal.PlainDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"1995-12-07T03:24:30.000003500" : "1995-12-07T03:24:30.000003500" +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + const dt2 = Temporal.PlainDateTime.from("2019-01-31T15:30"); +>dt2 : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDateTime.from("2019-01-31T15:30") : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDateTime.from : (item: Temporal.PlainDateTimeLike, options?: Temporal.OverflowOptions) => Temporal.PlainDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDateTime : Temporal.PlainDateTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>PlainDateTime : Temporal.PlainDateTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.PlainDateTimeLike, options?: Temporal.OverflowOptions) => Temporal.PlainDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"2019-01-31T15:30" : "2019-01-31T15:30" +> : ^^^^^^^^^^^^^^^^^^ + + dt1.equals(dt2); // => false +>dt1.equals(dt2) : boolean +> : ^^^^^^^ +>dt1.equals : (other: Temporal.PlainDateTimeLike) => boolean +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>dt1 : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>equals : (other: Temporal.PlainDateTimeLike) => boolean +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>dt2 : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ + + dt1.equals(dt1); // => true +>dt1.equals(dt1) : boolean +> : ^^^^^^^ +>dt1.equals : (other: Temporal.PlainDateTimeLike) => boolean +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>dt1 : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>equals : (other: Temporal.PlainDateTimeLike) => boolean +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>dt1 : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +} + +{ + const dt = Temporal.PlainDateTime.from({ +>dt : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDateTime.from({ year: 1999, month: 12, day: 31, hour: 23, minute: 59, second: 59, millisecond: 999, microsecond: 999, nanosecond: 999, }) : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDateTime.from : (item: Temporal.PlainDateTimeLike, options?: Temporal.OverflowOptions) => Temporal.PlainDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDateTime : Temporal.PlainDateTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>PlainDateTime : Temporal.PlainDateTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.PlainDateTimeLike, options?: Temporal.OverflowOptions) => Temporal.PlainDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ year: 1999, month: 12, day: 31, hour: 23, minute: 59, second: 59, millisecond: 999, microsecond: 999, nanosecond: 999, } : { year: number; month: number; day: number; hour: number; minute: number; second: number; millisecond: number; microsecond: number; nanosecond: number; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + year: 1999, +>year : number +> : ^^^^^^ +>1999 : 1999 +> : ^^^^ + + month: 12, +>month : number +> : ^^^^^^ +>12 : 12 +> : ^^ + + day: 31, +>day : number +> : ^^^^^^ +>31 : 31 +> : ^^ + + hour: 23, +>hour : number +> : ^^^^^^ +>23 : 23 +> : ^^ + + minute: 59, +>minute : number +> : ^^^^^^ +>59 : 59 +> : ^^ + + second: 59, +>second : number +> : ^^^^^^ +>59 : 59 +> : ^^ + + millisecond: 999, +>millisecond : number +> : ^^^^^^ +>999 : 999 +> : ^^^ + + microsecond: 999, +>microsecond : number +> : ^^^^^^ +>999 : 999 +> : ^^^ + + nanosecond: 999, +>nanosecond : number +> : ^^^^^^ +>999 : 999 +> : ^^^ + + }); + dt.toString(); // => '1999-12-31T23:59:59.999999999' +>dt.toString() : string +> : ^^^^^^ +>dt.toString : (options?: Temporal.PlainDateTimeToStringOptions) => string +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>dt : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>toString : (options?: Temporal.PlainDateTimeToStringOptions) => string +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + dt.toString({ smallestUnit: "minute" }); // => '1999-12-31T23:59' +>dt.toString({ smallestUnit: "minute" }) : string +> : ^^^^^^ +>dt.toString : (options?: Temporal.PlainDateTimeToStringOptions) => string +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>dt : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>toString : (options?: Temporal.PlainDateTimeToStringOptions) => string +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ smallestUnit: "minute" } : { smallestUnit: "minute"; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>smallestUnit : "minute" +> : ^^^^^^^^ +>"minute" : "minute" +> : ^^^^^^^^ + + dt.toString({ fractionalSecondDigits: 0 }); // => '1999-12-31T23:59:59' +>dt.toString({ fractionalSecondDigits: 0 }) : string +> : ^^^^^^ +>dt.toString : (options?: Temporal.PlainDateTimeToStringOptions) => string +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>dt : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>toString : (options?: Temporal.PlainDateTimeToStringOptions) => string +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ fractionalSecondDigits: 0 } : { fractionalSecondDigits: 0; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>fractionalSecondDigits : 0 +> : ^ +>0 : 0 +> : ^ + + dt.toString({ fractionalSecondDigits: 4 }); // => '1999-12-31T23:59:59.9999' +>dt.toString({ fractionalSecondDigits: 4 }) : string +> : ^^^^^^ +>dt.toString : (options?: Temporal.PlainDateTimeToStringOptions) => string +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>dt : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>toString : (options?: Temporal.PlainDateTimeToStringOptions) => string +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ fractionalSecondDigits: 4 } : { fractionalSecondDigits: 4; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>fractionalSecondDigits : 4 +> : ^ +>4 : 4 +> : ^ + + dt.toString({ fractionalSecondDigits: 8, roundingMode: "halfExpand" }); +>dt.toString({ fractionalSecondDigits: 8, roundingMode: "halfExpand" }) : string +> : ^^^^^^ +>dt.toString : (options?: Temporal.PlainDateTimeToStringOptions) => string +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>dt : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>toString : (options?: Temporal.PlainDateTimeToStringOptions) => string +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ fractionalSecondDigits: 8, roundingMode: "halfExpand" } : { fractionalSecondDigits: 8; roundingMode: "halfExpand"; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>fractionalSecondDigits : 8 +> : ^ +>8 : 8 +> : ^ +>roundingMode : "halfExpand" +> : ^^^^^^^^^^^^ +>"halfExpand" : "halfExpand" +> : ^^^^^^^^^^^^ + + // => '2000-01-01T00:00:00.00000000' +} + +{ + const dt = Temporal.PlainDateTime.from("1995-12-07T03:24:30.000003500"); +>dt : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDateTime.from("1995-12-07T03:24:30.000003500") : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDateTime.from : (item: Temporal.PlainDateTimeLike, options?: Temporal.OverflowOptions) => Temporal.PlainDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDateTime : Temporal.PlainDateTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>PlainDateTime : Temporal.PlainDateTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.PlainDateTimeLike, options?: Temporal.OverflowOptions) => Temporal.PlainDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"1995-12-07T03:24:30.000003500" : "1995-12-07T03:24:30.000003500" +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + dt.toLocaleString(); // example output: 1995-12-07, 3:24:30 a.m. +>dt.toLocaleString() : string +> : ^^^^^^ +>dt.toLocaleString : (locales?: Intl.LocalesArgument, options?: Intl.DateTimeFormatOptions) => string +> : ^ ^^^ ^^ ^^^ ^^^^^ +>dt : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>toLocaleString : (locales?: Intl.LocalesArgument, options?: Intl.DateTimeFormatOptions) => string +> : ^ ^^^ ^^ ^^^ ^^^^^ + + dt.toLocaleString("de-DE"); // example output: 7.12.1995, 03:24:30 +>dt.toLocaleString("de-DE") : string +> : ^^^^^^ +>dt.toLocaleString : (locales?: Intl.LocalesArgument, options?: Intl.DateTimeFormatOptions) => string +> : ^ ^^^ ^^ ^^^ ^^^^^ +>dt : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>toLocaleString : (locales?: Intl.LocalesArgument, options?: Intl.DateTimeFormatOptions) => string +> : ^ ^^^ ^^ ^^^ ^^^^^ +>"de-DE" : "de-DE" +> : ^^^^^^^ + + dt.toLocaleString("de-DE", { timeZone: "Europe/Berlin", weekday: "long" }); // => 'Donnerstag' +>dt.toLocaleString("de-DE", { timeZone: "Europe/Berlin", weekday: "long" }) : string +> : ^^^^^^ +>dt.toLocaleString : (locales?: Intl.LocalesArgument, options?: Intl.DateTimeFormatOptions) => string +> : ^ ^^^ ^^ ^^^ ^^^^^ +>dt : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>toLocaleString : (locales?: Intl.LocalesArgument, options?: Intl.DateTimeFormatOptions) => string +> : ^ ^^^ ^^ ^^^ ^^^^^ +>"de-DE" : "de-DE" +> : ^^^^^^^ +>{ timeZone: "Europe/Berlin", weekday: "long" } : { timeZone: string; weekday: "long"; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>timeZone : string +> : ^^^^^^ +>"Europe/Berlin" : "Europe/Berlin" +> : ^^^^^^^^^^^^^^^ +>weekday : "long" +> : ^^^^^^ +>"long" : "long" +> : ^^^^^^ + + dt.toLocaleString("en-US-u-nu-fullwide-hc-h12"); // => '12/7/1995, 3:24:30 AM' +>dt.toLocaleString("en-US-u-nu-fullwide-hc-h12") : string +> : ^^^^^^ +>dt.toLocaleString : (locales?: Intl.LocalesArgument, options?: Intl.DateTimeFormatOptions) => string +> : ^ ^^^ ^^ ^^^ ^^^^^ +>dt : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>toLocaleString : (locales?: Intl.LocalesArgument, options?: Intl.DateTimeFormatOptions) => string +> : ^ ^^^ ^^ ^^^ ^^^^^ +>"en-US-u-nu-fullwide-hc-h12" : "en-US-u-nu-fullwide-hc-h12" +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +} + +{ + const dt = Temporal.PlainDateTime.from("1995-12-07T03:24:30.000003500"); +>dt : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDateTime.from("1995-12-07T03:24:30.000003500") : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDateTime.from : (item: Temporal.PlainDateTimeLike, options?: Temporal.OverflowOptions) => Temporal.PlainDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDateTime : Temporal.PlainDateTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>PlainDateTime : Temporal.PlainDateTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.PlainDateTimeLike, options?: Temporal.OverflowOptions) => Temporal.PlainDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"1995-12-07T03:24:30.000003500" : "1995-12-07T03:24:30.000003500" +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + dt.toPlainDate(); // => 1995-12-07 +>dt.toPlainDate() : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>dt.toPlainDate : () => Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^^^^^^^ +>dt : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>toPlainDate : () => Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^^^^^^^ + + dt.toPlainTime(); // => 03:24:30.0000035 +>dt.toPlainTime() : Temporal.PlainTime +> : ^^^^^^^^^^^^^^^^^^ +>dt.toPlainTime : () => Temporal.PlainTime +> : ^^^^^^^^^^^^^^^^^^^^^^^^ +>dt : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>toPlainTime : () => Temporal.PlainTime +> : ^^^^^^^^^^^^^^^^^^^^^^^^ + + dt.toPlainDate().toPlainYearMonth(); // => 1995-12 +>dt.toPlainDate().toPlainYearMonth() : Temporal.PlainYearMonth +> : ^^^^^^^^^^^^^^^^^^^^^^^ +>dt.toPlainDate().toPlainYearMonth : () => Temporal.PlainYearMonth +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>dt.toPlainDate() : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>dt.toPlainDate : () => Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^^^^^^^ +>dt : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>toPlainDate : () => Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^^^^^^^ +>toPlainYearMonth : () => Temporal.PlainYearMonth +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + dt.toPlainDate().toPlainMonthDay(); // => 12-07 +>dt.toPlainDate().toPlainMonthDay() : Temporal.PlainMonthDay +> : ^^^^^^^^^^^^^^^^^^^^^^ +>dt.toPlainDate().toPlainMonthDay : () => Temporal.PlainMonthDay +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>dt.toPlainDate() : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>dt.toPlainDate : () => Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^^^^^^^ +>dt : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>toPlainDate : () => Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^^^^^^^ +>toPlainMonthDay : () => Temporal.PlainMonthDay +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +} + +{ + // The June 2019 meeting + const ym = new Temporal.PlainYearMonth(2019, 6); +>ym : Temporal.PlainYearMonth +> : ^^^^^^^^^^^^^^^^^^^^^^^ +>new Temporal.PlainYearMonth(2019, 6) : Temporal.PlainYearMonth +> : ^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainYearMonth : Temporal.PlainYearMonthConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>PlainYearMonth : Temporal.PlainYearMonthConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>2019 : 2019 +> : ^^^^ +>6 : 6 +> : ^ + + // => 2019-06 +} + +{ + let ym: Temporal.PlainYearMonth; +>ym : Temporal.PlainYearMonth +> : ^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : any +> : ^^^ + + ym = Temporal.PlainYearMonth.from("2019-06"); // => 2019-06 +>ym = Temporal.PlainYearMonth.from("2019-06") : Temporal.PlainYearMonth +> : ^^^^^^^^^^^^^^^^^^^^^^^ +>ym : Temporal.PlainYearMonth +> : ^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainYearMonth.from("2019-06") : Temporal.PlainYearMonth +> : ^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainYearMonth.from : (item: Temporal.PlainYearMonthLike, options?: Temporal.OverflowOptions) => Temporal.PlainYearMonth +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainYearMonth : Temporal.PlainYearMonthConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>PlainYearMonth : Temporal.PlainYearMonthConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.PlainYearMonthLike, options?: Temporal.OverflowOptions) => Temporal.PlainYearMonth +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"2019-06" : "2019-06" +> : ^^^^^^^^^ + + ym = Temporal.PlainYearMonth.from("2019-06-24"); // => 2019-06 +>ym = Temporal.PlainYearMonth.from("2019-06-24") : Temporal.PlainYearMonth +> : ^^^^^^^^^^^^^^^^^^^^^^^ +>ym : Temporal.PlainYearMonth +> : ^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainYearMonth.from("2019-06-24") : Temporal.PlainYearMonth +> : ^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainYearMonth.from : (item: Temporal.PlainYearMonthLike, options?: Temporal.OverflowOptions) => Temporal.PlainYearMonth +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainYearMonth : Temporal.PlainYearMonthConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>PlainYearMonth : Temporal.PlainYearMonthConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.PlainYearMonthLike, options?: Temporal.OverflowOptions) => Temporal.PlainYearMonth +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"2019-06-24" : "2019-06-24" +> : ^^^^^^^^^^^^ + + ym = Temporal.PlainYearMonth.from("2019-06-24T15:43:27"); // => 2019-06 +>ym = Temporal.PlainYearMonth.from("2019-06-24T15:43:27") : Temporal.PlainYearMonth +> : ^^^^^^^^^^^^^^^^^^^^^^^ +>ym : Temporal.PlainYearMonth +> : ^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainYearMonth.from("2019-06-24T15:43:27") : Temporal.PlainYearMonth +> : ^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainYearMonth.from : (item: Temporal.PlainYearMonthLike, options?: Temporal.OverflowOptions) => Temporal.PlainYearMonth +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainYearMonth : Temporal.PlainYearMonthConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>PlainYearMonth : Temporal.PlainYearMonthConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.PlainYearMonthLike, options?: Temporal.OverflowOptions) => Temporal.PlainYearMonth +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"2019-06-24T15:43:27" : "2019-06-24T15:43:27" +> : ^^^^^^^^^^^^^^^^^^^^^ + + ym = Temporal.PlainYearMonth.from("2019-06-24T15:43:27+01:00[Europe/Brussels]"); +>ym = Temporal.PlainYearMonth.from("2019-06-24T15:43:27+01:00[Europe/Brussels]") : Temporal.PlainYearMonth +> : ^^^^^^^^^^^^^^^^^^^^^^^ +>ym : Temporal.PlainYearMonth +> : ^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainYearMonth.from("2019-06-24T15:43:27+01:00[Europe/Brussels]") : Temporal.PlainYearMonth +> : ^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainYearMonth.from : (item: Temporal.PlainYearMonthLike, options?: Temporal.OverflowOptions) => Temporal.PlainYearMonth +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainYearMonth : Temporal.PlainYearMonthConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>PlainYearMonth : Temporal.PlainYearMonthConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.PlainYearMonthLike, options?: Temporal.OverflowOptions) => Temporal.PlainYearMonth +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"2019-06-24T15:43:27+01:00[Europe/Brussels]" : "2019-06-24T15:43:27+01:00[Europe/Brussels]" +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + // => 2019-06 + ym === Temporal.PlainYearMonth.from(ym); // => false +>ym === Temporal.PlainYearMonth.from(ym) : boolean +> : ^^^^^^^ +>ym : Temporal.PlainYearMonth +> : ^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainYearMonth.from(ym) : Temporal.PlainYearMonth +> : ^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainYearMonth.from : (item: Temporal.PlainYearMonthLike, options?: Temporal.OverflowOptions) => Temporal.PlainYearMonth +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainYearMonth : Temporal.PlainYearMonthConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>PlainYearMonth : Temporal.PlainYearMonthConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.PlainYearMonthLike, options?: Temporal.OverflowOptions) => Temporal.PlainYearMonth +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>ym : Temporal.PlainYearMonth +> : ^^^^^^^^^^^^^^^^^^^^^^^ + + ym = Temporal.PlainYearMonth.from({ year: 2019, month: 6 }); // => 2019-06 +>ym = Temporal.PlainYearMonth.from({ year: 2019, month: 6 }) : Temporal.PlainYearMonth +> : ^^^^^^^^^^^^^^^^^^^^^^^ +>ym : Temporal.PlainYearMonth +> : ^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainYearMonth.from({ year: 2019, month: 6 }) : Temporal.PlainYearMonth +> : ^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainYearMonth.from : (item: Temporal.PlainYearMonthLike, options?: Temporal.OverflowOptions) => Temporal.PlainYearMonth +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainYearMonth : Temporal.PlainYearMonthConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>PlainYearMonth : Temporal.PlainYearMonthConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.PlainYearMonthLike, options?: Temporal.OverflowOptions) => Temporal.PlainYearMonth +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ year: 2019, month: 6 } : { year: number; month: number; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>year : number +> : ^^^^^^ +>2019 : 2019 +> : ^^^^ +>month : number +> : ^^^^^^ +>6 : 6 +> : ^ + + ym = Temporal.PlainYearMonth.from(Temporal.PlainDate.from("2019-06-24")); +>ym = Temporal.PlainYearMonth.from(Temporal.PlainDate.from("2019-06-24")) : Temporal.PlainYearMonth +> : ^^^^^^^^^^^^^^^^^^^^^^^ +>ym : Temporal.PlainYearMonth +> : ^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainYearMonth.from(Temporal.PlainDate.from("2019-06-24")) : Temporal.PlainYearMonth +> : ^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainYearMonth.from : (item: Temporal.PlainYearMonthLike, options?: Temporal.OverflowOptions) => Temporal.PlainYearMonth +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainYearMonth : Temporal.PlainYearMonthConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>PlainYearMonth : Temporal.PlainYearMonthConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.PlainYearMonthLike, options?: Temporal.OverflowOptions) => Temporal.PlainYearMonth +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDate.from("2019-06-24") : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDate.from : (item: Temporal.PlainDateLike, options?: Temporal.OverflowOptions) => Temporal.PlainDate +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDate : Temporal.PlainDateConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>PlainDate : Temporal.PlainDateConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.PlainDateLike, options?: Temporal.OverflowOptions) => Temporal.PlainDate +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"2019-06-24" : "2019-06-24" +> : ^^^^^^^^^^^^ + + // => 2019-06 + // (same as above; Temporal.PlainDate has year and month properties) + + // Different overflow modes + ym = Temporal.PlainYearMonth.from({ year: 2001, month: 13 }, { overflow: "constrain" }); +>ym = Temporal.PlainYearMonth.from({ year: 2001, month: 13 }, { overflow: "constrain" }) : Temporal.PlainYearMonth +> : ^^^^^^^^^^^^^^^^^^^^^^^ +>ym : Temporal.PlainYearMonth +> : ^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainYearMonth.from({ year: 2001, month: 13 }, { overflow: "constrain" }) : Temporal.PlainYearMonth +> : ^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainYearMonth.from : (item: Temporal.PlainYearMonthLike, options?: Temporal.OverflowOptions) => Temporal.PlainYearMonth +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainYearMonth : Temporal.PlainYearMonthConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>PlainYearMonth : Temporal.PlainYearMonthConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.PlainYearMonthLike, options?: Temporal.OverflowOptions) => Temporal.PlainYearMonth +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ year: 2001, month: 13 } : { year: number; month: number; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>year : number +> : ^^^^^^ +>2001 : 2001 +> : ^^^^ +>month : number +> : ^^^^^^ +>13 : 13 +> : ^^ +>{ overflow: "constrain" } : { overflow: "constrain"; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^ +>overflow : "constrain" +> : ^^^^^^^^^^^ +>"constrain" : "constrain" +> : ^^^^^^^^^^^ + + // => 2001-12 + ym = Temporal.PlainYearMonth.from({ year: 2001, month: 13 }, { overflow: "reject" }); +>ym = Temporal.PlainYearMonth.from({ year: 2001, month: 13 }, { overflow: "reject" }) : Temporal.PlainYearMonth +> : ^^^^^^^^^^^^^^^^^^^^^^^ +>ym : Temporal.PlainYearMonth +> : ^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainYearMonth.from({ year: 2001, month: 13 }, { overflow: "reject" }) : Temporal.PlainYearMonth +> : ^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainYearMonth.from : (item: Temporal.PlainYearMonthLike, options?: Temporal.OverflowOptions) => Temporal.PlainYearMonth +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainYearMonth : Temporal.PlainYearMonthConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>PlainYearMonth : Temporal.PlainYearMonthConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.PlainYearMonthLike, options?: Temporal.OverflowOptions) => Temporal.PlainYearMonth +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ year: 2001, month: 13 } : { year: number; month: number; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>year : number +> : ^^^^^^ +>2001 : 2001 +> : ^^^^ +>month : number +> : ^^^^^^ +>13 : 13 +> : ^^ +>{ overflow: "reject" } : { overflow: "reject"; } +> : ^^^^^^^^^^^^^^^^^^^^^^^ +>overflow : "reject" +> : ^^^^^^^^ +>"reject" : "reject" +> : ^^^^^^^^ + + // => throws +} + +{ + const one = Temporal.PlainYearMonth.from("2006-08"); +>one : Temporal.PlainYearMonth +> : ^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainYearMonth.from("2006-08") : Temporal.PlainYearMonth +> : ^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainYearMonth.from : (item: Temporal.PlainYearMonthLike, options?: Temporal.OverflowOptions) => Temporal.PlainYearMonth +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainYearMonth : Temporal.PlainYearMonthConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>PlainYearMonth : Temporal.PlainYearMonthConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.PlainYearMonthLike, options?: Temporal.OverflowOptions) => Temporal.PlainYearMonth +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"2006-08" : "2006-08" +> : ^^^^^^^^^ + + const two = Temporal.PlainYearMonth.from("2015-07"); +>two : Temporal.PlainYearMonth +> : ^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainYearMonth.from("2015-07") : Temporal.PlainYearMonth +> : ^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainYearMonth.from : (item: Temporal.PlainYearMonthLike, options?: Temporal.OverflowOptions) => Temporal.PlainYearMonth +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainYearMonth : Temporal.PlainYearMonthConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>PlainYearMonth : Temporal.PlainYearMonthConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.PlainYearMonthLike, options?: Temporal.OverflowOptions) => Temporal.PlainYearMonth +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"2015-07" : "2015-07" +> : ^^^^^^^^^ + + const three = Temporal.PlainYearMonth.from("1930-02"); +>three : Temporal.PlainYearMonth +> : ^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainYearMonth.from("1930-02") : Temporal.PlainYearMonth +> : ^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainYearMonth.from : (item: Temporal.PlainYearMonthLike, options?: Temporal.OverflowOptions) => Temporal.PlainYearMonth +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainYearMonth : Temporal.PlainYearMonthConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>PlainYearMonth : Temporal.PlainYearMonthConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.PlainYearMonthLike, options?: Temporal.OverflowOptions) => Temporal.PlainYearMonth +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"1930-02" : "1930-02" +> : ^^^^^^^^^ + + const sorted = [one, two, three].sort(Temporal.PlainYearMonth.compare); +>sorted : Temporal.PlainYearMonth[] +> : ^^^^^^^^^^^^^^^^^^^^^^^^^ +>[one, two, three].sort(Temporal.PlainYearMonth.compare) : Temporal.PlainYearMonth[] +> : ^^^^^^^^^^^^^^^^^^^^^^^^^ +>[one, two, three].sort : (compareFn?: ((a: Temporal.PlainYearMonth, b: Temporal.PlainYearMonth) => number) | undefined) => Temporal.PlainYearMonth[] +> : ^ ^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>[one, two, three] : Temporal.PlainYearMonth[] +> : ^^^^^^^^^^^^^^^^^^^^^^^^^ +>one : Temporal.PlainYearMonth +> : ^^^^^^^^^^^^^^^^^^^^^^^ +>two : Temporal.PlainYearMonth +> : ^^^^^^^^^^^^^^^^^^^^^^^ +>three : Temporal.PlainYearMonth +> : ^^^^^^^^^^^^^^^^^^^^^^^ +>sort : (compareFn?: ((a: Temporal.PlainYearMonth, b: Temporal.PlainYearMonth) => number) | undefined) => Temporal.PlainYearMonth[] +> : ^ ^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainYearMonth.compare : (one: Temporal.PlainYearMonthLike, two: Temporal.PlainYearMonthLike) => number +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainYearMonth : Temporal.PlainYearMonthConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>PlainYearMonth : Temporal.PlainYearMonthConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>compare : (one: Temporal.PlainYearMonthLike, two: Temporal.PlainYearMonthLike) => number +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + sorted.join(" "); // => '1930-02 2006-08 2015-07' +>sorted.join(" ") : string +> : ^^^^^^ +>sorted.join : (separator?: string) => string +> : ^ ^^^ ^^^^^ +>sorted : Temporal.PlainYearMonth[] +> : ^^^^^^^^^^^^^^^^^^^^^^^^^ +>join : (separator?: string) => string +> : ^ ^^^ ^^^^^ +>" " : " " +> : ^^^ +} + +{ + let ym: Temporal.PlainYearMonth; +>ym : Temporal.PlainYearMonth +> : ^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : any +> : ^^^ + + ym = Temporal.PlainYearMonth.from("2019-06"); +>ym = Temporal.PlainYearMonth.from("2019-06") : Temporal.PlainYearMonth +> : ^^^^^^^^^^^^^^^^^^^^^^^ +>ym : Temporal.PlainYearMonth +> : ^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainYearMonth.from("2019-06") : Temporal.PlainYearMonth +> : ^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainYearMonth.from : (item: Temporal.PlainYearMonthLike, options?: Temporal.OverflowOptions) => Temporal.PlainYearMonth +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainYearMonth : Temporal.PlainYearMonthConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>PlainYearMonth : Temporal.PlainYearMonthConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.PlainYearMonthLike, options?: Temporal.OverflowOptions) => Temporal.PlainYearMonth +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"2019-06" : "2019-06" +> : ^^^^^^^^^ + + ym.year; // => 2019 +>ym.year : number +> : ^^^^^^ +>ym : Temporal.PlainYearMonth +> : ^^^^^^^^^^^^^^^^^^^^^^^ +>year : number +> : ^^^^^^ + + ym.month; // => 6 +>ym.month : number +> : ^^^^^^ +>ym : Temporal.PlainYearMonth +> : ^^^^^^^^^^^^^^^^^^^^^^^ +>month : number +> : ^^^^^^ + + ym.monthCode; // => 'M06' +>ym.monthCode : string +> : ^^^^^^ +>ym : Temporal.PlainYearMonth +> : ^^^^^^^^^^^^^^^^^^^^^^^ +>monthCode : string +> : ^^^^^^ + + ym = Temporal.PlainYearMonth.from("2019-02-23[u-ca=hebrew]"); +>ym = Temporal.PlainYearMonth.from("2019-02-23[u-ca=hebrew]") : Temporal.PlainYearMonth +> : ^^^^^^^^^^^^^^^^^^^^^^^ +>ym : Temporal.PlainYearMonth +> : ^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainYearMonth.from("2019-02-23[u-ca=hebrew]") : Temporal.PlainYearMonth +> : ^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainYearMonth.from : (item: Temporal.PlainYearMonthLike, options?: Temporal.OverflowOptions) => Temporal.PlainYearMonth +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainYearMonth : Temporal.PlainYearMonthConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>PlainYearMonth : Temporal.PlainYearMonthConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.PlainYearMonthLike, options?: Temporal.OverflowOptions) => Temporal.PlainYearMonth +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"2019-02-23[u-ca=hebrew]" : "2019-02-23[u-ca=hebrew]" +> : ^^^^^^^^^^^^^^^^^^^^^^^^^ + + ym.year; // => 5779 +>ym.year : number +> : ^^^^^^ +>ym : Temporal.PlainYearMonth +> : ^^^^^^^^^^^^^^^^^^^^^^^ +>year : number +> : ^^^^^^ + + ym.month; // => 6 +>ym.month : number +> : ^^^^^^ +>ym : Temporal.PlainYearMonth +> : ^^^^^^^^^^^^^^^^^^^^^^^ +>month : number +> : ^^^^^^ + + ym.monthCode; // => 'M05L' +>ym.monthCode : string +> : ^^^^^^ +>ym : Temporal.PlainYearMonth +> : ^^^^^^^^^^^^^^^^^^^^^^^ +>monthCode : string +> : ^^^^^^ +} + +{ + const ym = Temporal.PlainYearMonth.from("-000015-01-01[u-ca=gregory]"); +>ym : Temporal.PlainYearMonth +> : ^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainYearMonth.from("-000015-01-01[u-ca=gregory]") : Temporal.PlainYearMonth +> : ^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainYearMonth.from : (item: Temporal.PlainYearMonthLike, options?: Temporal.OverflowOptions) => Temporal.PlainYearMonth +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainYearMonth : Temporal.PlainYearMonthConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>PlainYearMonth : Temporal.PlainYearMonthConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.PlainYearMonthLike, options?: Temporal.OverflowOptions) => Temporal.PlainYearMonth +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"-000015-01-01[u-ca=gregory]" : "-000015-01-01[u-ca=gregory]" +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + ym.era; +>ym.era : string | undefined +> : ^^^^^^^^^^^^^^^^^^ +>ym : Temporal.PlainYearMonth +> : ^^^^^^^^^^^^^^^^^^^^^^^ +>era : string | undefined +> : ^^^^^^^^^^^^^^^^^^ + + // => 'bce' + ym.eraYear; +>ym.eraYear : number | undefined +> : ^^^^^^^^^^^^^^^^^^ +>ym : Temporal.PlainYearMonth +> : ^^^^^^^^^^^^^^^^^^^^^^^ +>eraYear : number | undefined +> : ^^^^^^^^^^^^^^^^^^ + + // => 16 + ym.year; +>ym.year : number +> : ^^^^^^ +>ym : Temporal.PlainYearMonth +> : ^^^^^^^^^^^^^^^^^^^^^^^ +>year : number +> : ^^^^^^ + + // => -15 +} + +{ + // Attempt to write some mnemonic poetry + const monthsByDays: Record = {}; +>monthsByDays : Record +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : any +> : ^^^ +>{} : {} +> : ^^ + + for (let month = 1; month <= 12; month++) { +>month : number +> : ^^^^^^ +>1 : 1 +> : ^ +>month <= 12 : boolean +> : ^^^^^^^ +>month : number +> : ^^^^^^ +>12 : 12 +> : ^^ +>month++ : number +> : ^^^^^^ +>month : number +> : ^^^^^^ + + const ym = Temporal.PlainYearMonth.from({ year: 2020, calendar: "iso8601", month }); +>ym : Temporal.PlainYearMonth +> : ^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainYearMonth.from({ year: 2020, calendar: "iso8601", month }) : Temporal.PlainYearMonth +> : ^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainYearMonth.from : (item: Temporal.PlainYearMonthLike, options?: Temporal.OverflowOptions) => Temporal.PlainYearMonth +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainYearMonth : Temporal.PlainYearMonthConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>PlainYearMonth : Temporal.PlainYearMonthConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.PlainYearMonthLike, options?: Temporal.OverflowOptions) => Temporal.PlainYearMonth +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ year: 2020, calendar: "iso8601", month } : { year: number; calendar: string; month: number; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>year : number +> : ^^^^^^ +>2020 : 2020 +> : ^^^^ +>calendar : string +> : ^^^^^^ +>"iso8601" : "iso8601" +> : ^^^^^^^^^ +>month : number +> : ^^^^^^ + + monthsByDays[ym.daysInMonth] = (monthsByDays[ym.daysInMonth] || []).concat(ym); +>monthsByDays[ym.daysInMonth] = (monthsByDays[ym.daysInMonth] || []).concat(ym) : Temporal.PlainYearMonth[] +> : ^^^^^^^^^^^^^^^^^^^^^^^^^ +>monthsByDays[ym.daysInMonth] : Temporal.PlainYearMonth[] +> : ^^^^^^^^^^^^^^^^^^^^^^^^^ +>monthsByDays : Record +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>ym.daysInMonth : number +> : ^^^^^^ +>ym : Temporal.PlainYearMonth +> : ^^^^^^^^^^^^^^^^^^^^^^^ +>daysInMonth : number +> : ^^^^^^ +>(monthsByDays[ym.daysInMonth] || []).concat(ym) : Temporal.PlainYearMonth[] +> : ^^^^^^^^^^^^^^^^^^^^^^^^^ +>(monthsByDays[ym.daysInMonth] || []).concat : { (...items: ConcatArray[]): Temporal.PlainYearMonth[]; (...items: (Temporal.PlainYearMonth | ConcatArray)[]): Temporal.PlainYearMonth[]; } +> : ^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>(monthsByDays[ym.daysInMonth] || []) : Temporal.PlainYearMonth[] +> : ^^^^^^^^^^^^^^^^^^^^^^^^^ +>monthsByDays[ym.daysInMonth] || [] : Temporal.PlainYearMonth[] +> : ^^^^^^^^^^^^^^^^^^^^^^^^^ +>monthsByDays[ym.daysInMonth] : Temporal.PlainYearMonth[] +> : ^^^^^^^^^^^^^^^^^^^^^^^^^ +>monthsByDays : Record +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>ym.daysInMonth : number +> : ^^^^^^ +>ym : Temporal.PlainYearMonth +> : ^^^^^^^^^^^^^^^^^^^^^^^ +>daysInMonth : number +> : ^^^^^^ +>[] : never[] +> : ^^^^^^^ +>concat : { (...items: ConcatArray[]): Temporal.PlainYearMonth[]; (...items: (Temporal.PlainYearMonth | ConcatArray)[]): Temporal.PlainYearMonth[]; } +> : ^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>ym : Temporal.PlainYearMonth +> : ^^^^^^^^^^^^^^^^^^^^^^^ + } + + const strings = monthsByDays[30].map(ym => ym.toLocaleString("en", { month: "long", calendar: "iso8601" })); +>strings : string[] +> : ^^^^^^^^ +>monthsByDays[30].map(ym => ym.toLocaleString("en", { month: "long", calendar: "iso8601" })) : string[] +> : ^^^^^^^^ +>monthsByDays[30].map : (callbackfn: (value: Temporal.PlainYearMonth, index: number, array: Temporal.PlainYearMonth[]) => U, thisArg?: any) => U[] +> : ^ ^^ ^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^ ^^^^^^^^ +>monthsByDays[30] : Temporal.PlainYearMonth[] +> : ^^^^^^^^^^^^^^^^^^^^^^^^^ +>monthsByDays : Record +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>30 : 30 +> : ^^ +>map : (callbackfn: (value: Temporal.PlainYearMonth, index: number, array: Temporal.PlainYearMonth[]) => U, thisArg?: any) => U[] +> : ^ ^^ ^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^ ^^^^^^^^ +>ym => ym.toLocaleString("en", { month: "long", calendar: "iso8601" }) : (ym: Temporal.PlainYearMonth) => string +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>ym : Temporal.PlainYearMonth +> : ^^^^^^^^^^^^^^^^^^^^^^^ +>ym.toLocaleString("en", { month: "long", calendar: "iso8601" }) : string +> : ^^^^^^ +>ym.toLocaleString : (locales?: Intl.LocalesArgument, options?: Intl.DateTimeFormatOptions) => string +> : ^ ^^^ ^^ ^^^ ^^^^^ +>ym : Temporal.PlainYearMonth +> : ^^^^^^^^^^^^^^^^^^^^^^^ +>toLocaleString : (locales?: Intl.LocalesArgument, options?: Intl.DateTimeFormatOptions) => string +> : ^ ^^^ ^^ ^^^ ^^^^^ +>"en" : "en" +> : ^^^^ +>{ month: "long", calendar: "iso8601" } : { month: "long"; calendar: string; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>month : "long" +> : ^^^^^^ +>"long" : "long" +> : ^^^^^^ +>calendar : string +> : ^^^^^^ +>"iso8601" : "iso8601" +> : ^^^^^^^^^ + + // Shuffle to improve poem as determined empirically + strings.unshift(strings.pop()!); +>strings.unshift(strings.pop()!) : number +> : ^^^^^^ +>strings.unshift : (...items: string[]) => number +> : ^^^^ ^^^^^^^^^^^^^^^ +>strings : string[] +> : ^^^^^^^^ +>unshift : (...items: string[]) => number +> : ^^^^ ^^^^^^^^^^^^^^^ +>strings.pop()! : string +> : ^^^^^^ +>strings.pop() : string | undefined +> : ^^^^^^^^^^^^^^^^^^ +>strings.pop : () => string | undefined +> : ^^^^^^^^^^^^^^^^^^^^^^^^ +>strings : string[] +> : ^^^^^^^^ +>pop : () => string | undefined +> : ^^^^^^^^^^^^^^^^^^^^^^^^ + + const format = new Intl.ListFormat("en"); +>format : Intl.ListFormat +> : ^^^^^^^^^^^^^^^ +>new Intl.ListFormat("en") : Intl.ListFormat +> : ^^^^^^^^^^^^^^^ +>Intl.ListFormat : { new (locales?: Intl.LocalesArgument, options?: Intl.ListFormatOptions): Intl.ListFormat; prototype: Intl.ListFormat; supportedLocalesOf(locales: Intl.LocalesArgument, options?: Pick): Intl.UnicodeBCP47LocaleIdentifier[]; } +> : ^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^ ^^^ ^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^ +>Intl : typeof Intl +> : ^^^^^^^^^^^ +>ListFormat : { new (locales?: Intl.LocalesArgument, options?: Intl.ListFormatOptions): Intl.ListFormat; prototype: Intl.ListFormat; supportedLocalesOf(locales: Intl.LocalesArgument, options?: Pick): Intl.UnicodeBCP47LocaleIdentifier[]; } +> : ^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^ ^^^ ^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^ +>"en" : "en" +> : ^^^^ + + const poem = `Thirty days hath ${format.format(strings)}`; +>poem : string +> : ^^^^^^ +>`Thirty days hath ${format.format(strings)}` : string +> : ^^^^^^ +>format.format(strings) : string +> : ^^^^^^ +>format.format : (list: Iterable) => string +> : ^ ^^ ^^^^^ +>format : Intl.ListFormat +> : ^^^^^^^^^^^^^^^ +>format : (list: Iterable) => string +> : ^ ^^ ^^^^^ +>strings : string[] +> : ^^^^^^^^ + + console.log(poem); +>console.log(poem) : void +> : ^^^^ +>console.log : (...data: any[]) => void +> : ^^^^ ^^ ^^^^^ +>console : Console +> : ^^^^^^^ +>log : (...data: any[]) => void +> : ^^^^ ^^ ^^^^^ +>poem : string +> : ^^^^^^ +} + +{ + const ym = Temporal.PlainYearMonth.from({ year: 2019, month: 6, calendar: "iso8601" }); +>ym : Temporal.PlainYearMonth +> : ^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainYearMonth.from({ year: 2019, month: 6, calendar: "iso8601" }) : Temporal.PlainYearMonth +> : ^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainYearMonth.from : (item: Temporal.PlainYearMonthLike, options?: Temporal.OverflowOptions) => Temporal.PlainYearMonth +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainYearMonth : Temporal.PlainYearMonthConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>PlainYearMonth : Temporal.PlainYearMonthConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.PlainYearMonthLike, options?: Temporal.OverflowOptions) => Temporal.PlainYearMonth +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ year: 2019, month: 6, calendar: "iso8601" } : { year: number; month: number; calendar: string; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>year : number +> : ^^^^^^ +>2019 : 2019 +> : ^^^^ +>month : number +> : ^^^^^^ +>6 : 6 +> : ^ +>calendar : string +> : ^^^^^^ +>"iso8601" : "iso8601" +> : ^^^^^^^^^ + + const percent = ym.daysInMonth / ym.daysInYear; +>percent : number +> : ^^^^^^ +>ym.daysInMonth / ym.daysInYear : number +> : ^^^^^^ +>ym.daysInMonth : number +> : ^^^^^^ +>ym : Temporal.PlainYearMonth +> : ^^^^^^^^^^^^^^^^^^^^^^^ +>daysInMonth : number +> : ^^^^^^ +>ym.daysInYear : number +> : ^^^^^^ +>ym : Temporal.PlainYearMonth +> : ^^^^^^^^^^^^^^^^^^^^^^^ +>daysInYear : number +> : ^^^^^^ + + `${ym.toLocaleString("en", { month: "long", year: "numeric", calendar: "iso8601" })} was ${percent.toLocaleString("en", { style: "percent" })} of the year!`; +>`${ym.toLocaleString("en", { month: "long", year: "numeric", calendar: "iso8601" })} was ${percent.toLocaleString("en", { style: "percent" })} of the year!` : string +> : ^^^^^^ +>ym.toLocaleString("en", { month: "long", year: "numeric", calendar: "iso8601" }) : string +> : ^^^^^^ +>ym.toLocaleString : (locales?: Intl.LocalesArgument, options?: Intl.DateTimeFormatOptions) => string +> : ^ ^^^ ^^ ^^^ ^^^^^ +>ym : Temporal.PlainYearMonth +> : ^^^^^^^^^^^^^^^^^^^^^^^ +>toLocaleString : (locales?: Intl.LocalesArgument, options?: Intl.DateTimeFormatOptions) => string +> : ^ ^^^ ^^ ^^^ ^^^^^ +>"en" : "en" +> : ^^^^ +>{ month: "long", year: "numeric", calendar: "iso8601" } : { month: "long"; year: "numeric"; calendar: string; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>month : "long" +> : ^^^^^^ +>"long" : "long" +> : ^^^^^^ +>year : "numeric" +> : ^^^^^^^^^ +>"numeric" : "numeric" +> : ^^^^^^^^^ +>calendar : string +> : ^^^^^^ +>"iso8601" : "iso8601" +> : ^^^^^^^^^ +>percent.toLocaleString("en", { style: "percent" }) : string +> : ^^^^^^ +>percent.toLocaleString : (locales?: string | string[], options?: Intl.NumberFormatOptions) => string +> : ^ ^^^ ^^ ^^^ ^^^^^ +>percent : number +> : ^^^^^^ +>toLocaleString : (locales?: string | string[], options?: Intl.NumberFormatOptions) => string +> : ^ ^^^ ^^ ^^^ ^^^^^ +>"en" : "en" +> : ^^^^ +>{ style: "percent" } : { style: "percent"; } +> : ^^^^^^^^^^^^^^^^^^^^^ +>style : "percent" +> : ^^^^^^^^^ +>"percent" : "percent" +> : ^^^^^^^^^ + + // => 'June 2019 was 8% of the year!' +} + +{ + const ym = Temporal.PlainYearMonth.from("1900-01"); +>ym : Temporal.PlainYearMonth +> : ^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainYearMonth.from("1900-01") : Temporal.PlainYearMonth +> : ^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainYearMonth.from : (item: Temporal.PlainYearMonthLike, options?: Temporal.OverflowOptions) => Temporal.PlainYearMonth +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainYearMonth : Temporal.PlainYearMonthConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>PlainYearMonth : Temporal.PlainYearMonthConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.PlainYearMonthLike, options?: Temporal.OverflowOptions) => Temporal.PlainYearMonth +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"1900-01" : "1900-01" +> : ^^^^^^^^^ + + ym.monthsInYear; // => 12 +>ym.monthsInYear : number +> : ^^^^^^ +>ym : Temporal.PlainYearMonth +> : ^^^^^^^^^^^^^^^^^^^^^^^ +>monthsInYear : number +> : ^^^^^^ +} + +{ + // Was June 2019 in a leap year? + const ym = Temporal.PlainYearMonth.from("2019-06"); +>ym : Temporal.PlainYearMonth +> : ^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainYearMonth.from("2019-06") : Temporal.PlainYearMonth +> : ^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainYearMonth.from : (item: Temporal.PlainYearMonthLike, options?: Temporal.OverflowOptions) => Temporal.PlainYearMonth +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainYearMonth : Temporal.PlainYearMonthConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>PlainYearMonth : Temporal.PlainYearMonthConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.PlainYearMonthLike, options?: Temporal.OverflowOptions) => Temporal.PlainYearMonth +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"2019-06" : "2019-06" +> : ^^^^^^^^^ + + ym.inLeapYear; // => false +>ym.inLeapYear : boolean +> : ^^^^^^^ +>ym : Temporal.PlainYearMonth +> : ^^^^^^^^^^^^^^^^^^^^^^^ +>inLeapYear : boolean +> : ^^^^^^^ + + // Is 2100 a leap year? (no, because it's divisible by 100 and not 400) + ym.with({ year: 2100 }).inLeapYear; // => false +>ym.with({ year: 2100 }).inLeapYear : boolean +> : ^^^^^^^ +>ym.with({ year: 2100 }) : Temporal.PlainYearMonth +> : ^^^^^^^^^^^^^^^^^^^^^^^ +>ym.with : (yearMonthLike: Temporal.PartialTemporalLike, options?: Temporal.OverflowOptions) => Temporal.PlainYearMonth +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>ym : Temporal.PlainYearMonth +> : ^^^^^^^^^^^^^^^^^^^^^^^ +>with : (yearMonthLike: Temporal.PartialTemporalLike, options?: Temporal.OverflowOptions) => Temporal.PlainYearMonth +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ year: 2100 } : { year: number; } +> : ^^^^^^^^^^^^^^^^^ +>year : number +> : ^^^^^^ +>2100 : 2100 +> : ^^^^ +>inLeapYear : boolean +> : ^^^^^^^ +} + +{ + const ym = Temporal.PlainYearMonth.from("2019-06"); +>ym : Temporal.PlainYearMonth +> : ^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainYearMonth.from("2019-06") : Temporal.PlainYearMonth +> : ^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainYearMonth.from : (item: Temporal.PlainYearMonthLike, options?: Temporal.OverflowOptions) => Temporal.PlainYearMonth +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainYearMonth : Temporal.PlainYearMonthConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>PlainYearMonth : Temporal.PlainYearMonthConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.PlainYearMonthLike, options?: Temporal.OverflowOptions) => Temporal.PlainYearMonth +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"2019-06" : "2019-06" +> : ^^^^^^^^^ + + // Get December of that year + ym.with({ month: 12 }); // => 2019-12 +>ym.with({ month: 12 }) : Temporal.PlainYearMonth +> : ^^^^^^^^^^^^^^^^^^^^^^^ +>ym.with : (yearMonthLike: Temporal.PartialTemporalLike, options?: Temporal.OverflowOptions) => Temporal.PlainYearMonth +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>ym : Temporal.PlainYearMonth +> : ^^^^^^^^^^^^^^^^^^^^^^^ +>with : (yearMonthLike: Temporal.PartialTemporalLike, options?: Temporal.OverflowOptions) => Temporal.PlainYearMonth +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ month: 12 } : { month: number; } +> : ^^^^^^^^^^^^^^^^^^ +>month : number +> : ^^^^^^ +>12 : 12 +> : ^^ +} + +{ + const ym = Temporal.PlainYearMonth.from("2019-06"); +>ym : Temporal.PlainYearMonth +> : ^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainYearMonth.from("2019-06") : Temporal.PlainYearMonth +> : ^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainYearMonth.from : (item: Temporal.PlainYearMonthLike, options?: Temporal.OverflowOptions) => Temporal.PlainYearMonth +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainYearMonth : Temporal.PlainYearMonthConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>PlainYearMonth : Temporal.PlainYearMonthConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.PlainYearMonthLike, options?: Temporal.OverflowOptions) => Temporal.PlainYearMonth +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"2019-06" : "2019-06" +> : ^^^^^^^^^ + + ym.add({ years: 20, months: 4 }); // => 2039-10 +>ym.add({ years: 20, months: 4 }) : Temporal.PlainYearMonth +> : ^^^^^^^^^^^^^^^^^^^^^^^ +>ym.add : (duration: Temporal.DurationLike, options?: Temporal.OverflowOptions) => Temporal.PlainYearMonth +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>ym : Temporal.PlainYearMonth +> : ^^^^^^^^^^^^^^^^^^^^^^^ +>add : (duration: Temporal.DurationLike, options?: Temporal.OverflowOptions) => Temporal.PlainYearMonth +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ years: 20, months: 4 } : { years: number; months: number; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>years : number +> : ^^^^^^ +>20 : 20 +> : ^^ +>months : number +> : ^^^^^^ +>4 : 4 +> : ^ +} + +{ + const ym = Temporal.PlainYearMonth.from("2019-06"); +>ym : Temporal.PlainYearMonth +> : ^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainYearMonth.from("2019-06") : Temporal.PlainYearMonth +> : ^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainYearMonth.from : (item: Temporal.PlainYearMonthLike, options?: Temporal.OverflowOptions) => Temporal.PlainYearMonth +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainYearMonth : Temporal.PlainYearMonthConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>PlainYearMonth : Temporal.PlainYearMonthConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.PlainYearMonthLike, options?: Temporal.OverflowOptions) => Temporal.PlainYearMonth +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"2019-06" : "2019-06" +> : ^^^^^^^^^ + + ym.subtract({ years: 20, months: 4 }); // => 1999-02 +>ym.subtract({ years: 20, months: 4 }) : Temporal.PlainYearMonth +> : ^^^^^^^^^^^^^^^^^^^^^^^ +>ym.subtract : (duration: Temporal.DurationLike, options?: Temporal.OverflowOptions) => Temporal.PlainYearMonth +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>ym : Temporal.PlainYearMonth +> : ^^^^^^^^^^^^^^^^^^^^^^^ +>subtract : (duration: Temporal.DurationLike, options?: Temporal.OverflowOptions) => Temporal.PlainYearMonth +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ years: 20, months: 4 } : { years: number; months: number; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>years : number +> : ^^^^^^ +>20 : 20 +> : ^^ +>months : number +> : ^^^^^^ +>4 : 4 +> : ^ +} + +{ + const ym = Temporal.PlainYearMonth.from("2006-08"); +>ym : Temporal.PlainYearMonth +> : ^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainYearMonth.from("2006-08") : Temporal.PlainYearMonth +> : ^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainYearMonth.from : (item: Temporal.PlainYearMonthLike, options?: Temporal.OverflowOptions) => Temporal.PlainYearMonth +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainYearMonth : Temporal.PlainYearMonthConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>PlainYearMonth : Temporal.PlainYearMonthConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.PlainYearMonthLike, options?: Temporal.OverflowOptions) => Temporal.PlainYearMonth +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"2006-08" : "2006-08" +> : ^^^^^^^^^ + + const other = Temporal.PlainYearMonth.from("2019-06"); +>other : Temporal.PlainYearMonth +> : ^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainYearMonth.from("2019-06") : Temporal.PlainYearMonth +> : ^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainYearMonth.from : (item: Temporal.PlainYearMonthLike, options?: Temporal.OverflowOptions) => Temporal.PlainYearMonth +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainYearMonth : Temporal.PlainYearMonthConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>PlainYearMonth : Temporal.PlainYearMonthConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.PlainYearMonthLike, options?: Temporal.OverflowOptions) => Temporal.PlainYearMonth +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"2019-06" : "2019-06" +> : ^^^^^^^^^ + + ym.until(other); // => P12Y10M +>ym.until(other) : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>ym.until : (other: Temporal.PlainYearMonthLike, options?: Temporal.RoundingOptionsWithLargestUnit<"year" | "month" | "years" | "months">) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^ +>ym : Temporal.PlainYearMonth +> : ^^^^^^^^^^^^^^^^^^^^^^^ +>until : (other: Temporal.PlainYearMonthLike, options?: Temporal.RoundingOptionsWithLargestUnit<"year" | "month" | "years" | "months">) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^ +>other : Temporal.PlainYearMonth +> : ^^^^^^^^^^^^^^^^^^^^^^^ + + ym.until(other, { largestUnit: "month" }); // => P154M +>ym.until(other, { largestUnit: "month" }) : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>ym.until : (other: Temporal.PlainYearMonthLike, options?: Temporal.RoundingOptionsWithLargestUnit<"year" | "month" | "years" | "months">) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^ +>ym : Temporal.PlainYearMonth +> : ^^^^^^^^^^^^^^^^^^^^^^^ +>until : (other: Temporal.PlainYearMonthLike, options?: Temporal.RoundingOptionsWithLargestUnit<"year" | "month" | "years" | "months">) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^ +>other : Temporal.PlainYearMonth +> : ^^^^^^^^^^^^^^^^^^^^^^^ +>{ largestUnit: "month" } : { largestUnit: "month"; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^ +>largestUnit : "month" +> : ^^^^^^^ +>"month" : "month" +> : ^^^^^^^ + + other.until(ym, { largestUnit: "month" }); // => -P154M +>other.until(ym, { largestUnit: "month" }) : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>other.until : (other: Temporal.PlainYearMonthLike, options?: Temporal.RoundingOptionsWithLargestUnit<"year" | "month" | "years" | "months">) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^ +>other : Temporal.PlainYearMonth +> : ^^^^^^^^^^^^^^^^^^^^^^^ +>until : (other: Temporal.PlainYearMonthLike, options?: Temporal.RoundingOptionsWithLargestUnit<"year" | "month" | "years" | "months">) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^ +>ym : Temporal.PlainYearMonth +> : ^^^^^^^^^^^^^^^^^^^^^^^ +>{ largestUnit: "month" } : { largestUnit: "month"; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^ +>largestUnit : "month" +> : ^^^^^^^ +>"month" : "month" +> : ^^^^^^^ + + // If you really need to calculate the difference between two YearMonths + // in days, you can eliminate the ambiguity by explicitly choosing the + // day of the month (and if applicable, the time of that day) from which + // you want to reckon the difference. For example, using the first of + // the month to calculate a number of days: + ym.toPlainDate({ day: 1 }).until(other.toPlainDate({ day: 1 }), { largestUnit: "day" }); // => P4687D +>ym.toPlainDate({ day: 1 }).until(other.toPlainDate({ day: 1 }), { largestUnit: "day" }) : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>ym.toPlainDate({ day: 1 }).until : (other: Temporal.PlainDateLike, options?: Temporal.RoundingOptionsWithLargestUnit) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^ +>ym.toPlainDate({ day: 1 }) : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>ym.toPlainDate : (item: Temporal.PlainYearMonthToPlainDateOptions) => Temporal.PlainDate +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>ym : Temporal.PlainYearMonth +> : ^^^^^^^^^^^^^^^^^^^^^^^ +>toPlainDate : (item: Temporal.PlainYearMonthToPlainDateOptions) => Temporal.PlainDate +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ day: 1 } : { day: number; } +> : ^^^^^^^^^^^^^^^^ +>day : number +> : ^^^^^^ +>1 : 1 +> : ^ +>until : (other: Temporal.PlainDateLike, options?: Temporal.RoundingOptionsWithLargestUnit) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^ +>other.toPlainDate({ day: 1 }) : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>other.toPlainDate : (item: Temporal.PlainYearMonthToPlainDateOptions) => Temporal.PlainDate +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>other : Temporal.PlainYearMonth +> : ^^^^^^^^^^^^^^^^^^^^^^^ +>toPlainDate : (item: Temporal.PlainYearMonthToPlainDateOptions) => Temporal.PlainDate +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ day: 1 } : { day: number; } +> : ^^^^^^^^^^^^^^^^ +>day : number +> : ^^^^^^ +>1 : 1 +> : ^ +>{ largestUnit: "day" } : { largestUnit: "day"; } +> : ^^^^^^^^^^^^^^^^^^^^^^^ +>largestUnit : "day" +> : ^^^^^ +>"day" : "day" +> : ^^^^^ +} + +{ + const ym = Temporal.PlainYearMonth.from("2019-06"); +>ym : Temporal.PlainYearMonth +> : ^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainYearMonth.from("2019-06") : Temporal.PlainYearMonth +> : ^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainYearMonth.from : (item: Temporal.PlainYearMonthLike, options?: Temporal.OverflowOptions) => Temporal.PlainYearMonth +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainYearMonth : Temporal.PlainYearMonthConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>PlainYearMonth : Temporal.PlainYearMonthConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.PlainYearMonthLike, options?: Temporal.OverflowOptions) => Temporal.PlainYearMonth +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"2019-06" : "2019-06" +> : ^^^^^^^^^ + + const other = Temporal.PlainYearMonth.from("2006-08"); +>other : Temporal.PlainYearMonth +> : ^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainYearMonth.from("2006-08") : Temporal.PlainYearMonth +> : ^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainYearMonth.from : (item: Temporal.PlainYearMonthLike, options?: Temporal.OverflowOptions) => Temporal.PlainYearMonth +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainYearMonth : Temporal.PlainYearMonthConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>PlainYearMonth : Temporal.PlainYearMonthConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.PlainYearMonthLike, options?: Temporal.OverflowOptions) => Temporal.PlainYearMonth +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"2006-08" : "2006-08" +> : ^^^^^^^^^ + + ym.since(other); // => P12Y10M +>ym.since(other) : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>ym.since : (other: Temporal.PlainYearMonthLike, options?: Temporal.RoundingOptionsWithLargestUnit<"year" | "month" | "years" | "months">) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^ +>ym : Temporal.PlainYearMonth +> : ^^^^^^^^^^^^^^^^^^^^^^^ +>since : (other: Temporal.PlainYearMonthLike, options?: Temporal.RoundingOptionsWithLargestUnit<"year" | "month" | "years" | "months">) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^ +>other : Temporal.PlainYearMonth +> : ^^^^^^^^^^^^^^^^^^^^^^^ +} + +{ + const ym = Temporal.PlainYearMonth.from("2019-06"); +>ym : Temporal.PlainYearMonth +> : ^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainYearMonth.from("2019-06") : Temporal.PlainYearMonth +> : ^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainYearMonth.from : (item: Temporal.PlainYearMonthLike, options?: Temporal.OverflowOptions) => Temporal.PlainYearMonth +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainYearMonth : Temporal.PlainYearMonthConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>PlainYearMonth : Temporal.PlainYearMonthConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.PlainYearMonthLike, options?: Temporal.OverflowOptions) => Temporal.PlainYearMonth +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"2019-06" : "2019-06" +> : ^^^^^^^^^ + + const other = Temporal.PlainYearMonth.from("2006-08"); +>other : Temporal.PlainYearMonth +> : ^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainYearMonth.from("2006-08") : Temporal.PlainYearMonth +> : ^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainYearMonth.from : (item: Temporal.PlainYearMonthLike, options?: Temporal.OverflowOptions) => Temporal.PlainYearMonth +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainYearMonth : Temporal.PlainYearMonthConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>PlainYearMonth : Temporal.PlainYearMonthConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.PlainYearMonthLike, options?: Temporal.OverflowOptions) => Temporal.PlainYearMonth +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"2006-08" : "2006-08" +> : ^^^^^^^^^ + + ym.equals(other); // => false +>ym.equals(other) : boolean +> : ^^^^^^^ +>ym.equals : (other: Temporal.PlainYearMonthLike) => boolean +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>ym : Temporal.PlainYearMonth +> : ^^^^^^^^^^^^^^^^^^^^^^^ +>equals : (other: Temporal.PlainYearMonthLike) => boolean +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>other : Temporal.PlainYearMonth +> : ^^^^^^^^^^^^^^^^^^^^^^^ + + ym.equals(ym); // => true +>ym.equals(ym) : boolean +> : ^^^^^^^ +>ym.equals : (other: Temporal.PlainYearMonthLike) => boolean +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>ym : Temporal.PlainYearMonth +> : ^^^^^^^^^^^^^^^^^^^^^^^ +>equals : (other: Temporal.PlainYearMonthLike) => boolean +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>ym : Temporal.PlainYearMonth +> : ^^^^^^^^^^^^^^^^^^^^^^^ +} + +{ + const ym = Temporal.PlainYearMonth.from("2019-06"); +>ym : Temporal.PlainYearMonth +> : ^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainYearMonth.from("2019-06") : Temporal.PlainYearMonth +> : ^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainYearMonth.from : (item: Temporal.PlainYearMonthLike, options?: Temporal.OverflowOptions) => Temporal.PlainYearMonth +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainYearMonth : Temporal.PlainYearMonthConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>PlainYearMonth : Temporal.PlainYearMonthConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.PlainYearMonthLike, options?: Temporal.OverflowOptions) => Temporal.PlainYearMonth +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"2019-06" : "2019-06" +> : ^^^^^^^^^ + + ym.toString(); // => '2019-06' +>ym.toString() : string +> : ^^^^^^ +>ym.toString : (options?: Temporal.PlainDateToStringOptions) => string +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>ym : Temporal.PlainYearMonth +> : ^^^^^^^^^^^^^^^^^^^^^^^ +>toString : (options?: Temporal.PlainDateToStringOptions) => string +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +} + +{ + const { calendar } = new Intl.DateTimeFormat().resolvedOptions(); +>calendar : string +> : ^^^^^^ +>new Intl.DateTimeFormat().resolvedOptions() : Intl.ResolvedDateTimeFormatOptions +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>new Intl.DateTimeFormat().resolvedOptions : () => Intl.ResolvedDateTimeFormatOptions +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>new Intl.DateTimeFormat() : Intl.DateTimeFormat +> : ^^^^^^^^^^^^^^^^^^^ +>Intl.DateTimeFormat : Intl.DateTimeFormatConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Intl : typeof Intl +> : ^^^^^^^^^^^ +>DateTimeFormat : Intl.DateTimeFormatConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>resolvedOptions : () => Intl.ResolvedDateTimeFormatOptions +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + const ym = Temporal.PlainYearMonth.from({ year: 2019, month: 6, calendar }); +>ym : Temporal.PlainYearMonth +> : ^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainYearMonth.from({ year: 2019, month: 6, calendar }) : Temporal.PlainYearMonth +> : ^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainYearMonth.from : (item: Temporal.PlainYearMonthLike, options?: Temporal.OverflowOptions) => Temporal.PlainYearMonth +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainYearMonth : Temporal.PlainYearMonthConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>PlainYearMonth : Temporal.PlainYearMonthConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.PlainYearMonthLike, options?: Temporal.OverflowOptions) => Temporal.PlainYearMonth +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ year: 2019, month: 6, calendar } : { year: number; month: number; calendar: string; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>year : number +> : ^^^^^^ +>2019 : 2019 +> : ^^^^ +>month : number +> : ^^^^^^ +>6 : 6 +> : ^ +>calendar : string +> : ^^^^^^ + + ym.toLocaleString(); // example output: '6/2019' +>ym.toLocaleString() : string +> : ^^^^^^ +>ym.toLocaleString : (locales?: Intl.LocalesArgument, options?: Intl.DateTimeFormatOptions) => string +> : ^ ^^^ ^^ ^^^ ^^^^^ +>ym : Temporal.PlainYearMonth +> : ^^^^^^^^^^^^^^^^^^^^^^^ +>toLocaleString : (locales?: Intl.LocalesArgument, options?: Intl.DateTimeFormatOptions) => string +> : ^ ^^^ ^^ ^^^ ^^^^^ + + // Same as above, but explicitly specifying the calendar: + ym.toLocaleString(undefined, { calendar }); +>ym.toLocaleString(undefined, { calendar }) : string +> : ^^^^^^ +>ym.toLocaleString : (locales?: Intl.LocalesArgument, options?: Intl.DateTimeFormatOptions) => string +> : ^ ^^^ ^^ ^^^ ^^^^^ +>ym : Temporal.PlainYearMonth +> : ^^^^^^^^^^^^^^^^^^^^^^^ +>toLocaleString : (locales?: Intl.LocalesArgument, options?: Intl.DateTimeFormatOptions) => string +> : ^ ^^^ ^^ ^^^ ^^^^^ +>undefined : undefined +> : ^^^^^^^^^ +>{ calendar } : { calendar: string; } +> : ^^^^^^^^^^^^^^^^^^^^^ +>calendar : string +> : ^^^^^^ + + ym.toLocaleString("de-DE", { calendar }); // example output: '6.2019' +>ym.toLocaleString("de-DE", { calendar }) : string +> : ^^^^^^ +>ym.toLocaleString : (locales?: Intl.LocalesArgument, options?: Intl.DateTimeFormatOptions) => string +> : ^ ^^^ ^^ ^^^ ^^^^^ +>ym : Temporal.PlainYearMonth +> : ^^^^^^^^^^^^^^^^^^^^^^^ +>toLocaleString : (locales?: Intl.LocalesArgument, options?: Intl.DateTimeFormatOptions) => string +> : ^ ^^^ ^^ ^^^ ^^^^^ +>"de-DE" : "de-DE" +> : ^^^^^^^ +>{ calendar } : { calendar: string; } +> : ^^^^^^^^^^^^^^^^^^^^^ +>calendar : string +> : ^^^^^^ + + ym.toLocaleString("de-DE", { month: "long", year: "numeric", calendar }); // => 'Juni 2019' +>ym.toLocaleString("de-DE", { month: "long", year: "numeric", calendar }) : string +> : ^^^^^^ +>ym.toLocaleString : (locales?: Intl.LocalesArgument, options?: Intl.DateTimeFormatOptions) => string +> : ^ ^^^ ^^ ^^^ ^^^^^ +>ym : Temporal.PlainYearMonth +> : ^^^^^^^^^^^^^^^^^^^^^^^ +>toLocaleString : (locales?: Intl.LocalesArgument, options?: Intl.DateTimeFormatOptions) => string +> : ^ ^^^ ^^ ^^^ ^^^^^ +>"de-DE" : "de-DE" +> : ^^^^^^^ +>{ month: "long", year: "numeric", calendar } : { month: "long"; year: "numeric"; calendar: string; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>month : "long" +> : ^^^^^^ +>"long" : "long" +> : ^^^^^^ +>year : "numeric" +> : ^^^^^^^^^ +>"numeric" : "numeric" +> : ^^^^^^^^^ +>calendar : string +> : ^^^^^^ + + ym.toLocaleString(`en-US-u-nu-fullwide-ca-${calendar}`); // => '6/2019' +>ym.toLocaleString(`en-US-u-nu-fullwide-ca-${calendar}`) : string +> : ^^^^^^ +>ym.toLocaleString : (locales?: Intl.LocalesArgument, options?: Intl.DateTimeFormatOptions) => string +> : ^ ^^^ ^^ ^^^ ^^^^^ +>ym : Temporal.PlainYearMonth +> : ^^^^^^^^^^^^^^^^^^^^^^^ +>toLocaleString : (locales?: Intl.LocalesArgument, options?: Intl.DateTimeFormatOptions) => string +> : ^ ^^^ ^^ ^^^ ^^^^^ +>`en-US-u-nu-fullwide-ca-${calendar}` : string +> : ^^^^^^ +>calendar : string +> : ^^^^^^ +} + +{ + const ym = Temporal.PlainYearMonth.from("2019-06"); +>ym : Temporal.PlainYearMonth +> : ^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainYearMonth.from("2019-06") : Temporal.PlainYearMonth +> : ^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainYearMonth.from : (item: Temporal.PlainYearMonthLike, options?: Temporal.OverflowOptions) => Temporal.PlainYearMonth +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainYearMonth : Temporal.PlainYearMonthConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>PlainYearMonth : Temporal.PlainYearMonthConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.PlainYearMonthLike, options?: Temporal.OverflowOptions) => Temporal.PlainYearMonth +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"2019-06" : "2019-06" +> : ^^^^^^^^^ + + ym.toPlainDate({ day: 24 }); // => 2019-06-24 +>ym.toPlainDate({ day: 24 }) : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>ym.toPlainDate : (item: Temporal.PlainYearMonthToPlainDateOptions) => Temporal.PlainDate +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>ym : Temporal.PlainYearMonth +> : ^^^^^^^^^^^^^^^^^^^^^^^ +>toPlainDate : (item: Temporal.PlainYearMonthToPlainDateOptions) => Temporal.PlainDate +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ day: 24 } : { day: number; } +> : ^^^^^^^^^^^^^^^^ +>day : number +> : ^^^^^^ +>24 : 24 +> : ^^ +} + +{ + let md: Temporal.PlainMonthDay; +>md : Temporal.PlainMonthDay +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : any +> : ^^^ + + // Pi day + md = new Temporal.PlainMonthDay(3, 14); // => 03-14 +>md = new Temporal.PlainMonthDay(3, 14) : Temporal.PlainMonthDay +> : ^^^^^^^^^^^^^^^^^^^^^^ +>md : Temporal.PlainMonthDay +> : ^^^^^^^^^^^^^^^^^^^^^^ +>new Temporal.PlainMonthDay(3, 14) : Temporal.PlainMonthDay +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainMonthDay : Temporal.PlainMonthDayConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>PlainMonthDay : Temporal.PlainMonthDayConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>3 : 3 +> : ^ +>14 : 14 +> : ^^ + + // Leap day + md = new Temporal.PlainMonthDay(2, 29); // => 02-29 +>md = new Temporal.PlainMonthDay(2, 29) : Temporal.PlainMonthDay +> : ^^^^^^^^^^^^^^^^^^^^^^ +>md : Temporal.PlainMonthDay +> : ^^^^^^^^^^^^^^^^^^^^^^ +>new Temporal.PlainMonthDay(2, 29) : Temporal.PlainMonthDay +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainMonthDay : Temporal.PlainMonthDayConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>PlainMonthDay : Temporal.PlainMonthDayConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>2 : 2 +> : ^ +>29 : 29 +> : ^^ +} + +{ + let md: Temporal.PlainMonthDay; +>md : Temporal.PlainMonthDay +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : any +> : ^^^ + + md = Temporal.PlainMonthDay.from("08-24"); // => 08-24 +>md = Temporal.PlainMonthDay.from("08-24") : Temporal.PlainMonthDay +> : ^^^^^^^^^^^^^^^^^^^^^^ +>md : Temporal.PlainMonthDay +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainMonthDay.from("08-24") : Temporal.PlainMonthDay +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainMonthDay.from : (item: Temporal.PlainMonthDayLike, options?: Temporal.OverflowOptions) => Temporal.PlainMonthDay +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainMonthDay : Temporal.PlainMonthDayConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>PlainMonthDay : Temporal.PlainMonthDayConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.PlainMonthDayLike, options?: Temporal.OverflowOptions) => Temporal.PlainMonthDay +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"08-24" : "08-24" +> : ^^^^^^^ + + md = Temporal.PlainMonthDay.from("0824"); // => 08-24 +>md = Temporal.PlainMonthDay.from("0824") : Temporal.PlainMonthDay +> : ^^^^^^^^^^^^^^^^^^^^^^ +>md : Temporal.PlainMonthDay +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainMonthDay.from("0824") : Temporal.PlainMonthDay +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainMonthDay.from : (item: Temporal.PlainMonthDayLike, options?: Temporal.OverflowOptions) => Temporal.PlainMonthDay +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainMonthDay : Temporal.PlainMonthDayConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>PlainMonthDay : Temporal.PlainMonthDayConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.PlainMonthDayLike, options?: Temporal.OverflowOptions) => Temporal.PlainMonthDay +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"0824" : "0824" +> : ^^^^^^ + + md = Temporal.PlainMonthDay.from("2006-08-24"); // => 08-24 +>md = Temporal.PlainMonthDay.from("2006-08-24") : Temporal.PlainMonthDay +> : ^^^^^^^^^^^^^^^^^^^^^^ +>md : Temporal.PlainMonthDay +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainMonthDay.from("2006-08-24") : Temporal.PlainMonthDay +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainMonthDay.from : (item: Temporal.PlainMonthDayLike, options?: Temporal.OverflowOptions) => Temporal.PlainMonthDay +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainMonthDay : Temporal.PlainMonthDayConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>PlainMonthDay : Temporal.PlainMonthDayConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.PlainMonthDayLike, options?: Temporal.OverflowOptions) => Temporal.PlainMonthDay +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"2006-08-24" : "2006-08-24" +> : ^^^^^^^^^^^^ + + md = Temporal.PlainMonthDay.from("2006-08-24T15:43:27"); // => 08-24 +>md = Temporal.PlainMonthDay.from("2006-08-24T15:43:27") : Temporal.PlainMonthDay +> : ^^^^^^^^^^^^^^^^^^^^^^ +>md : Temporal.PlainMonthDay +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainMonthDay.from("2006-08-24T15:43:27") : Temporal.PlainMonthDay +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainMonthDay.from : (item: Temporal.PlainMonthDayLike, options?: Temporal.OverflowOptions) => Temporal.PlainMonthDay +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainMonthDay : Temporal.PlainMonthDayConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>PlainMonthDay : Temporal.PlainMonthDayConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.PlainMonthDayLike, options?: Temporal.OverflowOptions) => Temporal.PlainMonthDay +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"2006-08-24T15:43:27" : "2006-08-24T15:43:27" +> : ^^^^^^^^^^^^^^^^^^^^^ + + md = Temporal.PlainMonthDay.from("2006-08-24T15:43:27+01:00[Europe/Brussels]"); +>md = Temporal.PlainMonthDay.from("2006-08-24T15:43:27+01:00[Europe/Brussels]") : Temporal.PlainMonthDay +> : ^^^^^^^^^^^^^^^^^^^^^^ +>md : Temporal.PlainMonthDay +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainMonthDay.from("2006-08-24T15:43:27+01:00[Europe/Brussels]") : Temporal.PlainMonthDay +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainMonthDay.from : (item: Temporal.PlainMonthDayLike, options?: Temporal.OverflowOptions) => Temporal.PlainMonthDay +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainMonthDay : Temporal.PlainMonthDayConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>PlainMonthDay : Temporal.PlainMonthDayConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.PlainMonthDayLike, options?: Temporal.OverflowOptions) => Temporal.PlainMonthDay +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"2006-08-24T15:43:27+01:00[Europe/Brussels]" : "2006-08-24T15:43:27+01:00[Europe/Brussels]" +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + // => 08-24 + md === Temporal.PlainMonthDay.from(md); // => false +>md === Temporal.PlainMonthDay.from(md) : boolean +> : ^^^^^^^ +>md : Temporal.PlainMonthDay +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainMonthDay.from(md) : Temporal.PlainMonthDay +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainMonthDay.from : (item: Temporal.PlainMonthDayLike, options?: Temporal.OverflowOptions) => Temporal.PlainMonthDay +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainMonthDay : Temporal.PlainMonthDayConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>PlainMonthDay : Temporal.PlainMonthDayConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.PlainMonthDayLike, options?: Temporal.OverflowOptions) => Temporal.PlainMonthDay +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>md : Temporal.PlainMonthDay +> : ^^^^^^^^^^^^^^^^^^^^^^ + + md = Temporal.PlainMonthDay.from({ monthCode: "M08", day: 24 }); // => 08-24 +>md = Temporal.PlainMonthDay.from({ monthCode: "M08", day: 24 }) : Temporal.PlainMonthDay +> : ^^^^^^^^^^^^^^^^^^^^^^ +>md : Temporal.PlainMonthDay +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainMonthDay.from({ monthCode: "M08", day: 24 }) : Temporal.PlainMonthDay +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainMonthDay.from : (item: Temporal.PlainMonthDayLike, options?: Temporal.OverflowOptions) => Temporal.PlainMonthDay +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainMonthDay : Temporal.PlainMonthDayConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>PlainMonthDay : Temporal.PlainMonthDayConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.PlainMonthDayLike, options?: Temporal.OverflowOptions) => Temporal.PlainMonthDay +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ monthCode: "M08", day: 24 } : { monthCode: string; day: number; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>monthCode : string +> : ^^^^^^ +>"M08" : "M08" +> : ^^^^^ +>day : number +> : ^^^^^^ +>24 : 24 +> : ^^ + + md = Temporal.PlainMonthDay.from(Temporal.PlainDate.from("2006-08-24")); +>md = Temporal.PlainMonthDay.from(Temporal.PlainDate.from("2006-08-24")) : Temporal.PlainMonthDay +> : ^^^^^^^^^^^^^^^^^^^^^^ +>md : Temporal.PlainMonthDay +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainMonthDay.from(Temporal.PlainDate.from("2006-08-24")) : Temporal.PlainMonthDay +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainMonthDay.from : (item: Temporal.PlainMonthDayLike, options?: Temporal.OverflowOptions) => Temporal.PlainMonthDay +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainMonthDay : Temporal.PlainMonthDayConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>PlainMonthDay : Temporal.PlainMonthDayConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.PlainMonthDayLike, options?: Temporal.OverflowOptions) => Temporal.PlainMonthDay +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDate.from("2006-08-24") : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDate.from : (item: Temporal.PlainDateLike, options?: Temporal.OverflowOptions) => Temporal.PlainDate +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDate : Temporal.PlainDateConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>PlainDate : Temporal.PlainDateConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.PlainDateLike, options?: Temporal.OverflowOptions) => Temporal.PlainDate +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"2006-08-24" : "2006-08-24" +> : ^^^^^^^^^^^^ + + // => 08-24 + // (same as above; Temporal.PlainDate has month and day properties) + + // Different overflow modes + md = Temporal.PlainMonthDay.from({ month: 13, day: 1, year: 2000 }, { overflow: "constrain" }); +>md = Temporal.PlainMonthDay.from({ month: 13, day: 1, year: 2000 }, { overflow: "constrain" }) : Temporal.PlainMonthDay +> : ^^^^^^^^^^^^^^^^^^^^^^ +>md : Temporal.PlainMonthDay +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainMonthDay.from({ month: 13, day: 1, year: 2000 }, { overflow: "constrain" }) : Temporal.PlainMonthDay +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainMonthDay.from : (item: Temporal.PlainMonthDayLike, options?: Temporal.OverflowOptions) => Temporal.PlainMonthDay +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainMonthDay : Temporal.PlainMonthDayConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>PlainMonthDay : Temporal.PlainMonthDayConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.PlainMonthDayLike, options?: Temporal.OverflowOptions) => Temporal.PlainMonthDay +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ month: 13, day: 1, year: 2000 } : { month: number; day: number; year: number; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>month : number +> : ^^^^^^ +>13 : 13 +> : ^^ +>day : number +> : ^^^^^^ +>1 : 1 +> : ^ +>year : number +> : ^^^^^^ +>2000 : 2000 +> : ^^^^ +>{ overflow: "constrain" } : { overflow: "constrain"; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^ +>overflow : "constrain" +> : ^^^^^^^^^^^ +>"constrain" : "constrain" +> : ^^^^^^^^^^^ + + // => 12-01 + md = Temporal.PlainMonthDay.from({ month: 1, day: 32, year: 2000 }, { overflow: "constrain" }); +>md = Temporal.PlainMonthDay.from({ month: 1, day: 32, year: 2000 }, { overflow: "constrain" }) : Temporal.PlainMonthDay +> : ^^^^^^^^^^^^^^^^^^^^^^ +>md : Temporal.PlainMonthDay +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainMonthDay.from({ month: 1, day: 32, year: 2000 }, { overflow: "constrain" }) : Temporal.PlainMonthDay +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainMonthDay.from : (item: Temporal.PlainMonthDayLike, options?: Temporal.OverflowOptions) => Temporal.PlainMonthDay +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainMonthDay : Temporal.PlainMonthDayConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>PlainMonthDay : Temporal.PlainMonthDayConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.PlainMonthDayLike, options?: Temporal.OverflowOptions) => Temporal.PlainMonthDay +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ month: 1, day: 32, year: 2000 } : { month: number; day: number; year: number; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>month : number +> : ^^^^^^ +>1 : 1 +> : ^ +>day : number +> : ^^^^^^ +>32 : 32 +> : ^^ +>year : number +> : ^^^^^^ +>2000 : 2000 +> : ^^^^ +>{ overflow: "constrain" } : { overflow: "constrain"; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^ +>overflow : "constrain" +> : ^^^^^^^^^^^ +>"constrain" : "constrain" +> : ^^^^^^^^^^^ + + // => 01-31 + md = Temporal.PlainMonthDay.from({ month: 13, day: 1, year: 2000 }, { overflow: "reject" }); +>md = Temporal.PlainMonthDay.from({ month: 13, day: 1, year: 2000 }, { overflow: "reject" }) : Temporal.PlainMonthDay +> : ^^^^^^^^^^^^^^^^^^^^^^ +>md : Temporal.PlainMonthDay +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainMonthDay.from({ month: 13, day: 1, year: 2000 }, { overflow: "reject" }) : Temporal.PlainMonthDay +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainMonthDay.from : (item: Temporal.PlainMonthDayLike, options?: Temporal.OverflowOptions) => Temporal.PlainMonthDay +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainMonthDay : Temporal.PlainMonthDayConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>PlainMonthDay : Temporal.PlainMonthDayConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.PlainMonthDayLike, options?: Temporal.OverflowOptions) => Temporal.PlainMonthDay +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ month: 13, day: 1, year: 2000 } : { month: number; day: number; year: number; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>month : number +> : ^^^^^^ +>13 : 13 +> : ^^ +>day : number +> : ^^^^^^ +>1 : 1 +> : ^ +>year : number +> : ^^^^^^ +>2000 : 2000 +> : ^^^^ +>{ overflow: "reject" } : { overflow: "reject"; } +> : ^^^^^^^^^^^^^^^^^^^^^^^ +>overflow : "reject" +> : ^^^^^^^^ +>"reject" : "reject" +> : ^^^^^^^^ + + // => throws + md = Temporal.PlainMonthDay.from({ month: 1, day: 32, year: 2000 }, { overflow: "reject" }); +>md = Temporal.PlainMonthDay.from({ month: 1, day: 32, year: 2000 }, { overflow: "reject" }) : Temporal.PlainMonthDay +> : ^^^^^^^^^^^^^^^^^^^^^^ +>md : Temporal.PlainMonthDay +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainMonthDay.from({ month: 1, day: 32, year: 2000 }, { overflow: "reject" }) : Temporal.PlainMonthDay +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainMonthDay.from : (item: Temporal.PlainMonthDayLike, options?: Temporal.OverflowOptions) => Temporal.PlainMonthDay +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainMonthDay : Temporal.PlainMonthDayConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>PlainMonthDay : Temporal.PlainMonthDayConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.PlainMonthDayLike, options?: Temporal.OverflowOptions) => Temporal.PlainMonthDay +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ month: 1, day: 32, year: 2000 } : { month: number; day: number; year: number; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>month : number +> : ^^^^^^ +>1 : 1 +> : ^ +>day : number +> : ^^^^^^ +>32 : 32 +> : ^^ +>year : number +> : ^^^^^^ +>2000 : 2000 +> : ^^^^ +>{ overflow: "reject" } : { overflow: "reject"; } +> : ^^^^^^^^^^^^^^^^^^^^^^^ +>overflow : "reject" +> : ^^^^^^^^ +>"reject" : "reject" +> : ^^^^^^^^ + + // => throws + md = Temporal.PlainMonthDay.from({ month: 2, day: 29, year: 2001 }, { overflow: "reject" }); +>md = Temporal.PlainMonthDay.from({ month: 2, day: 29, year: 2001 }, { overflow: "reject" }) : Temporal.PlainMonthDay +> : ^^^^^^^^^^^^^^^^^^^^^^ +>md : Temporal.PlainMonthDay +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainMonthDay.from({ month: 2, day: 29, year: 2001 }, { overflow: "reject" }) : Temporal.PlainMonthDay +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainMonthDay.from : (item: Temporal.PlainMonthDayLike, options?: Temporal.OverflowOptions) => Temporal.PlainMonthDay +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainMonthDay : Temporal.PlainMonthDayConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>PlainMonthDay : Temporal.PlainMonthDayConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.PlainMonthDayLike, options?: Temporal.OverflowOptions) => Temporal.PlainMonthDay +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ month: 2, day: 29, year: 2001 } : { month: number; day: number; year: number; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>month : number +> : ^^^^^^ +>2 : 2 +> : ^ +>day : number +> : ^^^^^^ +>29 : 29 +> : ^^ +>year : number +> : ^^^^^^ +>2001 : 2001 +> : ^^^^ +>{ overflow: "reject" } : { overflow: "reject"; } +> : ^^^^^^^^^^^^^^^^^^^^^^^ +>overflow : "reject" +> : ^^^^^^^^ +>"reject" : "reject" +> : ^^^^^^^^ + + // => throws (this year is not a leap year in the ISO 8601 calendar) + + // non-ISO calendars + md = Temporal.PlainMonthDay.from({ monthCode: "M05L", day: 15, calendar: "hebrew" }); +>md = Temporal.PlainMonthDay.from({ monthCode: "M05L", day: 15, calendar: "hebrew" }) : Temporal.PlainMonthDay +> : ^^^^^^^^^^^^^^^^^^^^^^ +>md : Temporal.PlainMonthDay +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainMonthDay.from({ monthCode: "M05L", day: 15, calendar: "hebrew" }) : Temporal.PlainMonthDay +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainMonthDay.from : (item: Temporal.PlainMonthDayLike, options?: Temporal.OverflowOptions) => Temporal.PlainMonthDay +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainMonthDay : Temporal.PlainMonthDayConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>PlainMonthDay : Temporal.PlainMonthDayConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.PlainMonthDayLike, options?: Temporal.OverflowOptions) => Temporal.PlainMonthDay +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ monthCode: "M05L", day: 15, calendar: "hebrew" } : { monthCode: string; day: number; calendar: string; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>monthCode : string +> : ^^^^^^ +>"M05L" : "M05L" +> : ^^^^^^ +>day : number +> : ^^^^^^ +>15 : 15 +> : ^^ +>calendar : string +> : ^^^^^^ +>"hebrew" : "hebrew" +> : ^^^^^^^^ + + // => 1970-02-21[u-ca=hebrew] + md = Temporal.PlainMonthDay.from({ month: 6, day: 15, year: 5779, calendar: "hebrew" }); +>md = Temporal.PlainMonthDay.from({ month: 6, day: 15, year: 5779, calendar: "hebrew" }) : Temporal.PlainMonthDay +> : ^^^^^^^^^^^^^^^^^^^^^^ +>md : Temporal.PlainMonthDay +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainMonthDay.from({ month: 6, day: 15, year: 5779, calendar: "hebrew" }) : Temporal.PlainMonthDay +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainMonthDay.from : (item: Temporal.PlainMonthDayLike, options?: Temporal.OverflowOptions) => Temporal.PlainMonthDay +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainMonthDay : Temporal.PlainMonthDayConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>PlainMonthDay : Temporal.PlainMonthDayConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.PlainMonthDayLike, options?: Temporal.OverflowOptions) => Temporal.PlainMonthDay +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ month: 6, day: 15, year: 5779, calendar: "hebrew" } : { month: number; day: number; year: number; calendar: string; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>month : number +> : ^^^^^^ +>6 : 6 +> : ^ +>day : number +> : ^^^^^^ +>15 : 15 +> : ^^ +>year : number +> : ^^^^^^ +>5779 : 5779 +> : ^^^^ +>calendar : string +> : ^^^^^^ +>"hebrew" : "hebrew" +> : ^^^^^^^^ + + // => 1970-02-21[u-ca=hebrew] + /* WRONG */ md = Temporal.PlainMonthDay.from({ month: 6, day: 15, calendar: "hebrew" }); +>md = Temporal.PlainMonthDay.from({ month: 6, day: 15, calendar: "hebrew" }) : Temporal.PlainMonthDay +> : ^^^^^^^^^^^^^^^^^^^^^^ +>md : Temporal.PlainMonthDay +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainMonthDay.from({ month: 6, day: 15, calendar: "hebrew" }) : Temporal.PlainMonthDay +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainMonthDay.from : (item: Temporal.PlainMonthDayLike, options?: Temporal.OverflowOptions) => Temporal.PlainMonthDay +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainMonthDay : Temporal.PlainMonthDayConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>PlainMonthDay : Temporal.PlainMonthDayConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.PlainMonthDayLike, options?: Temporal.OverflowOptions) => Temporal.PlainMonthDay +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ month: 6, day: 15, calendar: "hebrew" } : { month: number; day: number; calendar: string; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>month : number +> : ^^^^^^ +>6 : 6 +> : ^ +>day : number +> : ^^^^^^ +>15 : 15 +> : ^^ +>calendar : string +> : ^^^^^^ +>"hebrew" : "hebrew" +> : ^^^^^^^^ + + // => throws (either year or monthCode is required) + md = Temporal.PlainMonthDay.from("2019-02-20[u-ca=hebrew]"); +>md = Temporal.PlainMonthDay.from("2019-02-20[u-ca=hebrew]") : Temporal.PlainMonthDay +> : ^^^^^^^^^^^^^^^^^^^^^^ +>md : Temporal.PlainMonthDay +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainMonthDay.from("2019-02-20[u-ca=hebrew]") : Temporal.PlainMonthDay +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainMonthDay.from : (item: Temporal.PlainMonthDayLike, options?: Temporal.OverflowOptions) => Temporal.PlainMonthDay +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainMonthDay : Temporal.PlainMonthDayConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>PlainMonthDay : Temporal.PlainMonthDayConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.PlainMonthDayLike, options?: Temporal.OverflowOptions) => Temporal.PlainMonthDay +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"2019-02-20[u-ca=hebrew]" : "2019-02-20[u-ca=hebrew]" +> : ^^^^^^^^^^^^^^^^^^^^^^^^^ + + md.monthCode; // => 'M05L' +>md.monthCode : string +> : ^^^^^^ +>md : Temporal.PlainMonthDay +> : ^^^^^^^^^^^^^^^^^^^^^^ +>monthCode : string +> : ^^^^^^ + + md.day; // => 15 +>md.day : number +> : ^^^^^^ +>md : Temporal.PlainMonthDay +> : ^^^^^^^^^^^^^^^^^^^^^^ +>day : number +> : ^^^^^^ + + md.month; // undefined +>md.month : any +> : ^^^ +>md : Temporal.PlainMonthDay +> : ^^^^^^^^^^^^^^^^^^^^^^ +>month : any +> : ^^^ + + // (month property is not present in this type; use monthCode instead) +} + +{ + let md: Temporal.PlainMonthDay; +>md : Temporal.PlainMonthDay +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : any +> : ^^^ + + md = Temporal.PlainMonthDay.from("08-24"); +>md = Temporal.PlainMonthDay.from("08-24") : Temporal.PlainMonthDay +> : ^^^^^^^^^^^^^^^^^^^^^^ +>md : Temporal.PlainMonthDay +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainMonthDay.from("08-24") : Temporal.PlainMonthDay +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainMonthDay.from : (item: Temporal.PlainMonthDayLike, options?: Temporal.OverflowOptions) => Temporal.PlainMonthDay +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainMonthDay : Temporal.PlainMonthDayConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>PlainMonthDay : Temporal.PlainMonthDayConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.PlainMonthDayLike, options?: Temporal.OverflowOptions) => Temporal.PlainMonthDay +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"08-24" : "08-24" +> : ^^^^^^^ + + md.monthCode; // => 'M08' +>md.monthCode : string +> : ^^^^^^ +>md : Temporal.PlainMonthDay +> : ^^^^^^^^^^^^^^^^^^^^^^ +>monthCode : string +> : ^^^^^^ + + md.day; // => 24 +>md.day : number +> : ^^^^^^ +>md : Temporal.PlainMonthDay +> : ^^^^^^^^^^^^^^^^^^^^^^ +>day : number +> : ^^^^^^ + + md.month; // => undefined +>md.month : any +> : ^^^ +>md : Temporal.PlainMonthDay +> : ^^^^^^^^^^^^^^^^^^^^^^ +>month : any +> : ^^^ + + // (no `month` property; use `monthCode` instead) + + md = Temporal.PlainMonthDay.from("2019-02-20[u-ca=hebrew]"); +>md = Temporal.PlainMonthDay.from("2019-02-20[u-ca=hebrew]") : Temporal.PlainMonthDay +> : ^^^^^^^^^^^^^^^^^^^^^^ +>md : Temporal.PlainMonthDay +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainMonthDay.from("2019-02-20[u-ca=hebrew]") : Temporal.PlainMonthDay +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainMonthDay.from : (item: Temporal.PlainMonthDayLike, options?: Temporal.OverflowOptions) => Temporal.PlainMonthDay +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainMonthDay : Temporal.PlainMonthDayConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>PlainMonthDay : Temporal.PlainMonthDayConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.PlainMonthDayLike, options?: Temporal.OverflowOptions) => Temporal.PlainMonthDay +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"2019-02-20[u-ca=hebrew]" : "2019-02-20[u-ca=hebrew]" +> : ^^^^^^^^^^^^^^^^^^^^^^^^^ + + md.monthCode; // => 'M05L' +>md.monthCode : string +> : ^^^^^^ +>md : Temporal.PlainMonthDay +> : ^^^^^^^^^^^^^^^^^^^^^^ +>monthCode : string +> : ^^^^^^ + + md.day; // => 15 +>md.day : number +> : ^^^^^^ +>md : Temporal.PlainMonthDay +> : ^^^^^^^^^^^^^^^^^^^^^^ +>day : number +> : ^^^^^^ + + md.month; // => undefined +>md.month : any +> : ^^^ +>md : Temporal.PlainMonthDay +> : ^^^^^^^^^^^^^^^^^^^^^^ +>month : any +> : ^^^ + + // (no `month` property; use `monthCode` instead) +} + +{ + const md = Temporal.PlainMonthDay.from("11-15"); +>md : Temporal.PlainMonthDay +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainMonthDay.from("11-15") : Temporal.PlainMonthDay +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainMonthDay.from : (item: Temporal.PlainMonthDayLike, options?: Temporal.OverflowOptions) => Temporal.PlainMonthDay +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainMonthDay : Temporal.PlainMonthDayConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>PlainMonthDay : Temporal.PlainMonthDayConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.PlainMonthDayLike, options?: Temporal.OverflowOptions) => Temporal.PlainMonthDay +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"11-15" : "11-15" +> : ^^^^^^^ + + // What's the last day of that month? + md.with({ day: 31 }); // => 11-30 +>md.with({ day: 31 }) : Temporal.PlainMonthDay +> : ^^^^^^^^^^^^^^^^^^^^^^ +>md.with : (monthDayLike: Temporal.PartialTemporalLike, options?: Temporal.OverflowOptions) => Temporal.PlainMonthDay +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>md : Temporal.PlainMonthDay +> : ^^^^^^^^^^^^^^^^^^^^^^ +>with : (monthDayLike: Temporal.PartialTemporalLike, options?: Temporal.OverflowOptions) => Temporal.PlainMonthDay +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ day: 31 } : { day: number; } +> : ^^^^^^^^^^^^^^^^ +>day : number +> : ^^^^^^ +>31 : 31 +> : ^^ + + Temporal.PlainMonthDay.from("02-01").with({ day: 31 }); // => 02-29 +>Temporal.PlainMonthDay.from("02-01").with({ day: 31 }) : Temporal.PlainMonthDay +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainMonthDay.from("02-01").with : (monthDayLike: Temporal.PartialTemporalLike, options?: Temporal.OverflowOptions) => Temporal.PlainMonthDay +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainMonthDay.from("02-01") : Temporal.PlainMonthDay +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainMonthDay.from : (item: Temporal.PlainMonthDayLike, options?: Temporal.OverflowOptions) => Temporal.PlainMonthDay +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainMonthDay : Temporal.PlainMonthDayConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>PlainMonthDay : Temporal.PlainMonthDayConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.PlainMonthDayLike, options?: Temporal.OverflowOptions) => Temporal.PlainMonthDay +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"02-01" : "02-01" +> : ^^^^^^^ +>with : (monthDayLike: Temporal.PartialTemporalLike, options?: Temporal.OverflowOptions) => Temporal.PlainMonthDay +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ day: 31 } : { day: number; } +> : ^^^^^^^^^^^^^^^^ +>day : number +> : ^^^^^^ +>31 : 31 +> : ^^ +} + +{ + const md1 = Temporal.PlainMonthDay.from("02-28"); +>md1 : Temporal.PlainMonthDay +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainMonthDay.from("02-28") : Temporal.PlainMonthDay +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainMonthDay.from : (item: Temporal.PlainMonthDayLike, options?: Temporal.OverflowOptions) => Temporal.PlainMonthDay +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainMonthDay : Temporal.PlainMonthDayConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>PlainMonthDay : Temporal.PlainMonthDayConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.PlainMonthDayLike, options?: Temporal.OverflowOptions) => Temporal.PlainMonthDay +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"02-28" : "02-28" +> : ^^^^^^^ + + const md2 = Temporal.PlainMonthDay.from("02-29"); +>md2 : Temporal.PlainMonthDay +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainMonthDay.from("02-29") : Temporal.PlainMonthDay +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainMonthDay.from : (item: Temporal.PlainMonthDayLike, options?: Temporal.OverflowOptions) => Temporal.PlainMonthDay +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainMonthDay : Temporal.PlainMonthDayConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>PlainMonthDay : Temporal.PlainMonthDayConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.PlainMonthDayLike, options?: Temporal.OverflowOptions) => Temporal.PlainMonthDay +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"02-29" : "02-29" +> : ^^^^^^^ + + md1.equals(md2); // => false +>md1.equals(md2) : boolean +> : ^^^^^^^ +>md1.equals : (other: Temporal.PlainMonthDayLike) => boolean +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>md1 : Temporal.PlainMonthDay +> : ^^^^^^^^^^^^^^^^^^^^^^ +>equals : (other: Temporal.PlainMonthDayLike) => boolean +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>md2 : Temporal.PlainMonthDay +> : ^^^^^^^^^^^^^^^^^^^^^^ + + md1.equals("02-29"); // => false +>md1.equals("02-29") : boolean +> : ^^^^^^^ +>md1.equals : (other: Temporal.PlainMonthDayLike) => boolean +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>md1 : Temporal.PlainMonthDay +> : ^^^^^^^^^^^^^^^^^^^^^^ +>equals : (other: Temporal.PlainMonthDayLike) => boolean +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"02-29" : "02-29" +> : ^^^^^^^ + + md1.equals({ monthCode: "M02", day: 29 }); // => false +>md1.equals({ monthCode: "M02", day: 29 }) : boolean +> : ^^^^^^^ +>md1.equals : (other: Temporal.PlainMonthDayLike) => boolean +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>md1 : Temporal.PlainMonthDay +> : ^^^^^^^^^^^^^^^^^^^^^^ +>equals : (other: Temporal.PlainMonthDayLike) => boolean +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ monthCode: "M02", day: 29 } : { monthCode: string; day: number; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>monthCode : string +> : ^^^^^^ +>"M02" : "M02" +> : ^^^^^ +>day : number +> : ^^^^^^ +>29 : 29 +> : ^^ + + md2.equals(md2); // => true +>md2.equals(md2) : boolean +> : ^^^^^^^ +>md2.equals : (other: Temporal.PlainMonthDayLike) => boolean +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>md2 : Temporal.PlainMonthDay +> : ^^^^^^^^^^^^^^^^^^^^^^ +>equals : (other: Temporal.PlainMonthDayLike) => boolean +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>md2 : Temporal.PlainMonthDay +> : ^^^^^^^^^^^^^^^^^^^^^^ + + md2.equals("02-29"); // => true +>md2.equals("02-29") : boolean +> : ^^^^^^^ +>md2.equals : (other: Temporal.PlainMonthDayLike) => boolean +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>md2 : Temporal.PlainMonthDay +> : ^^^^^^^^^^^^^^^^^^^^^^ +>equals : (other: Temporal.PlainMonthDayLike) => boolean +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"02-29" : "02-29" +> : ^^^^^^^ + + md2.equals({ monthCode: "M02", day: 29 }); // => true +>md2.equals({ monthCode: "M02", day: 29 }) : boolean +> : ^^^^^^^ +>md2.equals : (other: Temporal.PlainMonthDayLike) => boolean +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>md2 : Temporal.PlainMonthDay +> : ^^^^^^^^^^^^^^^^^^^^^^ +>equals : (other: Temporal.PlainMonthDayLike) => boolean +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ monthCode: "M02", day: 29 } : { monthCode: string; day: number; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>monthCode : string +> : ^^^^^^ +>"M02" : "M02" +> : ^^^^^ +>day : number +> : ^^^^^^ +>29 : 29 +> : ^^ +} + +{ + const md = Temporal.PlainMonthDay.from("08-24"); +>md : Temporal.PlainMonthDay +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainMonthDay.from("08-24") : Temporal.PlainMonthDay +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainMonthDay.from : (item: Temporal.PlainMonthDayLike, options?: Temporal.OverflowOptions) => Temporal.PlainMonthDay +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainMonthDay : Temporal.PlainMonthDayConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>PlainMonthDay : Temporal.PlainMonthDayConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.PlainMonthDayLike, options?: Temporal.OverflowOptions) => Temporal.PlainMonthDay +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"08-24" : "08-24" +> : ^^^^^^^ + + md.toString(); // => '08-24' +>md.toString() : string +> : ^^^^^^ +>md.toString : (options?: Temporal.PlainDateToStringOptions) => string +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>md : Temporal.PlainMonthDay +> : ^^^^^^^^^^^^^^^^^^^^^^ +>toString : (options?: Temporal.PlainDateToStringOptions) => string +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +} + +{ + const { calendar } = new Intl.DateTimeFormat().resolvedOptions(); +>calendar : string +> : ^^^^^^ +>new Intl.DateTimeFormat().resolvedOptions() : Intl.ResolvedDateTimeFormatOptions +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>new Intl.DateTimeFormat().resolvedOptions : () => Intl.ResolvedDateTimeFormatOptions +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>new Intl.DateTimeFormat() : Intl.DateTimeFormat +> : ^^^^^^^^^^^^^^^^^^^ +>Intl.DateTimeFormat : Intl.DateTimeFormatConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Intl : typeof Intl +> : ^^^^^^^^^^^ +>DateTimeFormat : Intl.DateTimeFormatConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>resolvedOptions : () => Intl.ResolvedDateTimeFormatOptions +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + const md = Temporal.PlainMonthDay.from({ monthCode: "M08", day: 24, calendar }); +>md : Temporal.PlainMonthDay +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainMonthDay.from({ monthCode: "M08", day: 24, calendar }) : Temporal.PlainMonthDay +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainMonthDay.from : (item: Temporal.PlainMonthDayLike, options?: Temporal.OverflowOptions) => Temporal.PlainMonthDay +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainMonthDay : Temporal.PlainMonthDayConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>PlainMonthDay : Temporal.PlainMonthDayConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.PlainMonthDayLike, options?: Temporal.OverflowOptions) => Temporal.PlainMonthDay +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ monthCode: "M08", day: 24, calendar } : { monthCode: string; day: number; calendar: string; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>monthCode : string +> : ^^^^^^ +>"M08" : "M08" +> : ^^^^^ +>day : number +> : ^^^^^^ +>24 : 24 +> : ^^ +>calendar : string +> : ^^^^^^ + + md.toLocaleString(); // example output: '8/24' +>md.toLocaleString() : string +> : ^^^^^^ +>md.toLocaleString : (locales?: Intl.LocalesArgument, options?: Intl.DateTimeFormatOptions) => string +> : ^ ^^^ ^^ ^^^ ^^^^^ +>md : Temporal.PlainMonthDay +> : ^^^^^^^^^^^^^^^^^^^^^^ +>toLocaleString : (locales?: Intl.LocalesArgument, options?: Intl.DateTimeFormatOptions) => string +> : ^ ^^^ ^^ ^^^ ^^^^^ + + // Same as above, but explicitly specifying the calendar: + md.toLocaleString(undefined, { calendar }); // example output: '8/24' +>md.toLocaleString(undefined, { calendar }) : string +> : ^^^^^^ +>md.toLocaleString : (locales?: Intl.LocalesArgument, options?: Intl.DateTimeFormatOptions) => string +> : ^ ^^^ ^^ ^^^ ^^^^^ +>md : Temporal.PlainMonthDay +> : ^^^^^^^^^^^^^^^^^^^^^^ +>toLocaleString : (locales?: Intl.LocalesArgument, options?: Intl.DateTimeFormatOptions) => string +> : ^ ^^^ ^^ ^^^ ^^^^^ +>undefined : undefined +> : ^^^^^^^^^ +>{ calendar } : { calendar: string; } +> : ^^^^^^^^^^^^^^^^^^^^^ +>calendar : string +> : ^^^^^^ + + md.toLocaleString("de-DE", { calendar }); // => '24.8.' +>md.toLocaleString("de-DE", { calendar }) : string +> : ^^^^^^ +>md.toLocaleString : (locales?: Intl.LocalesArgument, options?: Intl.DateTimeFormatOptions) => string +> : ^ ^^^ ^^ ^^^ ^^^^^ +>md : Temporal.PlainMonthDay +> : ^^^^^^^^^^^^^^^^^^^^^^ +>toLocaleString : (locales?: Intl.LocalesArgument, options?: Intl.DateTimeFormatOptions) => string +> : ^ ^^^ ^^ ^^^ ^^^^^ +>"de-DE" : "de-DE" +> : ^^^^^^^ +>{ calendar } : { calendar: string; } +> : ^^^^^^^^^^^^^^^^^^^^^ +>calendar : string +> : ^^^^^^ + + md.toLocaleString("de-DE", { month: "long", day: "numeric", calendar }); // => '24. August' +>md.toLocaleString("de-DE", { month: "long", day: "numeric", calendar }) : string +> : ^^^^^^ +>md.toLocaleString : (locales?: Intl.LocalesArgument, options?: Intl.DateTimeFormatOptions) => string +> : ^ ^^^ ^^ ^^^ ^^^^^ +>md : Temporal.PlainMonthDay +> : ^^^^^^^^^^^^^^^^^^^^^^ +>toLocaleString : (locales?: Intl.LocalesArgument, options?: Intl.DateTimeFormatOptions) => string +> : ^ ^^^ ^^ ^^^ ^^^^^ +>"de-DE" : "de-DE" +> : ^^^^^^^ +>{ month: "long", day: "numeric", calendar } : { month: "long"; day: "numeric"; calendar: string; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>month : "long" +> : ^^^^^^ +>"long" : "long" +> : ^^^^^^ +>day : "numeric" +> : ^^^^^^^^^ +>"numeric" : "numeric" +> : ^^^^^^^^^ +>calendar : string +> : ^^^^^^ + + md.toLocaleString(`en-US-u-nu-fullwide-ca-${calendar}`); // => '8/24' +>md.toLocaleString(`en-US-u-nu-fullwide-ca-${calendar}`) : string +> : ^^^^^^ +>md.toLocaleString : (locales?: Intl.LocalesArgument, options?: Intl.DateTimeFormatOptions) => string +> : ^ ^^^ ^^ ^^^ ^^^^^ +>md : Temporal.PlainMonthDay +> : ^^^^^^^^^^^^^^^^^^^^^^ +>toLocaleString : (locales?: Intl.LocalesArgument, options?: Intl.DateTimeFormatOptions) => string +> : ^ ^^^ ^^ ^^^ ^^^^^ +>`en-US-u-nu-fullwide-ca-${calendar}` : string +> : ^^^^^^ +>calendar : string +> : ^^^^^^ +} + +{ + const md = Temporal.PlainMonthDay.from({ +>md : Temporal.PlainMonthDay +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainMonthDay.from({ calendar: "japanese", monthCode: "M01", day: 1, }) : Temporal.PlainMonthDay +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainMonthDay.from : (item: Temporal.PlainMonthDayLike, options?: Temporal.OverflowOptions) => Temporal.PlainMonthDay +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainMonthDay : Temporal.PlainMonthDayConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>PlainMonthDay : Temporal.PlainMonthDayConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.PlainMonthDayLike, options?: Temporal.OverflowOptions) => Temporal.PlainMonthDay +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ calendar: "japanese", monthCode: "M01", day: 1, } : { calendar: string; monthCode: string; day: number; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + calendar: "japanese", +>calendar : string +> : ^^^^^^ +>"japanese" : "japanese" +> : ^^^^^^^^^^ + + monthCode: "M01", +>monthCode : string +> : ^^^^^^ +>"M01" : "M01" +> : ^^^^^ + + day: 1, +>day : number +> : ^^^^^^ +>1 : 1 +> : ^ + + }); + + const date = md.toPlainDate({ era: "reiwa", eraYear: 2 }); // => 2020-01-01[u-ca=japanese] +>date : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>md.toPlainDate({ era: "reiwa", eraYear: 2 }) : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>md.toPlainDate : (item: Temporal.PlainMonthDayToPlainDateOptions) => Temporal.PlainDate +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>md : Temporal.PlainMonthDay +> : ^^^^^^^^^^^^^^^^^^^^^^ +>toPlainDate : (item: Temporal.PlainMonthDayToPlainDateOptions) => Temporal.PlainDate +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ era: "reiwa", eraYear: 2 } : { era: string; eraYear: number; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>era : string +> : ^^^^^^ +>"reiwa" : "reiwa" +> : ^^^^^^^ +>eraYear : number +> : ^^^^^^ +>2 : 2 +> : ^ +} + +{ + new Temporal.Duration(1, 2, 3, 4, 5, 6, 7, 987, 654, 321); // => P1Y2M3W4DT5H6M7.987654321S +>new Temporal.Duration(1, 2, 3, 4, 5, 6, 7, 987, 654, 321) : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>Temporal.Duration : Temporal.DurationConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>Duration : Temporal.DurationConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>1 : 1 +> : ^ +>2 : 2 +> : ^ +>3 : 3 +> : ^ +>4 : 4 +> : ^ +>5 : 5 +> : ^ +>6 : 6 +> : ^ +>7 : 7 +> : ^ +>987 : 987 +> : ^^^ +>654 : 654 +> : ^^^ +>321 : 321 +> : ^^^ + + new Temporal.Duration(0, 0, 0, 40); // => P40D +>new Temporal.Duration(0, 0, 0, 40) : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>Temporal.Duration : Temporal.DurationConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>Duration : Temporal.DurationConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>0 : 0 +> : ^ +>0 : 0 +> : ^ +>0 : 0 +> : ^ +>40 : 40 +> : ^^ + + new Temporal.Duration(undefined, undefined, undefined, 40); // => P40D +>new Temporal.Duration(undefined, undefined, undefined, 40) : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>Temporal.Duration : Temporal.DurationConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>Duration : Temporal.DurationConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>undefined : undefined +> : ^^^^^^^^^ +>undefined : undefined +> : ^^^^^^^^^ +>undefined : undefined +> : ^^^^^^^^^ +>40 : 40 +> : ^^ + + new Temporal.Duration(); // => PT0S +>new Temporal.Duration() : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>Temporal.Duration : Temporal.DurationConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>Duration : Temporal.DurationConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +} + +{ + let d: Temporal.Duration; +>d : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>Temporal : any +> : ^^^ + + d = Temporal.Duration.from({ years: 1, days: 1 }); // => P1Y1D +>d = Temporal.Duration.from({ years: 1, days: 1 }) : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>d : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>Temporal.Duration.from({ years: 1, days: 1 }) : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>Temporal.Duration.from : (item: Temporal.DurationLike) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.Duration : Temporal.DurationConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>Duration : Temporal.DurationConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.DurationLike) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ years: 1, days: 1 } : { years: number; days: number; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>years : number +> : ^^^^^^ +>1 : 1 +> : ^ +>days : number +> : ^^^^^^ +>1 : 1 +> : ^ + + d = Temporal.Duration.from({ days: -2, hours: -12 }); // => -P2DT12H +>d = Temporal.Duration.from({ days: -2, hours: -12 }) : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>d : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>Temporal.Duration.from({ days: -2, hours: -12 }) : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>Temporal.Duration.from : (item: Temporal.DurationLike) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.Duration : Temporal.DurationConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>Duration : Temporal.DurationConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.DurationLike) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ days: -2, hours: -12 } : { days: number; hours: number; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>days : number +> : ^^^^^^ +>-2 : -2 +> : ^^ +>2 : 2 +> : ^ +>hours : number +> : ^^^^^^ +>-12 : -12 +> : ^^^ +>12 : 12 +> : ^^ + + Temporal.Duration.from(d) === d; // => false +>Temporal.Duration.from(d) === d : boolean +> : ^^^^^^^ +>Temporal.Duration.from(d) : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>Temporal.Duration.from : (item: Temporal.DurationLike) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.Duration : Temporal.DurationConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>Duration : Temporal.DurationConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.DurationLike) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>d : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>d : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ + + d = Temporal.Duration.from("P1Y1D"); // => P1Y1D +>d = Temporal.Duration.from("P1Y1D") : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>d : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>Temporal.Duration.from("P1Y1D") : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>Temporal.Duration.from : (item: Temporal.DurationLike) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.Duration : Temporal.DurationConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>Duration : Temporal.DurationConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.DurationLike) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"P1Y1D" : "P1Y1D" +> : ^^^^^^^ + + d = Temporal.Duration.from("-P2DT12H"); // => -P2DT12H +>d = Temporal.Duration.from("-P2DT12H") : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>d : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>Temporal.Duration.from("-P2DT12H") : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>Temporal.Duration.from : (item: Temporal.DurationLike) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.Duration : Temporal.DurationConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>Duration : Temporal.DurationConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.DurationLike) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"-P2DT12H" : "-P2DT12H" +> : ^^^^^^^^^^ + + d = Temporal.Duration.from("P0D"); // => PT0S +>d = Temporal.Duration.from("P0D") : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>d : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>Temporal.Duration.from("P0D") : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>Temporal.Duration.from : (item: Temporal.DurationLike) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.Duration : Temporal.DurationConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>Duration : Temporal.DurationConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.DurationLike) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"P0D" : "P0D" +> : ^^^^^ +} + +{ + const one = Temporal.Duration.from({ hours: 79, minutes: 10 }); +>one : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>Temporal.Duration.from({ hours: 79, minutes: 10 }) : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>Temporal.Duration.from : (item: Temporal.DurationLike) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.Duration : Temporal.DurationConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>Duration : Temporal.DurationConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.DurationLike) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ hours: 79, minutes: 10 } : { hours: number; minutes: number; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>hours : number +> : ^^^^^^ +>79 : 79 +> : ^^ +>minutes : number +> : ^^^^^^ +>10 : 10 +> : ^^ + + const two = Temporal.Duration.from({ days: 3, hours: 7, seconds: 630 }); +>two : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>Temporal.Duration.from({ days: 3, hours: 7, seconds: 630 }) : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>Temporal.Duration.from : (item: Temporal.DurationLike) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.Duration : Temporal.DurationConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>Duration : Temporal.DurationConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.DurationLike) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ days: 3, hours: 7, seconds: 630 } : { days: number; hours: number; seconds: number; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>days : number +> : ^^^^^^ +>3 : 3 +> : ^ +>hours : number +> : ^^^^^^ +>7 : 7 +> : ^ +>seconds : number +> : ^^^^^^ +>630 : 630 +> : ^^^ + + const three = Temporal.Duration.from({ days: 3, hours: 6, minutes: 50 }); +>three : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>Temporal.Duration.from({ days: 3, hours: 6, minutes: 50 }) : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>Temporal.Duration.from : (item: Temporal.DurationLike) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.Duration : Temporal.DurationConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>Duration : Temporal.DurationConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.DurationLike) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ days: 3, hours: 6, minutes: 50 } : { days: number; hours: number; minutes: number; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>days : number +> : ^^^^^^ +>3 : 3 +> : ^ +>hours : number +> : ^^^^^^ +>6 : 6 +> : ^ +>minutes : number +> : ^^^^^^ +>50 : 50 +> : ^^ + + const sorted1 = [one, two, three].sort(Temporal.Duration.compare); +>sorted1 : Temporal.Duration[] +> : ^^^^^^^^^^^^^^^^^^^ +>[one, two, three].sort(Temporal.Duration.compare) : Temporal.Duration[] +> : ^^^^^^^^^^^^^^^^^^^ +>[one, two, three].sort : (compareFn?: ((a: Temporal.Duration, b: Temporal.Duration) => number) | undefined) => Temporal.Duration[] +> : ^ ^^^^^ ^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>[one, two, three] : Temporal.Duration[] +> : ^^^^^^^^^^^^^^^^^^^ +>one : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>two : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>three : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>sort : (compareFn?: ((a: Temporal.Duration, b: Temporal.Duration) => number) | undefined) => Temporal.Duration[] +> : ^ ^^^^^ ^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.Duration.compare : (one: Temporal.DurationLike, two: Temporal.DurationLike, options?: Temporal.DurationRelativeToOptions) => number +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.Duration : Temporal.DurationConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>Duration : Temporal.DurationConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>compare : (one: Temporal.DurationLike, two: Temporal.DurationLike, options?: Temporal.DurationRelativeToOptions) => number +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + sorted1.join(" "); +>sorted1.join(" ") : string +> : ^^^^^^ +>sorted1.join : (separator?: string) => string +> : ^ ^^^ ^^^^^ +>sorted1 : Temporal.Duration[] +> : ^^^^^^^^^^^^^^^^^^^ +>join : (separator?: string) => string +> : ^ ^^^ ^^^^^ +>" " : " " +> : ^^^ + + // => 'P3DT6H50M PT79H10M P3DT7H630S' + + // Sorting relative to a date, taking DST changes into account: + const relativeTo = Temporal.ZonedDateTime.from("2020-11-01T00:00-07:00[America/Los_Angeles]"); +>relativeTo : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.ZonedDateTime.from("2020-11-01T00:00-07:00[America/Los_Angeles]") : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.ZonedDateTime.from : (item: Temporal.ZonedDateTimeLike, options?: Temporal.ZonedDateTimeFromOptions) => Temporal.ZonedDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.ZonedDateTime : Temporal.ZonedDateTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>ZonedDateTime : Temporal.ZonedDateTimeConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.ZonedDateTimeLike, options?: Temporal.ZonedDateTimeFromOptions) => Temporal.ZonedDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"2020-11-01T00:00-07:00[America/Los_Angeles]" : "2020-11-01T00:00-07:00[America/Los_Angeles]" +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + const sorted2 = [one, two, three].sort((one, two) => Temporal.Duration.compare(one, two, { relativeTo })); +>sorted2 : Temporal.Duration[] +> : ^^^^^^^^^^^^^^^^^^^ +>[one, two, three].sort((one, two) => Temporal.Duration.compare(one, two, { relativeTo })) : Temporal.Duration[] +> : ^^^^^^^^^^^^^^^^^^^ +>[one, two, three].sort : (compareFn?: ((a: Temporal.Duration, b: Temporal.Duration) => number) | undefined) => Temporal.Duration[] +> : ^ ^^^^^ ^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>[one, two, three] : Temporal.Duration[] +> : ^^^^^^^^^^^^^^^^^^^ +>one : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>two : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>three : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>sort : (compareFn?: ((a: Temporal.Duration, b: Temporal.Duration) => number) | undefined) => Temporal.Duration[] +> : ^ ^^^^^ ^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>(one, two) => Temporal.Duration.compare(one, two, { relativeTo }) : (one: Temporal.Duration, two: Temporal.Duration) => number +> : ^ ^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>one : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>two : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>Temporal.Duration.compare(one, two, { relativeTo }) : number +> : ^^^^^^ +>Temporal.Duration.compare : (one: Temporal.DurationLike, two: Temporal.DurationLike, options?: Temporal.DurationRelativeToOptions) => number +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.Duration : Temporal.DurationConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>Duration : Temporal.DurationConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>compare : (one: Temporal.DurationLike, two: Temporal.DurationLike, options?: Temporal.DurationRelativeToOptions) => number +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>one : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>two : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>{ relativeTo } : { relativeTo: Temporal.ZonedDateTime; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>relativeTo : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ + + sorted2.join(" "); +>sorted2.join(" ") : string +> : ^^^^^^ +>sorted2.join : (separator?: string) => string +> : ^ ^^^ ^^^^^ +>sorted2 : Temporal.Duration[] +> : ^^^^^^^^^^^^^^^^^^^ +>join : (separator?: string) => string +> : ^ ^^^ ^^^^^ +>" " : " " +> : ^^^ + + // => 'PT79H10M P3DT6H50M P3DT7H630S' +} + +{ + const d = Temporal.Duration.from("P1Y2M3W4DT5H6M7.987654321S"); +>d : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>Temporal.Duration.from("P1Y2M3W4DT5H6M7.987654321S") : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>Temporal.Duration.from : (item: Temporal.DurationLike) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.Duration : Temporal.DurationConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>Duration : Temporal.DurationConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.DurationLike) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"P1Y2M3W4DT5H6M7.987654321S" : "P1Y2M3W4DT5H6M7.987654321S" +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + d.years; // => 1 +>d.years : number +> : ^^^^^^ +>d : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>years : number +> : ^^^^^^ + + d.months; // => 2 +>d.months : number +> : ^^^^^^ +>d : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>months : number +> : ^^^^^^ + + d.weeks; // => 3 +>d.weeks : number +> : ^^^^^^ +>d : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>weeks : number +> : ^^^^^^ + + d.days; // => 4 +>d.days : number +> : ^^^^^^ +>d : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>days : number +> : ^^^^^^ + + d.hours; // => 5 +>d.hours : number +> : ^^^^^^ +>d : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>hours : number +> : ^^^^^^ + + d.minutes; // => 6 +>d.minutes : number +> : ^^^^^^ +>d : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>minutes : number +> : ^^^^^^ + + d.seconds; // => 7 +>d.seconds : number +> : ^^^^^^ +>d : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>seconds : number +> : ^^^^^^ + + d.milliseconds; // => 987 +>d.milliseconds : number +> : ^^^^^^ +>d : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>milliseconds : number +> : ^^^^^^ + + d.microseconds; // => 654 +>d.microseconds : number +> : ^^^^^^ +>d : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>microseconds : number +> : ^^^^^^ + + d.nanoseconds; // => 321 +>d.nanoseconds : number +> : ^^^^^^ +>d : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>nanoseconds : number +> : ^^^^^^ +} + +{ + let d: Temporal.Duration; +>d : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>Temporal : any +> : ^^^ + + d = Temporal.Duration.from("PT0S"); +>d = Temporal.Duration.from("PT0S") : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>d : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>Temporal.Duration.from("PT0S") : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>Temporal.Duration.from : (item: Temporal.DurationLike) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.Duration : Temporal.DurationConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>Duration : Temporal.DurationConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.DurationLike) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"PT0S" : "PT0S" +> : ^^^^^^ + + d.blank; // => true +>d.blank : boolean +> : ^^^^^^^ +>d : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>blank : boolean +> : ^^^^^^^ + + d = Temporal.Duration.from({ days: 0, hours: 0, minutes: 0 }); +>d = Temporal.Duration.from({ days: 0, hours: 0, minutes: 0 }) : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>d : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>Temporal.Duration.from({ days: 0, hours: 0, minutes: 0 }) : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>Temporal.Duration.from : (item: Temporal.DurationLike) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.Duration : Temporal.DurationConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>Duration : Temporal.DurationConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.DurationLike) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ days: 0, hours: 0, minutes: 0 } : { days: number; hours: number; minutes: number; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>days : number +> : ^^^^^^ +>0 : 0 +> : ^ +>hours : number +> : ^^^^^^ +>0 : 0 +> : ^ +>minutes : number +> : ^^^^^^ +>0 : 0 +> : ^ + + d.blank; // => true +>d.blank : boolean +> : ^^^^^^^ +>d : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>blank : boolean +> : ^^^^^^^ +} + +{ + let duration: Temporal.Duration; +>duration : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>Temporal : any +> : ^^^ + + duration = Temporal.Duration.from({ months: 50, days: 50, hours: 50, minutes: 100 }); +>duration = Temporal.Duration.from({ months: 50, days: 50, hours: 50, minutes: 100 }) : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>duration : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>Temporal.Duration.from({ months: 50, days: 50, hours: 50, minutes: 100 }) : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>Temporal.Duration.from : (item: Temporal.DurationLike) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.Duration : Temporal.DurationConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>Duration : Temporal.DurationConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.DurationLike) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ months: 50, days: 50, hours: 50, minutes: 100 } : { months: number; days: number; hours: number; minutes: number; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>months : number +> : ^^^^^^ +>50 : 50 +> : ^^ +>days : number +> : ^^^^^^ +>50 : 50 +> : ^^ +>hours : number +> : ^^^^^^ +>50 : 50 +> : ^^ +>minutes : number +> : ^^^^^^ +>100 : 100 +> : ^^^ + + // Perform a balance operation using additional ISO 8601 calendar rules: + let { years, months } = duration; +>years : number +> : ^^^^^^ +>months : number +> : ^^^^^^ +>duration : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ + + years += Math.floor(months / 12); +>years += Math.floor(months / 12) : number +> : ^^^^^^ +>years : number +> : ^^^^^^ +>Math.floor(months / 12) : number +> : ^^^^^^ +>Math.floor : (x: number) => number +> : ^ ^^ ^^^^^ +>Math : Math +> : ^^^^ +>floor : (x: number) => number +> : ^ ^^ ^^^^^ +>months / 12 : number +> : ^^^^^^ +>months : number +> : ^^^^^^ +>12 : 12 +> : ^^ + + months %= 12; +>months %= 12 : number +> : ^^^^^^ +>months : number +> : ^^^^^^ +>12 : 12 +> : ^^ + + duration = duration.with({ years, months }); +>duration = duration.with({ years, months }) : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>duration : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>duration.with({ years, months }) : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>duration.with : (durationLike: Temporal.PartialTemporalLike) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^ +>duration : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>with : (durationLike: Temporal.PartialTemporalLike) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^ +>{ years, months } : { years: number; months: number; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>years : number +> : ^^^^^^ +>months : number +> : ^^^^^^ + + // => P4Y2M50DT50H100M +} + +{ + const hour = Temporal.Duration.from("PT1H"); +>hour : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>Temporal.Duration.from("PT1H") : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>Temporal.Duration.from : (item: Temporal.DurationLike) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.Duration : Temporal.DurationConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>Duration : Temporal.DurationConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.DurationLike) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"PT1H" : "PT1H" +> : ^^^^^^ + + hour.add({ minutes: 30 }); // => PT1H30M +>hour.add({ minutes: 30 }) : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>hour.add : (other: Temporal.DurationLike) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>hour : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>add : (other: Temporal.DurationLike) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ minutes: 30 } : { minutes: number; } +> : ^^^^^^^^^^^^^^^^^^^^ +>minutes : number +> : ^^^^^^ +>30 : 30 +> : ^^ + + // Examples of balancing: + const one = Temporal.Duration.from({ hours: 1, minutes: 30 }); +>one : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>Temporal.Duration.from({ hours: 1, minutes: 30 }) : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>Temporal.Duration.from : (item: Temporal.DurationLike) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.Duration : Temporal.DurationConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>Duration : Temporal.DurationConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.DurationLike) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ hours: 1, minutes: 30 } : { hours: number; minutes: number; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>hours : number +> : ^^^^^^ +>1 : 1 +> : ^ +>minutes : number +> : ^^^^^^ +>30 : 30 +> : ^^ + + const two = Temporal.Duration.from({ hours: 2, minutes: 45 }); +>two : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>Temporal.Duration.from({ hours: 2, minutes: 45 }) : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>Temporal.Duration.from : (item: Temporal.DurationLike) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.Duration : Temporal.DurationConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>Duration : Temporal.DurationConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.DurationLike) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ hours: 2, minutes: 45 } : { hours: number; minutes: number; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>hours : number +> : ^^^^^^ +>2 : 2 +> : ^ +>minutes : number +> : ^^^^^^ +>45 : 45 +> : ^^ + + const result = one.add(two); // => PT4H15M +>result : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>one.add(two) : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>one.add : (other: Temporal.DurationLike) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>one : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>add : (other: Temporal.DurationLike) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>two : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ + + // Example of adding calendar units + const oneAndAHalfMonth = Temporal.Duration.from({ months: 1, days: 16 }); +>oneAndAHalfMonth : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>Temporal.Duration.from({ months: 1, days: 16 }) : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>Temporal.Duration.from : (item: Temporal.DurationLike) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.Duration : Temporal.DurationConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>Duration : Temporal.DurationConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.DurationLike) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ months: 1, days: 16 } : { months: number; days: number; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>months : number +> : ^^^^^^ +>1 : 1 +> : ^ +>days : number +> : ^^^^^^ +>16 : 16 +> : ^^ + + // To convert units, use arithmetic relative to a start date: + const startDate1 = Temporal.PlainDate.from("2000-12-01"); +>startDate1 : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDate.from("2000-12-01") : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDate.from : (item: Temporal.PlainDateLike, options?: Temporal.OverflowOptions) => Temporal.PlainDate +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDate : Temporal.PlainDateConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>PlainDate : Temporal.PlainDateConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.PlainDateLike, options?: Temporal.OverflowOptions) => Temporal.PlainDate +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"2000-12-01" : "2000-12-01" +> : ^^^^^^^^^^^^ + + startDate1.add(oneAndAHalfMonth).add(oneAndAHalfMonth) +>startDate1.add(oneAndAHalfMonth).add(oneAndAHalfMonth) .since(startDate1, { largestUnit: "months" }) : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>startDate1.add(oneAndAHalfMonth).add(oneAndAHalfMonth) .since : (other: Temporal.PlainDateLike, options?: Temporal.RoundingOptionsWithLargestUnit) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^ +>startDate1.add(oneAndAHalfMonth).add(oneAndAHalfMonth) : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>startDate1.add(oneAndAHalfMonth).add : (duration: Temporal.DurationLike, options?: Temporal.OverflowOptions) => Temporal.PlainDate +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>startDate1.add(oneAndAHalfMonth) : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>startDate1.add : (duration: Temporal.DurationLike, options?: Temporal.OverflowOptions) => Temporal.PlainDate +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>startDate1 : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>add : (duration: Temporal.DurationLike, options?: Temporal.OverflowOptions) => Temporal.PlainDate +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>oneAndAHalfMonth : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>add : (duration: Temporal.DurationLike, options?: Temporal.OverflowOptions) => Temporal.PlainDate +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>oneAndAHalfMonth : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ + + .since(startDate1, { largestUnit: "months" }); // => P3M4D +>since : (other: Temporal.PlainDateLike, options?: Temporal.RoundingOptionsWithLargestUnit) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^ +>startDate1 : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>{ largestUnit: "months" } : { largestUnit: "months"; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^ +>largestUnit : "months" +> : ^^^^^^^^ +>"months" : "months" +> : ^^^^^^^^ + + const startDate2 = Temporal.PlainDate.from("2001-01-01"); +>startDate2 : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDate.from("2001-01-01") : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDate.from : (item: Temporal.PlainDateLike, options?: Temporal.OverflowOptions) => Temporal.PlainDate +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDate : Temporal.PlainDateConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>PlainDate : Temporal.PlainDateConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.PlainDateLike, options?: Temporal.OverflowOptions) => Temporal.PlainDate +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"2001-01-01" : "2001-01-01" +> : ^^^^^^^^^^^^ + + startDate2.add(oneAndAHalfMonth).add(oneAndAHalfMonth) +>startDate2.add(oneAndAHalfMonth).add(oneAndAHalfMonth) .since(startDate2, { largestUnit: "months" }) : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>startDate2.add(oneAndAHalfMonth).add(oneAndAHalfMonth) .since : (other: Temporal.PlainDateLike, options?: Temporal.RoundingOptionsWithLargestUnit) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^ +>startDate2.add(oneAndAHalfMonth).add(oneAndAHalfMonth) : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>startDate2.add(oneAndAHalfMonth).add : (duration: Temporal.DurationLike, options?: Temporal.OverflowOptions) => Temporal.PlainDate +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>startDate2.add(oneAndAHalfMonth) : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>startDate2.add : (duration: Temporal.DurationLike, options?: Temporal.OverflowOptions) => Temporal.PlainDate +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>startDate2 : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>add : (duration: Temporal.DurationLike, options?: Temporal.OverflowOptions) => Temporal.PlainDate +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>oneAndAHalfMonth : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>add : (duration: Temporal.DurationLike, options?: Temporal.OverflowOptions) => Temporal.PlainDate +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>oneAndAHalfMonth : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ + + .since(startDate2, { largestUnit: "months" }); // => P3M1D +>since : (other: Temporal.PlainDateLike, options?: Temporal.RoundingOptionsWithLargestUnit) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^ +>startDate2 : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>{ largestUnit: "months" } : { largestUnit: "months"; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^ +>largestUnit : "months" +> : ^^^^^^^^ +>"months" : "months" +> : ^^^^^^^^ +} + +{ + const hourAndAHalf = Temporal.Duration.from("PT1H30M"); +>hourAndAHalf : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>Temporal.Duration.from("PT1H30M") : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>Temporal.Duration.from : (item: Temporal.DurationLike) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.Duration : Temporal.DurationConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>Duration : Temporal.DurationConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.DurationLike) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"PT1H30M" : "PT1H30M" +> : ^^^^^^^^^ + + hourAndAHalf.subtract({ hours: 1 }); // => PT30M +>hourAndAHalf.subtract({ hours: 1 }) : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>hourAndAHalf.subtract : (other: Temporal.DurationLike) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>hourAndAHalf : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>subtract : (other: Temporal.DurationLike) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ hours: 1 } : { hours: number; } +> : ^^^^^^^^^^^^^^^^^^ +>hours : number +> : ^^^^^^ +>1 : 1 +> : ^ + + const one = Temporal.Duration.from({ minutes: 180 }); +>one : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>Temporal.Duration.from({ minutes: 180 }) : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>Temporal.Duration.from : (item: Temporal.DurationLike) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.Duration : Temporal.DurationConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>Duration : Temporal.DurationConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.DurationLike) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ minutes: 180 } : { minutes: number; } +> : ^^^^^^^^^^^^^^^^^^^^ +>minutes : number +> : ^^^^^^ +>180 : 180 +> : ^^^ + + const two = Temporal.Duration.from({ seconds: 30 }); +>two : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>Temporal.Duration.from({ seconds: 30 }) : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>Temporal.Duration.from : (item: Temporal.DurationLike) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.Duration : Temporal.DurationConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>Duration : Temporal.DurationConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.DurationLike) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ seconds: 30 } : { seconds: number; } +> : ^^^^^^^^^^^^^^^^^^^^ +>seconds : number +> : ^^^^^^ +>30 : 30 +> : ^^ + + one.subtract(two); // => PT179M30S +>one.subtract(two) : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>one.subtract : (other: Temporal.DurationLike) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>one : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>subtract : (other: Temporal.DurationLike) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>two : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ + + one.subtract(two).round({ largestUnit: "hour" }); // => PT2H59M30S +>one.subtract(two).round({ largestUnit: "hour" }) : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>one.subtract(two).round : { (roundTo: "day" | "days" | Temporal.TimeUnit): Temporal.Duration; (roundTo: Temporal.DurationRoundingOptions): Temporal.Duration; } +> : ^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>one.subtract(two) : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>one.subtract : (other: Temporal.DurationLike) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>one : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>subtract : (other: Temporal.DurationLike) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>two : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>round : { (roundTo: "day" | "days" | Temporal.TimeUnit): Temporal.Duration; (roundTo: Temporal.DurationRoundingOptions): Temporal.Duration; } +> : ^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ largestUnit: "hour" } : { largestUnit: "hour"; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^ +>largestUnit : "hour" +> : ^^^^^^ +>"hour" : "hour" +> : ^^^^^^ + + // Example of subtracting calendar units; cannot be subtracted using + // subtract() because units need to be converted + const threeMonths = Temporal.Duration.from({ months: 3 }); +>threeMonths : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>Temporal.Duration.from({ months: 3 }) : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>Temporal.Duration.from : (item: Temporal.DurationLike) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.Duration : Temporal.DurationConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>Duration : Temporal.DurationConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.DurationLike) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ months: 3 } : { months: number; } +> : ^^^^^^^^^^^^^^^^^^^ +>months : number +> : ^^^^^^ +>3 : 3 +> : ^ + + const oneAndAHalfMonth = Temporal.Duration.from({ months: 1, days: 15 }); +>oneAndAHalfMonth : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>Temporal.Duration.from({ months: 1, days: 15 }) : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>Temporal.Duration.from : (item: Temporal.DurationLike) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.Duration : Temporal.DurationConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>Duration : Temporal.DurationConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.DurationLike) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ months: 1, days: 15 } : { months: number; days: number; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>months : number +> : ^^^^^^ +>1 : 1 +> : ^ +>days : number +> : ^^^^^^ +>15 : 15 +> : ^^ + + // To convert units, use arithmetic relative to a start date: + const startDate1 = Temporal.PlainDate.from("2001-01-01"); +>startDate1 : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDate.from("2001-01-01") : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDate.from : (item: Temporal.PlainDateLike, options?: Temporal.OverflowOptions) => Temporal.PlainDate +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDate : Temporal.PlainDateConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>PlainDate : Temporal.PlainDateConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.PlainDateLike, options?: Temporal.OverflowOptions) => Temporal.PlainDate +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"2001-01-01" : "2001-01-01" +> : ^^^^^^^^^^^^ + + startDate1.add(threeMonths).subtract(oneAndAHalfMonth) +>startDate1.add(threeMonths).subtract(oneAndAHalfMonth) .since(startDate1, { largestUnit: "months" }) : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>startDate1.add(threeMonths).subtract(oneAndAHalfMonth) .since : (other: Temporal.PlainDateLike, options?: Temporal.RoundingOptionsWithLargestUnit) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^ +>startDate1.add(threeMonths).subtract(oneAndAHalfMonth) : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>startDate1.add(threeMonths).subtract : (duration: Temporal.DurationLike, options?: Temporal.OverflowOptions) => Temporal.PlainDate +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>startDate1.add(threeMonths) : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>startDate1.add : (duration: Temporal.DurationLike, options?: Temporal.OverflowOptions) => Temporal.PlainDate +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>startDate1 : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>add : (duration: Temporal.DurationLike, options?: Temporal.OverflowOptions) => Temporal.PlainDate +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>threeMonths : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>subtract : (duration: Temporal.DurationLike, options?: Temporal.OverflowOptions) => Temporal.PlainDate +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>oneAndAHalfMonth : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ + + .since(startDate1, { largestUnit: "months" }); // => P1M13D +>since : (other: Temporal.PlainDateLike, options?: Temporal.RoundingOptionsWithLargestUnit) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^ +>startDate1 : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>{ largestUnit: "months" } : { largestUnit: "months"; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^ +>largestUnit : "months" +> : ^^^^^^^^ +>"months" : "months" +> : ^^^^^^^^ + + const startDate2 = Temporal.PlainDate.from("2001-02-01"); +>startDate2 : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDate.from("2001-02-01") : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDate.from : (item: Temporal.PlainDateLike, options?: Temporal.OverflowOptions) => Temporal.PlainDate +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDate : Temporal.PlainDateConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>PlainDate : Temporal.PlainDateConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.PlainDateLike, options?: Temporal.OverflowOptions) => Temporal.PlainDate +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"2001-02-01" : "2001-02-01" +> : ^^^^^^^^^^^^ + + startDate2.add(threeMonths).subtract(oneAndAHalfMonth) +>startDate2.add(threeMonths).subtract(oneAndAHalfMonth) .since(startDate2, { largestUnit: "months" }) : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>startDate2.add(threeMonths).subtract(oneAndAHalfMonth) .since : (other: Temporal.PlainDateLike, options?: Temporal.RoundingOptionsWithLargestUnit) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^ +>startDate2.add(threeMonths).subtract(oneAndAHalfMonth) : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>startDate2.add(threeMonths).subtract : (duration: Temporal.DurationLike, options?: Temporal.OverflowOptions) => Temporal.PlainDate +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>startDate2.add(threeMonths) : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>startDate2.add : (duration: Temporal.DurationLike, options?: Temporal.OverflowOptions) => Temporal.PlainDate +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>startDate2 : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>add : (duration: Temporal.DurationLike, options?: Temporal.OverflowOptions) => Temporal.PlainDate +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>threeMonths : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>subtract : (duration: Temporal.DurationLike, options?: Temporal.OverflowOptions) => Temporal.PlainDate +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>oneAndAHalfMonth : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ + + .since(startDate2, { largestUnit: "months" }); // => P1M16D +>since : (other: Temporal.PlainDateLike, options?: Temporal.RoundingOptionsWithLargestUnit) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^ +>startDate2 : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>{ largestUnit: "months" } : { largestUnit: "months"; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^ +>largestUnit : "months" +> : ^^^^^^^^ +>"months" : "months" +> : ^^^^^^^^ +} + +{ + const d = Temporal.Duration.from("P1Y2M3DT4H5M6.987654321S"); +>d : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>Temporal.Duration.from("P1Y2M3DT4H5M6.987654321S") : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>Temporal.Duration.from : (item: Temporal.DurationLike) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.Duration : Temporal.DurationConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>Duration : Temporal.DurationConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.DurationLike) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"P1Y2M3DT4H5M6.987654321S" : "P1Y2M3DT4H5M6.987654321S" +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^ + + d.sign; // 1 +>d.sign : number +> : ^^^^^^ +>d : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>sign : number +> : ^^^^^^ + + d.negated(); // -P1Y2M3DT4H5M6.987654321S +>d.negated() : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>d.negated : () => Temporal.Duration +> : ^^^^^^^^^^^^^^^^^^^^^^^ +>d : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>negated : () => Temporal.Duration +> : ^^^^^^^^^^^^^^^^^^^^^^^ + + d.negated().sign; // -1 +>d.negated().sign : number +> : ^^^^^^ +>d.negated() : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>d.negated : () => Temporal.Duration +> : ^^^^^^^^^^^^^^^^^^^^^^^ +>d : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>negated : () => Temporal.Duration +> : ^^^^^^^^^^^^^^^^^^^^^^^ +>sign : number +> : ^^^^^^ +} + +{ + const d = Temporal.Duration.from("-PT8H30M"); +>d : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>Temporal.Duration.from("-PT8H30M") : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>Temporal.Duration.from : (item: Temporal.DurationLike) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.Duration : Temporal.DurationConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>Duration : Temporal.DurationConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.DurationLike) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"-PT8H30M" : "-PT8H30M" +> : ^^^^^^^^^^ + + d.abs(); // PT8H30M +>d.abs() : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>d.abs : () => Temporal.Duration +> : ^^^^^^^^^^^^^^^^^^^^^^^ +>d : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>abs : () => Temporal.Duration +> : ^^^^^^^^^^^^^^^^^^^^^^^ +} + +{ + let d: Temporal.Duration; +>d : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>Temporal : any +> : ^^^ + + // Balance a duration as far as possible without knowing a starting point + d = Temporal.Duration.from({ minutes: 130 }); +>d = Temporal.Duration.from({ minutes: 130 }) : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>d : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>Temporal.Duration.from({ minutes: 130 }) : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>Temporal.Duration.from : (item: Temporal.DurationLike) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.Duration : Temporal.DurationConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>Duration : Temporal.DurationConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.DurationLike) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ minutes: 130 } : { minutes: number; } +> : ^^^^^^^^^^^^^^^^^^^^ +>minutes : number +> : ^^^^^^ +>130 : 130 +> : ^^^ + + d.round({ largestUnit: "day" }); // => PT2H10M +>d.round({ largestUnit: "day" }) : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>d.round : { (roundTo: "day" | "days" | Temporal.TimeUnit): Temporal.Duration; (roundTo: Temporal.DurationRoundingOptions): Temporal.Duration; } +> : ^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>d : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>round : { (roundTo: "day" | "days" | Temporal.TimeUnit): Temporal.Duration; (roundTo: Temporal.DurationRoundingOptions): Temporal.Duration; } +> : ^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ largestUnit: "day" } : { largestUnit: "day"; } +> : ^^^^^^^^^^^^^^^^^^^^^^^ +>largestUnit : "day" +> : ^^^^^ +>"day" : "day" +> : ^^^^^ + + // Round to the nearest unit + d = Temporal.Duration.from({ minutes: 10, seconds: 52 }); +>d = Temporal.Duration.from({ minutes: 10, seconds: 52 }) : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>d : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>Temporal.Duration.from({ minutes: 10, seconds: 52 }) : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>Temporal.Duration.from : (item: Temporal.DurationLike) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.Duration : Temporal.DurationConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>Duration : Temporal.DurationConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.DurationLike) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ minutes: 10, seconds: 52 } : { minutes: number; seconds: number; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>minutes : number +> : ^^^^^^ +>10 : 10 +> : ^^ +>seconds : number +> : ^^^^^^ +>52 : 52 +> : ^^ + + d.round({ smallestUnit: "minute" }); // => PT11M +>d.round({ smallestUnit: "minute" }) : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>d.round : { (roundTo: "day" | "days" | Temporal.TimeUnit): Temporal.Duration; (roundTo: Temporal.DurationRoundingOptions): Temporal.Duration; } +> : ^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>d : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>round : { (roundTo: "day" | "days" | Temporal.TimeUnit): Temporal.Duration; (roundTo: Temporal.DurationRoundingOptions): Temporal.Duration; } +> : ^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ smallestUnit: "minute" } : { smallestUnit: "minute"; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>smallestUnit : "minute" +> : ^^^^^^^^ +>"minute" : "minute" +> : ^^^^^^^^ + + d.round({ smallestUnit: "minute", roundingMode: "trunc" }); // => PT10M +>d.round({ smallestUnit: "minute", roundingMode: "trunc" }) : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>d.round : { (roundTo: "day" | "days" | Temporal.TimeUnit): Temporal.Duration; (roundTo: Temporal.DurationRoundingOptions): Temporal.Duration; } +> : ^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>d : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>round : { (roundTo: "day" | "days" | Temporal.TimeUnit): Temporal.Duration; (roundTo: Temporal.DurationRoundingOptions): Temporal.Duration; } +> : ^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ smallestUnit: "minute", roundingMode: "trunc" } : { smallestUnit: "minute"; roundingMode: "trunc"; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>smallestUnit : "minute" +> : ^^^^^^^^ +>"minute" : "minute" +> : ^^^^^^^^ +>roundingMode : "trunc" +> : ^^^^^^^ +>"trunc" : "trunc" +> : ^^^^^^^ + + // How many seconds in a multi-unit duration? + d = Temporal.Duration.from("PT2H34M18S"); +>d = Temporal.Duration.from("PT2H34M18S") : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>d : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>Temporal.Duration.from("PT2H34M18S") : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>Temporal.Duration.from : (item: Temporal.DurationLike) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.Duration : Temporal.DurationConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>Duration : Temporal.DurationConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.DurationLike) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"PT2H34M18S" : "PT2H34M18S" +> : ^^^^^^^^^^^^ + + d.round({ largestUnit: "second" }).seconds; // => 9258 +>d.round({ largestUnit: "second" }).seconds : number +> : ^^^^^^ +>d.round({ largestUnit: "second" }) : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>d.round : { (roundTo: "day" | "days" | Temporal.TimeUnit): Temporal.Duration; (roundTo: Temporal.DurationRoundingOptions): Temporal.Duration; } +> : ^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>d : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>round : { (roundTo: "day" | "days" | Temporal.TimeUnit): Temporal.Duration; (roundTo: Temporal.DurationRoundingOptions): Temporal.Duration; } +> : ^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ largestUnit: "second" } : { largestUnit: "second"; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^ +>largestUnit : "second" +> : ^^^^^^^^ +>"second" : "second" +> : ^^^^^^^^ +>seconds : number +> : ^^^^^^ + + // Normalize, with and without taking DST into account + d = Temporal.Duration.from({ hours: 2756 }); +>d = Temporal.Duration.from({ hours: 2756 }) : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>d : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>Temporal.Duration.from({ hours: 2756 }) : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>Temporal.Duration.from : (item: Temporal.DurationLike) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.Duration : Temporal.DurationConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>Duration : Temporal.DurationConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.DurationLike) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ hours: 2756 } : { hours: number; } +> : ^^^^^^^^^^^^^^^^^^ +>hours : number +> : ^^^^^^ +>2756 : 2756 +> : ^^^^ + + d.round({ +>d.round({ relativeTo: "2020-01-01T00:00+01:00[Europe/Rome]", largestUnit: "year", }) : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>d.round : { (roundTo: "day" | "days" | Temporal.TimeUnit): Temporal.Duration; (roundTo: Temporal.DurationRoundingOptions): Temporal.Duration; } +> : ^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>d : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>round : { (roundTo: "day" | "days" | Temporal.TimeUnit): Temporal.Duration; (roundTo: Temporal.DurationRoundingOptions): Temporal.Duration; } +> : ^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ relativeTo: "2020-01-01T00:00+01:00[Europe/Rome]", largestUnit: "year", } : { relativeTo: string; largestUnit: "year"; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + relativeTo: "2020-01-01T00:00+01:00[Europe/Rome]", +>relativeTo : string +> : ^^^^^^ +>"2020-01-01T00:00+01:00[Europe/Rome]" : "2020-01-01T00:00+01:00[Europe/Rome]" +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + largestUnit: "year", +>largestUnit : "year" +> : ^^^^^^ +>"year" : "year" +> : ^^^^^^ + + }); // => P114DT21H + // (one hour longer because DST skipped an hour) + d.round({ +>d.round({ relativeTo: "2020-01-01", largestUnit: "year", }) : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>d.round : { (roundTo: "day" | "days" | Temporal.TimeUnit): Temporal.Duration; (roundTo: Temporal.DurationRoundingOptions): Temporal.Duration; } +> : ^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>d : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>round : { (roundTo: "day" | "days" | Temporal.TimeUnit): Temporal.Duration; (roundTo: Temporal.DurationRoundingOptions): Temporal.Duration; } +> : ^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ relativeTo: "2020-01-01", largestUnit: "year", } : { relativeTo: string; largestUnit: "year"; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + relativeTo: "2020-01-01", +>relativeTo : string +> : ^^^^^^ +>"2020-01-01" : "2020-01-01" +> : ^^^^^^^^^^^^ + + largestUnit: "year", +>largestUnit : "year" +> : ^^^^^^ +>"year" : "year" +> : ^^^^^^ + + }); // => P114DT20H + // (one hour shorter if ignoring DST) + + // Normalize days into months or years + d = Temporal.Duration.from({ days: 190 }); +>d = Temporal.Duration.from({ days: 190 }) : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>d : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>Temporal.Duration.from({ days: 190 }) : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>Temporal.Duration.from : (item: Temporal.DurationLike) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.Duration : Temporal.DurationConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>Duration : Temporal.DurationConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.DurationLike) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ days: 190 } : { days: number; } +> : ^^^^^^^^^^^^^^^^^ +>days : number +> : ^^^^^^ +>190 : 190 +> : ^^^ + + const refDate = Temporal.PlainDate.from("2020-01-01"); +>refDate : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDate.from("2020-01-01") : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDate.from : (item: Temporal.PlainDateLike, options?: Temporal.OverflowOptions) => Temporal.PlainDate +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.PlainDate : Temporal.PlainDateConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>PlainDate : Temporal.PlainDateConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.PlainDateLike, options?: Temporal.OverflowOptions) => Temporal.PlainDate +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"2020-01-01" : "2020-01-01" +> : ^^^^^^^^^^^^ + + d.round({ relativeTo: refDate, largestUnit: "year" }); // => P6M8D +>d.round({ relativeTo: refDate, largestUnit: "year" }) : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>d.round : { (roundTo: "day" | "days" | Temporal.TimeUnit): Temporal.Duration; (roundTo: Temporal.DurationRoundingOptions): Temporal.Duration; } +> : ^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>d : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>round : { (roundTo: "day" | "days" | Temporal.TimeUnit): Temporal.Duration; (roundTo: Temporal.DurationRoundingOptions): Temporal.Duration; } +> : ^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ relativeTo: refDate, largestUnit: "year" } : { relativeTo: Temporal.PlainDate; largestUnit: "year"; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>relativeTo : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>refDate : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>largestUnit : "year" +> : ^^^^^^ +>"year" : "year" +> : ^^^^^^ + + // Same, but in a different calendar system + d.round({ +>d.round({ relativeTo: refDate.withCalendar("hebrew"), largestUnit: "year", }) : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>d.round : { (roundTo: "day" | "days" | Temporal.TimeUnit): Temporal.Duration; (roundTo: Temporal.DurationRoundingOptions): Temporal.Duration; } +> : ^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>d : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>round : { (roundTo: "day" | "days" | Temporal.TimeUnit): Temporal.Duration; (roundTo: Temporal.DurationRoundingOptions): Temporal.Duration; } +> : ^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ relativeTo: refDate.withCalendar("hebrew"), largestUnit: "year", } : { relativeTo: Temporal.PlainDate; largestUnit: "year"; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + relativeTo: refDate.withCalendar("hebrew"), +>relativeTo : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>refDate.withCalendar("hebrew") : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>refDate.withCalendar : (calendarLike: Temporal.CalendarLike) => Temporal.PlainDate +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>refDate : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>withCalendar : (calendarLike: Temporal.CalendarLike) => Temporal.PlainDate +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"hebrew" : "hebrew" +> : ^^^^^^^^ + + largestUnit: "year", +>largestUnit : "year" +> : ^^^^^^ +>"year" : "year" +> : ^^^^^^ + + }); // => P6M13D + + // Round a duration up to the next 5-minute billing period + d = Temporal.Duration.from({ minutes: 6 }); +>d = Temporal.Duration.from({ minutes: 6 }) : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>d : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>Temporal.Duration.from({ minutes: 6 }) : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>Temporal.Duration.from : (item: Temporal.DurationLike) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.Duration : Temporal.DurationConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>Duration : Temporal.DurationConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.DurationLike) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ minutes: 6 } : { minutes: number; } +> : ^^^^^^^^^^^^^^^^^^^^ +>minutes : number +> : ^^^^^^ +>6 : 6 +> : ^ + + d.round({ +>d.round({ smallestUnit: "minute", roundingIncrement: 5, roundingMode: "ceil", }) : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>d.round : { (roundTo: "day" | "days" | Temporal.TimeUnit): Temporal.Duration; (roundTo: Temporal.DurationRoundingOptions): Temporal.Duration; } +> : ^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>d : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>round : { (roundTo: "day" | "days" | Temporal.TimeUnit): Temporal.Duration; (roundTo: Temporal.DurationRoundingOptions): Temporal.Duration; } +> : ^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ smallestUnit: "minute", roundingIncrement: 5, roundingMode: "ceil", } : { smallestUnit: "minute"; roundingIncrement: number; roundingMode: "ceil"; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + smallestUnit: "minute", +>smallestUnit : "minute" +> : ^^^^^^^^ +>"minute" : "minute" +> : ^^^^^^^^ + + roundingIncrement: 5, +>roundingIncrement : number +> : ^^^^^^ +>5 : 5 +> : ^ + + roundingMode: "ceil", +>roundingMode : "ceil" +> : ^^^^^^ +>"ceil" : "ceil" +> : ^^^^^^ + + }); // => PT10M + + // How many full 3-month quarters of this year, are in this duration? + d = Temporal.Duration.from({ months: 10, days: 15 }); +>d = Temporal.Duration.from({ months: 10, days: 15 }) : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>d : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>Temporal.Duration.from({ months: 10, days: 15 }) : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>Temporal.Duration.from : (item: Temporal.DurationLike) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.Duration : Temporal.DurationConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>Duration : Temporal.DurationConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.DurationLike) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ months: 10, days: 15 } : { months: number; days: number; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>months : number +> : ^^^^^^ +>10 : 10 +> : ^^ +>days : number +> : ^^^^^^ +>15 : 15 +> : ^^ + + d = d.round({ +>d = d.round({ smallestUnit: "month", roundingIncrement: 3, roundingMode: "trunc", relativeTo: Temporal.Now.plainDateISO(), }) : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>d : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>d.round({ smallestUnit: "month", roundingIncrement: 3, roundingMode: "trunc", relativeTo: Temporal.Now.plainDateISO(), }) : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>d.round : { (roundTo: "day" | "days" | Temporal.TimeUnit): Temporal.Duration; (roundTo: Temporal.DurationRoundingOptions): Temporal.Duration; } +> : ^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>d : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>round : { (roundTo: "day" | "days" | Temporal.TimeUnit): Temporal.Duration; (roundTo: Temporal.DurationRoundingOptions): Temporal.Duration; } +> : ^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ smallestUnit: "month", roundingIncrement: 3, roundingMode: "trunc", relativeTo: Temporal.Now.plainDateISO(), } : { smallestUnit: "month"; roundingIncrement: number; roundingMode: "trunc"; relativeTo: Temporal.PlainDate; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + smallestUnit: "month", +>smallestUnit : "month" +> : ^^^^^^^ +>"month" : "month" +> : ^^^^^^^ + + roundingIncrement: 3, +>roundingIncrement : number +> : ^^^^^^ +>3 : 3 +> : ^ + + roundingMode: "trunc", +>roundingMode : "trunc" +> : ^^^^^^^ +>"trunc" : "trunc" +> : ^^^^^^^ + + relativeTo: Temporal.Now.plainDateISO(), +>relativeTo : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>Temporal.Now.plainDateISO() : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>Temporal.Now.plainDateISO : (timeZone?: Temporal.TimeZoneLike) => Temporal.PlainDate +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.Now : typeof Temporal.Now +> : ^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>Now : typeof Temporal.Now +> : ^^^^^^^^^^^^^^^^^^^ +>plainDateISO : (timeZone?: Temporal.TimeZoneLike) => Temporal.PlainDate +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + }); + const quarters = d.months / 3; +>quarters : number +> : ^^^^^^ +>d.months / 3 : number +> : ^^^^^^ +>d.months : number +> : ^^^^^^ +>d : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>months : number +> : ^^^^^^ +>3 : 3 +> : ^ + + quarters; // => 3 +>quarters : number +> : ^^^^^^ +} + +{ + let d: Temporal.Duration; +>d : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>Temporal : any +> : ^^^ + + // How many seconds in 130 hours and 20 minutes? + d = Temporal.Duration.from({ hours: 130, minutes: 20 }); +>d = Temporal.Duration.from({ hours: 130, minutes: 20 }) : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>d : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>Temporal.Duration.from({ hours: 130, minutes: 20 }) : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>Temporal.Duration.from : (item: Temporal.DurationLike) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.Duration : Temporal.DurationConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>Duration : Temporal.DurationConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.DurationLike) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ hours: 130, minutes: 20 } : { hours: number; minutes: number; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>hours : number +> : ^^^^^^ +>130 : 130 +> : ^^^ +>minutes : number +> : ^^^^^^ +>20 : 20 +> : ^^ + + d.total({ unit: "second" }); // => 469200 +>d.total({ unit: "second" }) : number +> : ^^^^^^ +>d.total : { (totalOf: "day" | "days" | Temporal.TimeUnit): number; (totalOf: Temporal.DurationTotalOptions): number; } +> : ^^^ ^^ ^^^^^^^^^^^^^^^^^^^^ ^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^ +>d : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>total : { (totalOf: "day" | "days" | Temporal.TimeUnit): number; (totalOf: Temporal.DurationTotalOptions): number; } +> : ^^^ ^^ ^^^^^^^^^^^^^^^^^^^^ ^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^ +>{ unit: "second" } : { unit: "second"; } +> : ^^^^^^^^^^^^^^^^^^^ +>unit : "second" +> : ^^^^^^^^ +>"second" : "second" +> : ^^^^^^^^ + + // How many 24-hour days is 123456789 seconds? + d = Temporal.Duration.from("PT123456789S"); +>d = Temporal.Duration.from("PT123456789S") : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>d : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>Temporal.Duration.from("PT123456789S") : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>Temporal.Duration.from : (item: Temporal.DurationLike) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.Duration : Temporal.DurationConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>Duration : Temporal.DurationConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.DurationLike) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"PT123456789S" : "PT123456789S" +> : ^^^^^^^^^^^^^^ + + d.total({ unit: "day" }); // 1428.8980208333332 +>d.total({ unit: "day" }) : number +> : ^^^^^^ +>d.total : { (totalOf: "day" | "days" | Temporal.TimeUnit): number; (totalOf: Temporal.DurationTotalOptions): number; } +> : ^^^ ^^ ^^^^^^^^^^^^^^^^^^^^ ^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^ +>d : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>total : { (totalOf: "day" | "days" | Temporal.TimeUnit): number; (totalOf: Temporal.DurationTotalOptions): number; } +> : ^^^ ^^ ^^^^^^^^^^^^^^^^^^^^ ^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^ +>{ unit: "day" } : { unit: "day"; } +> : ^^^^^^^^^^^^^^^^ +>unit : "day" +> : ^^^^^ +>"day" : "day" +> : ^^^^^ + + // Find totals in months, with and without taking DST into account + d = Temporal.Duration.from({ hours: 2756 }); +>d = Temporal.Duration.from({ hours: 2756 }) : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>d : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>Temporal.Duration.from({ hours: 2756 }) : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>Temporal.Duration.from : (item: Temporal.DurationLike) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.Duration : Temporal.DurationConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>Duration : Temporal.DurationConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.DurationLike) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ hours: 2756 } : { hours: number; } +> : ^^^^^^^^^^^^^^^^^^ +>hours : number +> : ^^^^^^ +>2756 : 2756 +> : ^^^^ + + d.total({ +>d.total({ relativeTo: "2020-01-01T00:00+01:00[Europe/Rome]", unit: "month", }) : number +> : ^^^^^^ +>d.total : { (totalOf: "day" | "days" | Temporal.TimeUnit): number; (totalOf: Temporal.DurationTotalOptions): number; } +> : ^^^ ^^ ^^^^^^^^^^^^^^^^^^^^ ^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^ +>d : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>total : { (totalOf: "day" | "days" | Temporal.TimeUnit): number; (totalOf: Temporal.DurationTotalOptions): number; } +> : ^^^ ^^ ^^^^^^^^^^^^^^^^^^^^ ^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^ +>{ relativeTo: "2020-01-01T00:00+01:00[Europe/Rome]", unit: "month", } : { relativeTo: string; unit: "month"; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + relativeTo: "2020-01-01T00:00+01:00[Europe/Rome]", +>relativeTo : string +> : ^^^^^^ +>"2020-01-01T00:00+01:00[Europe/Rome]" : "2020-01-01T00:00+01:00[Europe/Rome]" +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + unit: "month", +>unit : "month" +> : ^^^^^^^ +>"month" : "month" +> : ^^^^^^^ + + }); // => 3.7958333333333334 + d.total({ +>d.total({ unit: "month", relativeTo: "2020-01-01", }) : number +> : ^^^^^^ +>d.total : { (totalOf: "day" | "days" | Temporal.TimeUnit): number; (totalOf: Temporal.DurationTotalOptions): number; } +> : ^^^ ^^ ^^^^^^^^^^^^^^^^^^^^ ^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^ +>d : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>total : { (totalOf: "day" | "days" | Temporal.TimeUnit): number; (totalOf: Temporal.DurationTotalOptions): number; } +> : ^^^ ^^ ^^^^^^^^^^^^^^^^^^^^ ^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^ +>{ unit: "month", relativeTo: "2020-01-01", } : { unit: "month"; relativeTo: string; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + unit: "month", +>unit : "month" +> : ^^^^^^^ +>"month" : "month" +> : ^^^^^^^ + + relativeTo: "2020-01-01", +>relativeTo : string +> : ^^^^^^ +>"2020-01-01" : "2020-01-01" +> : ^^^^^^^^^^^^ + + }); // => 3.7944444444444443 +} + +{ + let d: Temporal.Duration; +>d : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>Temporal : any +> : ^^^ + + d = Temporal.Duration.from({ years: 1, days: 1 }); +>d = Temporal.Duration.from({ years: 1, days: 1 }) : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>d : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>Temporal.Duration.from({ years: 1, days: 1 }) : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>Temporal.Duration.from : (item: Temporal.DurationLike) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.Duration : Temporal.DurationConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>Duration : Temporal.DurationConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.DurationLike) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ years: 1, days: 1 } : { years: number; days: number; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>years : number +> : ^^^^^^ +>1 : 1 +> : ^ +>days : number +> : ^^^^^^ +>1 : 1 +> : ^ + + d.toString(); // => P1Y1D +>d.toString() : string +> : ^^^^^^ +>d.toString : (options?: Temporal.DurationToStringOptions) => string +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>d : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>toString : (options?: Temporal.DurationToStringOptions) => string +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + d = Temporal.Duration.from({ years: -1, days: -1 }); +>d = Temporal.Duration.from({ years: -1, days: -1 }) : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>d : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>Temporal.Duration.from({ years: -1, days: -1 }) : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>Temporal.Duration.from : (item: Temporal.DurationLike) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.Duration : Temporal.DurationConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>Duration : Temporal.DurationConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.DurationLike) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ years: -1, days: -1 } : { years: number; days: number; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>years : number +> : ^^^^^^ +>-1 : -1 +> : ^^ +>1 : 1 +> : ^ +>days : number +> : ^^^^^^ +>-1 : -1 +> : ^^ +>1 : 1 +> : ^ + + d.toString(); // => -P1Y1D +>d.toString() : string +> : ^^^^^^ +>d.toString : (options?: Temporal.DurationToStringOptions) => string +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>d : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>toString : (options?: Temporal.DurationToStringOptions) => string +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + d = Temporal.Duration.from({ milliseconds: 1000 }); +>d = Temporal.Duration.from({ milliseconds: 1000 }) : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>d : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>Temporal.Duration.from({ milliseconds: 1000 }) : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>Temporal.Duration.from : (item: Temporal.DurationLike) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.Duration : Temporal.DurationConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>Duration : Temporal.DurationConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.DurationLike) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ milliseconds: 1000 } : { milliseconds: number; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^ +>milliseconds : number +> : ^^^^^^ +>1000 : 1000 +> : ^^^^ + + d.toString(); // => PT1S +>d.toString() : string +> : ^^^^^^ +>d.toString : (options?: Temporal.DurationToStringOptions) => string +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>d : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>toString : (options?: Temporal.DurationToStringOptions) => string +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + // The output format always balances units under 1 s, even if the + // underlying Temporal.Duration object doesn't. + const nobal = Temporal.Duration.from({ milliseconds: 3500 }); +>nobal : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>Temporal.Duration.from({ milliseconds: 3500 }) : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>Temporal.Duration.from : (item: Temporal.DurationLike) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.Duration : Temporal.DurationConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>Duration : Temporal.DurationConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.DurationLike) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ milliseconds: 3500 } : { milliseconds: number; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^ +>milliseconds : number +> : ^^^^^^ +>3500 : 3500 +> : ^^^^ + + console.log(`${nobal}`, nobal.seconds, nobal.milliseconds); // => 'PT3.5S 0 3500' +>console.log(`${nobal}`, nobal.seconds, nobal.milliseconds) : void +> : ^^^^ +>console.log : (...data: any[]) => void +> : ^^^^ ^^ ^^^^^ +>console : Console +> : ^^^^^^^ +>log : (...data: any[]) => void +> : ^^^^ ^^ ^^^^^ +>`${nobal}` : string +> : ^^^^^^ +>nobal : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>nobal.seconds : number +> : ^^^^^^ +>nobal : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>seconds : number +> : ^^^^^^ +>nobal.milliseconds : number +> : ^^^^^^ +>nobal : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>milliseconds : number +> : ^^^^^^ + + const bal = nobal.round({ largestUnit: "year" }); // balance through round +>bal : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>nobal.round({ largestUnit: "year" }) : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>nobal.round : { (roundTo: "day" | "days" | Temporal.TimeUnit): Temporal.Duration; (roundTo: Temporal.DurationRoundingOptions): Temporal.Duration; } +> : ^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>nobal : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>round : { (roundTo: "day" | "days" | Temporal.TimeUnit): Temporal.Duration; (roundTo: Temporal.DurationRoundingOptions): Temporal.Duration; } +> : ^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ largestUnit: "year" } : { largestUnit: "year"; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^ +>largestUnit : "year" +> : ^^^^^^ +>"year" : "year" +> : ^^^^^^ + + console.log(`${bal}`, bal.seconds, bal.milliseconds); // => 'PT3.5S 3 500' +>console.log(`${bal}`, bal.seconds, bal.milliseconds) : void +> : ^^^^ +>console.log : (...data: any[]) => void +> : ^^^^ ^^ ^^^^^ +>console : Console +> : ^^^^^^^ +>log : (...data: any[]) => void +> : ^^^^ ^^ ^^^^^ +>`${bal}` : string +> : ^^^^^^ +>bal : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>bal.seconds : number +> : ^^^^^^ +>bal : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>seconds : number +> : ^^^^^^ +>bal.milliseconds : number +> : ^^^^^^ +>bal : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>milliseconds : number +> : ^^^^^^ + + d = Temporal.Duration.from("PT59.999999999S"); +>d = Temporal.Duration.from("PT59.999999999S") : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>d : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>Temporal.Duration.from("PT59.999999999S") : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>Temporal.Duration.from : (item: Temporal.DurationLike) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.Duration : Temporal.DurationConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>Duration : Temporal.DurationConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.DurationLike) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"PT59.999999999S" : "PT59.999999999S" +> : ^^^^^^^^^^^^^^^^^ + + d.toString({ smallestUnit: "second" }); // => PT59S +>d.toString({ smallestUnit: "second" }) : string +> : ^^^^^^ +>d.toString : (options?: Temporal.DurationToStringOptions) => string +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>d : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>toString : (options?: Temporal.DurationToStringOptions) => string +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ smallestUnit: "second" } : { smallestUnit: "second"; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>smallestUnit : "second" +> : ^^^^^^^^ +>"second" : "second" +> : ^^^^^^^^ + + d.toString({ fractionalSecondDigits: 0 }); // => PT59S +>d.toString({ fractionalSecondDigits: 0 }) : string +> : ^^^^^^ +>d.toString : (options?: Temporal.DurationToStringOptions) => string +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>d : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>toString : (options?: Temporal.DurationToStringOptions) => string +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ fractionalSecondDigits: 0 } : { fractionalSecondDigits: 0; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>fractionalSecondDigits : 0 +> : ^ +>0 : 0 +> : ^ + + d.toString({ fractionalSecondDigits: 4 }); // => PT59.9999S +>d.toString({ fractionalSecondDigits: 4 }) : string +> : ^^^^^^ +>d.toString : (options?: Temporal.DurationToStringOptions) => string +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>d : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>toString : (options?: Temporal.DurationToStringOptions) => string +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ fractionalSecondDigits: 4 } : { fractionalSecondDigits: 4; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>fractionalSecondDigits : 4 +> : ^ +>4 : 4 +> : ^ + + d.toString({ fractionalSecondDigits: 8, roundingMode: "halfExpand" }); +>d.toString({ fractionalSecondDigits: 8, roundingMode: "halfExpand" }) : string +> : ^^^^^^ +>d.toString : (options?: Temporal.DurationToStringOptions) => string +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>d : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>toString : (options?: Temporal.DurationToStringOptions) => string +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ fractionalSecondDigits: 8, roundingMode: "halfExpand" } : { fractionalSecondDigits: 8; roundingMode: "halfExpand"; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>fractionalSecondDigits : 8 +> : ^ +>8 : 8 +> : ^ +>roundingMode : "halfExpand" +> : ^^^^^^^^^^^^ +>"halfExpand" : "halfExpand" +> : ^^^^^^^^^^^^ + + // => PT60.00000000S +} + +{ + const d = Temporal.Duration.from("P1DT6H30M"); +>d : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>Temporal.Duration.from("P1DT6H30M") : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>Temporal.Duration.from : (item: Temporal.DurationLike) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.Duration : Temporal.DurationConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>Duration : Temporal.DurationConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>from : (item: Temporal.DurationLike) => Temporal.Duration +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"P1DT6H30M" : "P1DT6H30M" +> : ^^^^^^^^^^^ + + d.toLocaleString(); // example output: '1 day 6 hours 30 minutes' +>d.toLocaleString() : string +> : ^^^^^^ +>d.toLocaleString : (locales?: Intl.LocalesArgument, options?: Intl.DurationFormatOptions) => string +> : ^ ^^^ ^^ ^^^ ^^^^^ +>d : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>toLocaleString : (locales?: Intl.LocalesArgument, options?: Intl.DurationFormatOptions) => string +> : ^ ^^^ ^^ ^^^ ^^^^^ + + d.toLocaleString("de-DE"); // example output: '1 Tag 6 Stunden 30 Minuten' +>d.toLocaleString("de-DE") : string +> : ^^^^^^ +>d.toLocaleString : (locales?: Intl.LocalesArgument, options?: Intl.DurationFormatOptions) => string +> : ^ ^^^ ^^ ^^^ ^^^^^ +>d : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>toLocaleString : (locales?: Intl.LocalesArgument, options?: Intl.DurationFormatOptions) => string +> : ^ ^^^ ^^ ^^^ ^^^^^ +>"de-DE" : "de-DE" +> : ^^^^^^^ + + d.toLocaleString("en-US", { days: "short", hours: "numeric" }); // example output: '1 day 6 hours' +>d.toLocaleString("en-US", { days: "short", hours: "numeric" }) : string +> : ^^^^^^ +>d.toLocaleString : (locales?: Intl.LocalesArgument, options?: Intl.DurationFormatOptions) => string +> : ^ ^^^ ^^ ^^^ ^^^^^ +>d : Temporal.Duration +> : ^^^^^^^^^^^^^^^^^ +>toLocaleString : (locales?: Intl.LocalesArgument, options?: Intl.DurationFormatOptions) => string +> : ^ ^^^ ^^ ^^^ ^^^^^ +>"en-US" : "en-US" +> : ^^^^^^^ +>{ days: "short", hours: "numeric" } : { days: "short"; hours: "numeric"; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>days : "short" +> : ^^^^^^^ +>"short" : "short" +> : ^^^^^^^ +>hours : "numeric" +> : ^^^^^^^^^ +>"numeric" : "numeric" +> : ^^^^^^^^^ +} + +{ + Temporal.Now.instant(); // get the current system exact time +>Temporal.Now.instant() : Temporal.Instant +> : ^^^^^^^^^^^^^^^^ +>Temporal.Now.instant : () => Temporal.Instant +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.Now : typeof Temporal.Now +> : ^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>Now : typeof Temporal.Now +> : ^^^^^^^^^^^^^^^^^^^ +>instant : () => Temporal.Instant +> : ^^^^^^^^^^^^^^^^^^^^^^ + + Temporal.Now.timeZoneId(); // get the current system time zone +>Temporal.Now.timeZoneId() : string +> : ^^^^^^ +>Temporal.Now.timeZoneId : () => string +> : ^^^^^^ +>Temporal.Now : typeof Temporal.Now +> : ^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>Now : typeof Temporal.Now +> : ^^^^^^^^^^^^^^^^^^^ +>timeZoneId : () => string +> : ^^^^^^ + + Temporal.Now.zonedDateTimeISO(); // get the current date and wall-clock time in the system time zone and ISO-8601 calendar +>Temporal.Now.zonedDateTimeISO() : Temporal.ZonedDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.Now.zonedDateTimeISO : (timeZone?: Temporal.TimeZoneLike) => Temporal.ZonedDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.Now : typeof Temporal.Now +> : ^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>Now : typeof Temporal.Now +> : ^^^^^^^^^^^^^^^^^^^ +>zonedDateTimeISO : (timeZone?: Temporal.TimeZoneLike) => Temporal.ZonedDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + Temporal.Now.plainDateISO(); // get the current date in the system time zone and ISO-8601 calendar +>Temporal.Now.plainDateISO() : Temporal.PlainDate +> : ^^^^^^^^^^^^^^^^^^ +>Temporal.Now.plainDateISO : (timeZone?: Temporal.TimeZoneLike) => Temporal.PlainDate +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.Now : typeof Temporal.Now +> : ^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>Now : typeof Temporal.Now +> : ^^^^^^^^^^^^^^^^^^^ +>plainDateISO : (timeZone?: Temporal.TimeZoneLike) => Temporal.PlainDate +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + Temporal.Now.plainTimeISO(); // get the current wall-clock time in the system time zone and ISO-8601 calendar +>Temporal.Now.plainTimeISO() : Temporal.PlainTime +> : ^^^^^^^^^^^^^^^^^^ +>Temporal.Now.plainTimeISO : (timeZone?: Temporal.TimeZoneLike) => Temporal.PlainTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.Now : typeof Temporal.Now +> : ^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>Now : typeof Temporal.Now +> : ^^^^^^^^^^^^^^^^^^^ +>plainTimeISO : (timeZone?: Temporal.TimeZoneLike) => Temporal.PlainTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + Temporal.Now.plainDateTimeISO(); // same as above, but return the DateTime in the ISO-8601 calendar +>Temporal.Now.plainDateTimeISO() : Temporal.PlainDateTime +> : ^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.Now.plainDateTimeISO : (timeZone?: Temporal.TimeZoneLike) => Temporal.PlainDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Temporal.Now : typeof Temporal.Now +> : ^^^^^^^^^^^^^^^^^^^ +>Temporal : typeof Temporal +> : ^^^^^^^^^^^^^^^ +>Now : typeof Temporal.Now +> : ^^^^^^^^^^^^^^^^^^^ +>plainDateTimeISO : (timeZone?: Temporal.TimeZoneLike) => Temporal.PlainDateTime +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +} + diff --git a/tests/cases/compiler/temporal.ts b/tests/cases/compiler/temporal.ts new file mode 100644 index 0000000000000..7d5321a2d1457 --- /dev/null +++ b/tests/cases/compiler/temporal.ts @@ -0,0 +1,1823 @@ +// @target: es2020 +// @lib: es6,es2021.intl,esnext.date,esnext.intl,esnext.temporal,dom +// @strict: true + +/** + * Test cases derived from documentation at tc39/proposal-temporal, + * under the following license: + * + * Copyright 2017, 2018, 2019, 2020 ECMA International + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH + * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, + * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM + * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR + * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. + */ + +{ + const instant = Temporal.Instant.from("2020-01-01T00:00+05:30"); // => 2019-12-31T18:30:00Z + instant.epochNanoseconds; // => 1577817000000000000n + + // `Temporal.Instant` lacks properties that depend on time zone or calendar + instant.year; // => undefined + + const zdtTokyo = instant.toZonedDateTimeISO("Asia/Tokyo"); // => 2020-01-01T03:30:00+09:00[Asia/Tokyo] + zdtTokyo.year; // => 2020 + zdtTokyo.toPlainDate(); // => 2020-01-01 +} + +{ + // Convert from `Temporal.Instant` to `Date` (which uses millisecond precision) + const instant = Temporal.Instant.from("2020-01-01T00:00:00.123456789+05:30"); + // => 2019-12-31T18:30:00.123456789Z + const date = new Date(instant.epochMilliseconds); + date.toISOString(); // => 2019-12-31T18:30:00.123Z + + // Convert from `Date` to `Temporal.Instant` + const sameInstant = date.toTemporalInstant(); // => 2019-12-31T18:30:00.123Z +} + +{ + const date = new Date(2019, 11, 31, 18, 30); // => Tue Dec 31 2019 18:30:00 GMT-0800 (Pacific Standard Time) + const instant = date.toTemporalInstant(); // => 2020-01-01T02:30:00Z + const zonedDateTime = instant.toZonedDateTimeISO(Temporal.Now.timeZoneId()); + // => 2019-12-31T18:30:00-08:00[America/Los_Angeles] + zonedDateTime.day; // => 31 + const dateOnly = zonedDateTime.toPlainDate(); // => 2019-12-31 +} + +{ + const instant = new Temporal.Instant(1553906700000000000n); + // When was the Unix epoch? + const epoch = new Temporal.Instant(0n); // => 1970-01-01T00:00:00Z + // Dates before the Unix epoch are negative + const turnOfTheCentury = new Temporal.Instant(-2208988800000000000n); // => 1900-01-01T00:00:00Z +} + +{ + let instant: Temporal.Instant; + instant = Temporal.Instant.from("2019-03-30T01:45:00+01:00[Europe/Berlin]"); + instant = Temporal.Instant.from("2019-03-30T01:45+01:00"); + instant = Temporal.Instant.from("2019-03-30T00:45Z"); + instant === Temporal.Instant.from(instant); // => false +} + +{ + const legacyDate = new Date("1995-12-17T03:24Z"); + let instant: Temporal.Instant; + instant = Temporal.Instant.fromEpochMilliseconds(legacyDate.getTime()); // => 1995-12-17T03:24:00Z + instant = Temporal.Instant.fromEpochMilliseconds(legacyDate); // valueOf() called implicitly + instant = legacyDate.toTemporalInstant(); // recommended +} + +{ + const one = Temporal.Instant.fromEpochMilliseconds(1.0e12); + const two = Temporal.Instant.fromEpochMilliseconds(1.1e12); + const three = Temporal.Instant.fromEpochMilliseconds(1.2e12); + const sorted = [three, one, two].sort(Temporal.Instant.compare); + sorted.join(" "); + // => '2001-09-09T01:46:40Z 2004-11-09T11:33:20Z 2008-01-10T21:20:00Z' +} + +{ + const instant = Temporal.Instant.from("2019-03-30T00:45Z"); + new Date(instant.epochMilliseconds); // => 2019-03-30T00:45:00.000Z + + // If you need epoch seconds data: + const epochSecs = Math.floor(instant.epochMilliseconds / 1000); // => 1553906700 + + const ns = instant.epochNanoseconds; + const epochMicros = ns / 1000n + ((ns % 1000n) < 0n ? -1n : 0n); +} + +{ + // Converting a specific exact time to a calendar date / wall-clock time + let timestamp: Temporal.Instant; + timestamp = Temporal.Instant.fromEpochMilliseconds(1553993100_000); + timestamp.toZonedDateTimeISO("Europe/Berlin"); // => 2019-03-31T01:45:00+01:00[Europe/Berlin] + timestamp.toZonedDateTimeISO("UTC"); // => 2019-03-31T00:45:00+00:00[UTC] + timestamp.toZonedDateTimeISO("-08:00"); // => 2019-03-30T16:45:00-08:00[-08:00] + + // What time was the Unix epoch (timestamp 0) in Bell Labs (Murray Hill, New Jersey, USA) in the Gregorian calendar? + const epoch = Temporal.Instant.fromEpochMilliseconds(0); + epoch.toZonedDateTimeISO("America/New_York").withCalendar("gregory"); + // => 1969-12-31T19:00:00-05:00[America/New_York][u-ca=gregory] + + // What time was the Unix epoch in Tokyo in the Japanese calendar? + const zdt = epoch.toZonedDateTimeISO("Asia/Tokyo").withCalendar("japanese"); + // => 1970-01-01T09:00:00+09:00[Asia/Tokyo][u-ca=japanese] + console.log(zdt.eraYear, zdt.era); + // => '45 showa' +} + +{ + // Temporal.Instant representing five hours from now + Temporal.Now.instant().add({ hours: 5 }); + const fiveHours = Temporal.Duration.from({ hours: 5 }); + Temporal.Now.instant().add(fiveHours); +} + +{ + // Temporal.Instant representing this time an hour ago + Temporal.Now.instant().subtract({ hours: 1 }); + const oneHour = Temporal.Duration.from({ hours: 1 }); + Temporal.Now.instant().subtract(oneHour); +} + +{ + const startOfMoonMission = Temporal.Instant.from("1969-07-16T13:32:00Z"); + const endOfMoonMission = Temporal.Instant.from("1969-07-24T16:50:35Z"); + const missionLength = startOfMoonMission.until(endOfMoonMission, { largestUnit: "hour" }); + // => PT195H18M35S + missionLength.toLocaleString(); + // example output: '195 hours 18 minutes 35 seconds' + + // Rounding, for example if you don't care about the minutes and seconds + const approxMissionLength = startOfMoonMission.until(endOfMoonMission, { + largestUnit: "hour", + smallestUnit: "hour", + }); + // => PT195H + + // A billion (10^9) seconds since the epoch in different units + const epoch = Temporal.Instant.fromEpochMilliseconds(0); + const billion = Temporal.Instant.fromEpochMilliseconds(1e9); + epoch.until(billion); + // => PT1000000000S + epoch.until(billion, { largestUnit: "hour" }); + // => PT277777H46M40S + const ns = epoch.until(billion, { largestUnit: "nanosecond" }); + // => PT1000000000S + ns.add({ nanoseconds: 1 }); + // => PT1000000000S + // (lost precision) + + // Calculate the difference in years, eliminating the ambiguity by + // explicitly using the corresponding calendar date in UTC: + epoch.toZonedDateTimeISO("UTC").until( + billion.toZonedDateTimeISO("UTC"), + { largestUnit: "year" }, + ); + // => P31Y8M8DT1H46M40S +} + +{ + const instant = Temporal.Instant.from("2019-03-30T02:45:59.999999999Z"); + + // Round to a particular unit + instant.round({ smallestUnit: "second" }); // => 2019-03-30T02:46:00Z + // Round to an increment of a unit, e.g. an hour: + instant.round({ roundingIncrement: 60, smallestUnit: "minute" }); + // => 2019-03-30T03:00:00Z + // Round to the same increment but round down instead: + instant.round({ roundingIncrement: 60, smallestUnit: "minute", roundingMode: "floor" }); + // => 2019-03-30T02:00:00Z +} + +{ + const one = Temporal.Instant.fromEpochMilliseconds(1.0e12); + const two = Temporal.Instant.fromEpochMilliseconds(1.1e12); + one.equals(two); // => false + one.equals(one); // => true +} + +{ + const instant = Temporal.Instant.fromEpochMilliseconds(1574074321816); + instant.toString(); // => '2019-11-18T10:52:01.816Z' + instant.toString({ timeZone: "UTC" }); + // => '2019-11-18T10:52:01.816+00:00' + instant.toString({ timeZone: "Asia/Seoul" }); + // => '2019-11-18T19:52:01.816+09:00' + + instant.toString({ smallestUnit: "minute" }); + // => '2019-11-18T10:52Z' + instant.toString({ fractionalSecondDigits: 0 }); + // => '2019-11-18T10:52:01Z' + instant.toString({ fractionalSecondDigits: 4 }); + // => '2019-11-18T10:52:01.8160Z' + instant.toString({ smallestUnit: "second", roundingMode: "halfExpand" }); + // => '2019-11-18T10:52:02Z' +} + +{ + const instant = Temporal.Instant.from("2019-11-18T11:00:00.000Z"); + instant.toLocaleString(); // example output: '2019-11-18, 3:00:00 a.m.' + instant.toLocaleString("de-DE"); // example output: '18.11.2019, 03:00:00' + instant.toLocaleString("de-DE", { + timeZone: "Europe/Berlin", + year: "numeric", + month: "numeric", + day: "numeric", + hour: "numeric", + minute: "numeric", + timeZoneName: "long", + }); // => '18.11.2019, 12:00 Mitteleuropäische Normalzeit' + instant.toLocaleString("en-US-u-nu-fullwide-hc-h12", { + timeZone: "Asia/Kolkata", + }); // => '11/18/2019, 4:30:00 PM' +} + +{ + // UNIX epoch in California + new Temporal.ZonedDateTime(0n, "America/Los_Angeles", "iso8601"); + // => 1969-12-31T16:00:00-08:00[America/Los_Angeles] + new Temporal.ZonedDateTime(0n, "America/Los_Angeles"); + // => 1969-12-31T16:00:00-08:00[America/Los_Angeles] + // same, but shorter +} + +{ + let zdt: Temporal.ZonedDateTime; + + zdt = Temporal.ZonedDateTime.from("1995-12-07T03:24:30+02:00[Africa/Cairo]"); + zdt = Temporal.ZonedDateTime.from("1995-12-07T03:24:30+02:00[Africa/Cairo][u-ca=islamic]"); + zdt = Temporal.ZonedDateTime.from("19951207T032430+0200[Africa/Cairo]"); + + zdt = Temporal.ZonedDateTime.from({ + timeZone: "America/Los_Angeles", + year: 1995, + month: 12, + day: 7, + hour: 3, + minute: 24, + second: 30, + millisecond: 0, + microsecond: 3, + nanosecond: 500, + }); // => 1995-12-07T03:24:30.0000035-08:00[America/Los_Angeles] + + // Different overflow modes + zdt = Temporal.ZonedDateTime.from({ timeZone: "Europe/Paris", year: 2001, month: 13, day: 1 }, { overflow: "constrain" }); + // => 2001-12-01T00:00:00+01:00[Europe/Paris] + zdt = Temporal.ZonedDateTime.from({ timeZone: "Europe/Paris", year: 2001, month: 13, day: 1 }, { overflow: "reject" }); + // => throws RangeError +} + +{ + const arr = [ + Temporal.ZonedDateTime.from("2020-02-01T12:30-05:00[America/Toronto]"), + Temporal.ZonedDateTime.from("2020-02-01T12:30-05:00[America/New_York]"), + Temporal.ZonedDateTime.from("2020-02-01T12:30+01:00[Europe/Brussels]"), + Temporal.ZonedDateTime.from("2020-02-01T12:30+00:00[Europe/London]"), + ]; + const sorted = arr.sort(Temporal.ZonedDateTime.compare); + JSON.stringify(sorted, undefined, 2); + // => + // '[ + // "2020-02-01T12:30+01:00[Europe/Brussels]", + // "2020-02-01T12:30+00:00[Europe/London]", + // "2020-02-01T12:30-05:00[America/Toronto]", + // "2020-02-01T12:30-05:00[America/New_York]" + // ]' +} + +{ + const dt = Temporal.ZonedDateTime.from("1995-12-07T03:24:30.000003500[Europe/Rome]"); + dt.year; // => 1995 + dt.month; // => 12 + dt.monthCode; // => 'M12' + dt.day; // => 7 + dt.hour; // => 3 + dt.minute; // => 24 + dt.second; // => 30 + dt.millisecond; // => 0 + dt.microsecond; // => 3 + dt.nanosecond; // => 500 +} + +{ + const zdt = Temporal.ZonedDateTime.from("2020-02-01T12:30+09:00[Asia/Tokyo]"); + const epochMs = zdt.epochMilliseconds; + // => 1580527800000 + zdt.toInstant().epochMilliseconds; + // => 1580527800000 + const legacyDate = new Date(epochMs); + // => 2020-02-01T03:30:00.000Z + // (if the system time zone is America/Los_Angeles) + const epochNanos = zdt.epochNanoseconds; + // => 1580527800000000000n + + // If you need epoch seconds data: + const epochSecs = Math.floor(zdt.epochMilliseconds / 1000); // => 1553906700 + // => 1580527800 + + // If you need epoch microseconds data: + // (Note the extra check for correct floor rounding with bigints) + const ns = zdt.epochNanoseconds; + const epochMicros = ns / 1000n + ((ns % 1000n) < 0n ? -1n : 0n); + // => 1580527800000000n +} + +{ + const zdt = Temporal.ZonedDateTime.from("1995-12-07T03:24-08:00[America/Los_Angeles]"); + `Time zone is: ${zdt.timeZoneId}`; + // => 'Time zone is: America/Los_Angeles' + zdt.withTimeZone("Asia/Kolkata").timeZoneId; + // => Asia/Kolkata + zdt.withTimeZone("Asia/Calcutta").timeZoneId; + // => Asia/Calcutta (does not follow links in the IANA Time Zone Database) + + zdt.withTimeZone("europe/paris").timeZoneId; + // => Europe/Paris (normalized to match IANA Time Zone Database capitalization) + + zdt.withTimeZone("+05:00").timeZoneId; + // => +05:00 + zdt.withTimeZone("+05").timeZoneId; + // => +05:00 (normalized to ±HH:MM) + zdt.withTimeZone("+0500").timeZoneId; + // => +05:00 (normalized to ±HH:MM) +} + +{ + const date = Temporal.ZonedDateTime.from("-000015-01-01T12:30[Europe/Rome][u-ca=gregory]"); + date.era; + // => 'bce' + date.eraYear; + // => 16 + date.year; + // => -15 +} + +{ + const zdt = Temporal.ZonedDateTime.from("1995-12-07T03:24-08:00[America/Los_Angeles]"); + ["MON", "TUE", "WED", "THU", "FRI", "SAT", "SUN"][zdt.dayOfWeek - 1]; // => 'THU' +} + +{ + const zdt = Temporal.ZonedDateTime.from("1995-12-07T03:24-08:00[America/Los_Angeles]"); + // ISO ordinal date + console.log(zdt.year, zdt.dayOfYear); // => '1995 341' +} + +{ + const zdt = Temporal.ZonedDateTime.from("2022-01-01T03:24-08:00[America/Los_Angeles]"); + // ISO week date + console.log(zdt.yearOfWeek, zdt.weekOfYear, zdt.dayOfWeek); // => '2021 52 6' +} + +{ + const zdt = Temporal.ZonedDateTime.from("1995-12-07T03:24-08:00[America/Los_Angeles]"); + zdt.daysInWeek; // => 7 +} + +{ + // Attempt to write some mnemonic poetry + const monthsByDays: Record = {}; + for (let month = 1; month <= 12; month++) { + const zdt = Temporal.Now.zonedDateTimeISO().with({ month }); + monthsByDays[zdt.daysInMonth] = (monthsByDays[zdt.daysInMonth] || []).concat(zdt); + } + + const strings = monthsByDays[30].map(zdt => zdt.toLocaleString("en", { month: "long" })); + // Shuffle to improve poem as determined empirically + strings.unshift(strings.pop()!); + const format = new Intl.ListFormat("en"); + const poem = `Thirty days hath ${format.format(strings)}`; + + console.log(poem); +} + +{ + const zdt = Temporal.Now.zonedDateTimeISO(); + const percent = zdt.dayOfYear / zdt.daysInYear; + `The year is ${percent.toLocaleString("en", { style: "percent" })} over!`; + // example output: "The year is 10% over!" +} + +{ + const zdt = Temporal.ZonedDateTime.from("1900-01-01T12:00+09:00[Asia/Tokyo]"); + zdt.monthsInYear; // => 12 +} + +{ + // Is this year a leap year? + const zdt = Temporal.Now.zonedDateTimeISO(); + zdt.inLeapYear; // example output: true + // Is 2100 a leap year? (no, because it's divisible by 100 and not 400) + zdt.with({ year: 2100 }).inLeapYear; // => false +} + +{ + const zdt = Temporal.ZonedDateTime.from("2010-11-07T23:00:00-03:30[America/St_Johns]"); + zdt.hoursInDay; // 25 +} + +{ + const zdt = Temporal.ZonedDateTime.from("2020-11-01T01:30-07:00[America/Los_Angeles]"); + zdt.offsetNanoseconds; + // => -25200000000000 + // (-7 * 3600 * 1e9) +} + +{ + const zdt = Temporal.ZonedDateTime.from("2020-11-01T01:30-07:00[America/Los_Angeles]"); + zdt.offset; + // => '-07:00' + zdt.withTimeZone("Asia/Kolkata").offset; + // => '+05:30' + + const minus8Hours = "-08:00"; + const daylightTime0130 = Temporal.ZonedDateTime.from("2020-11-01T01:30-07:00[America/Los_Angeles]"); + // => 2020-11-01T01:30:00-07:00[America/Los_Angeles] + // This is Pacific Daylight Time 1:30AM + const repeated0130 = daylightTime0130.with({ offset: minus8Hours }); + // => 2020-11-01T01:30:00-08:00[America/Los_Angeles] + // This is Pacific Standard Time 1:30AM +} + +{ + const zdt = Temporal.ZonedDateTime.from("1995-12-07T03:24:00-06:00[America/Chicago]"); + zdt.with({ year: 2015, minute: 31 }); // => 2015-12-07T03:31:00-06:00[America/Chicago] +} + +{ + const zdt = Temporal.ZonedDateTime.from("2015-12-07T03:24:30.000003500-08:00[America/Los_Angeles]"); + zdt.withPlainTime({ hour: 10 }); // => 2015-12-07T10:00:00-08:00[America/Los_Angeles] + const time = Temporal.PlainTime.from("11:22"); + zdt.withPlainTime(time); // => 2015-12-07T11:22:00-08:00[America/Los_Angeles] + zdt.withPlainTime("12:34"); // => 2015-12-07T12:34:00-08:00[America/Los_Angeles] + + // easier for chaining + zdt.add({ days: 2, hours: 22 }).withPlainTime("00:00"); // => 2015-12-10T00:00:00-08:00[America/Los_Angeles] +} + +{ + const zdt = Temporal.ZonedDateTime.from("1995-12-07T03:24:30+09:00[Asia/Tokyo]"); + zdt.toString(); // => '1995-12-07T03:24:30+09:00[Asia/Tokyo]' + zdt.withTimeZone("Africa/Accra").toString(); // => '1995-12-06T18:24:30+00:00[Africa/Accra]' +} + +{ + const zdt = Temporal.ZonedDateTime.from("1995-12-07T03:24:30.000003500+09:00[Asia/Tokyo][u-ca=japanese]"); + `${zdt.era} ${zdt.eraYear}`; // => 'heisei 7' + zdt.withCalendar("gregory").eraYear; // => 1995 +} + +{ + const zdt = Temporal.ZonedDateTime.from("2020-03-08T00:00-08:00[America/Los_Angeles]"); + // Add a day to get midnight on the day after DST starts + const laterDay = zdt.add({ days: 1 }); + // => 2020-03-09T00:00:00-07:00[America/Los_Angeles] + // Note that the new offset is different, indicating the result is adjusted for DST. + laterDay.since(zdt, { largestUnit: "hour" }).hours; + // => 23 + // because one clock hour lost to DST + + const laterHours = zdt.add({ hours: 24 }); + // => 2020-03-09T01:00:00-07:00[America/Los_Angeles] + // Adding time units doesn't adjust for DST. Result is 1:00AM: 24 real-world + // hours later because a clock hour was skipped by DST. + laterHours.since(zdt, { largestUnit: "hour" }).hours; // => 24 +} + +{ + const zdt = Temporal.ZonedDateTime.from("2020-03-09T00:00-07:00[America/Los_Angeles]"); + // Add a day to get midnight on the day after DST starts + const earlierDay = zdt.subtract({ days: 1 }); + // => 2020-03-08T00:00:00-08:00[America/Los_Angeles] + // Note that the new offset is different, indicating the result is adjusted for DST. + earlierDay.since(zdt, { largestUnit: "hour" }).hours; + // => -23 + // because one clock hour lost to DST + + const earlierHours = zdt.subtract({ hours: 24 }); + // => 2020-03-07T23:00:00-08:00[America/Los_Angeles] + // Subtracting time units doesn't adjust for DST. Result is 11:00PM: 24 real-world + // hours earlier because a clock hour was skipped by DST. + earlierHours.since(zdt, { largestUnit: "hour" }).hours; // => -24 +} + +{ + const zdt1 = Temporal.ZonedDateTime.from("1995-12-07T03:24:30.000003500+05:30[Asia/Kolkata]"); + const zdt2 = Temporal.ZonedDateTime.from("2019-01-31T15:30+05:30[Asia/Kolkata]"); + zdt1.until(zdt2); + // => PT202956H5M29.9999965S + zdt1.until(zdt2, { largestUnit: "year" }); + // => P23Y1M24DT12H5M29.9999965S + zdt2.until(zdt1, { largestUnit: "year" }); + // => -P23Y1M24DT12H5M29.9999965S + zdt1.until(zdt2, { largestUnit: "nanosecond" }); + // => PT730641929.999996544S + // (precision lost) + + // Rounding, for example if you don't care about sub-seconds + zdt1.until(zdt2, { smallestUnit: "second" }); + // => PT202956H5M29S + + // Months and years can be different lengths + const [jan1, feb1, mar1] = [1, 2, 3].map(month => Temporal.ZonedDateTime.from({ year: 2020, month, day: 1, timeZone: "Asia/Seoul" })); + jan1.until(feb1, { largestUnit: "day" }); // => P31D + jan1.until(feb1, { largestUnit: "month" }); // => P1M + feb1.until(mar1, { largestUnit: "day" }); // => P29D + feb1.until(mar1, { largestUnit: "month" }); // => P1M + jan1.until(mar1, { largestUnit: "day" }); // => P60D +} + +{ + const zdt1 = Temporal.ZonedDateTime.from("1995-12-07T03:24:30.000003500+05:30[Asia/Kolkata]"); + const zdt2 = Temporal.ZonedDateTime.from("2019-01-31T15:30+05:30[Asia/Kolkata]"); + zdt2.since(zdt1); // => PT202956H5M29.9999965S +} + +{ + const zdt = Temporal.ZonedDateTime.from("1995-12-07T03:24:30.000003500-08:00[America/Los_Angeles]"); + + // Round to a particular unit + zdt.round({ smallestUnit: "hour" }); + // => 1995-12-07T03:00:00-08:00[America/Los_Angeles] + // Round to an increment of a unit, e.g. half an hour: + zdt.round({ roundingIncrement: 30, smallestUnit: "minute" }); + // => 1995-12-07T03:30:00-08:00[America/Los_Angeles] + // Round to the same increment but round down instead: + zdt.round({ roundingIncrement: 30, smallestUnit: "minute", roundingMode: "floor" }); + // => 1995-12-07T03:00:00-08:00[America/Los_Angeles] +} + +{ + const zdt = Temporal.ZonedDateTime.from("2015-10-18T12:00-02:00[America/Sao_Paulo]"); + zdt.startOfDay(); // => 2015-10-18T01:00:00-02:00[America/Sao_Paulo] +} + +{ + let duration: Temporal.Duration; + // How long until the next offset change from now, in the current location? + const tz = Temporal.Now.timeZoneId(); + const now = Temporal.Now.zonedDateTimeISO(tz); + const nextTransition = now.getTimeZoneTransition("next"); + duration = nextTransition!.since(now); + duration.toLocaleString(); // output will vary + + // How long until the previous offset change from now, in the current location? + const previousTransition = now.getTimeZoneTransition("previous"); + duration = now.since(previousTransition!); + duration.toLocaleString(); // output will vary +} + +{ + const zdt1 = Temporal.ZonedDateTime.from("1995-12-07T03:24:30.000003500+01:00[Europe/Paris]"); + const zdt2 = Temporal.ZonedDateTime.from("1995-12-07T03:24:30.000003500+01:00[Europe/Brussels]"); + zdt1.equals(zdt2); // => false (same offset but different time zones) + zdt1.equals(zdt1); // => true + + // To compare time zone IDs, use withTimeZone() with each ID on the same + // ZonedDateTime instance, and use equals() to compare + const kolkata = zdt1.withTimeZone("Asia/Kolkata"); + kolkata.equals(zdt1.withTimeZone("Asia/Calcutta")); // => true + + // Offset time zones are never equivalent to named time zones + kolkata.equals(zdt1.withTimeZone("+05:30")); // => false + const zeroOffset = zdt1.withTimeZone("+00:00"); + zeroOffset.equals(zdt1.withTimeZone("UTC")); // => false + + // For offset time zones, any valid format is accepted + zeroOffset.equals(zdt1.withTimeZone("+00:00")); // => true + zeroOffset.equals(zdt1.withTimeZone("+0000")); // => true + zeroOffset.equals(zdt1.withTimeZone("+00")); // => true +} + +{ + let zdt: Temporal.ZonedDateTime; + zdt = Temporal.ZonedDateTime.from({ year: 2019, month: 12, day: 1, hour: 12, timeZone: "Africa/Lagos" }); + zdt.toString(); // => '2019-12-01T12:00:00+01:00[Africa/Lagos]' + zdt = zdt.withCalendar("japanese"); + zdt.toString(); // => '2019-12-01T12:00:00+01:00[Africa/Lagos][u-ca=japanese]' +} + +{ + const zdt = Temporal.ZonedDateTime.from("2019-12-01T12:00+01:00[Europe/Berlin]"); + zdt.toLocaleString(); // example output: 12/1/2019, 12:00:00 PM + zdt.toLocaleString("de-DE"); // => '1.12.2019, 12:00:00 MEZ' + const options = { weekday: "long", year: "numeric", month: "long", day: "numeric" } as const; + zdt.toLocaleString("de-DE", options); // => 'Sonntag, 1. Dezember 2019' + /* WRONG */ zdt.toLocaleString("de-DE", { timeZone: "Pacific/Auckland" }); + // => RangeError: Time zone option Pacific/Auckland does not match actual time zone Europe/Berlin + zdt.withTimeZone("Pacific/Auckland").toLocaleString("de-DE"); // => '2.12.2019, 0:00:00 GMT+13' + zdt.toLocaleString("en-US-u-nu-fullwide-hc-h12"); // => '12/1/2019, 12:00:00 PM GMT+1' +} + +{ + const zdt = Temporal.ZonedDateTime.from("1995-12-07T03:24:30+02:00[Africa/Johannesburg]"); + zdt.toInstant(); // => 1995-12-07T01:24:30Z + zdt.toPlainDateTime(); // => 1995-12-07T03:24:30 + zdt.toPlainDate(); // => 1995-12-07 + zdt.toPlainTime(); // => 03:24:30 + zdt.toPlainDate().toPlainYearMonth(); // => 1995-12 + zdt.toPlainDate().toPlainMonthDay(); // => 12-07 +} + +{ + // Pi day in 2020 + const date = new Temporal.PlainDate(2020, 3, 14); // => 2020-03-14 +} + +{ + let date: Temporal.PlainDate; + + date = Temporal.PlainDate.from("2006-08-24"); // => 2006-08-24 + date = Temporal.PlainDate.from("20060824"); // => 2006-08-24 + date = Temporal.PlainDate.from("2006-08-24T15:43:27"); // => 2006-08-24 + date = Temporal.PlainDate.from("2006-08-24T15:43:27+01:00[Europe/Brussels]"); + // => 2006-08-24 + date === Temporal.PlainDate.from(date); // => false + + date = Temporal.PlainDate.from({ year: 2006, month: 8, day: 24 }); // => 2006-08-24 + date = Temporal.PlainDate.from(Temporal.PlainDateTime.from("2006-08-24T15:43:27")); + // => 2006-08-24 + // same as above; Temporal.PlainDateTime has year, month, and day properties + + date = Temporal.PlainDate.from({ year: 1427, month: 8, day: 1, calendar: "islamic" }); + // => 2006-08-24[u-ca=islamic] + + // Different overflow modes + date = Temporal.PlainDate.from({ year: 2001, month: 13, day: 1 }, { overflow: "constrain" }); + // => 2001-12-01 + date = Temporal.PlainDate.from({ year: 2001, month: 1, day: 32 }, { overflow: "constrain" }); + // => 2001-01-31 + date = Temporal.PlainDate.from({ year: 2001, month: 13, day: 1 }, { overflow: "reject" }); + // => throws + date = Temporal.PlainDate.from({ year: 2001, month: 1, day: 32 }, { overflow: "reject" }); + // => throws +} + +{ + const one = Temporal.PlainDate.from("2006-08-24"); + const two = Temporal.PlainDate.from("2015-07-14"); + const three = Temporal.PlainDate.from("1930-02-18"); + const sorted = [one, two, three].sort(Temporal.PlainDate.compare); + sorted.join(" "); // => '1930-02-18 2006-08-24 2015-07-14' +} + +{ + let date: Temporal.PlainDate; + + date = Temporal.PlainDate.from("2006-08-24"); + date.year; // => 2006 + date.month; // => 8 + date.monthCode; // => 'M08' + date.day; // => 24 + + date = Temporal.PlainDate.from("2019-02-23[u-ca=hebrew]"); + date.year; // => 5779 + date.month; // => 6 + date.monthCode; // => 'M05L' + date.day; // => 18 +} + +{ + const date = Temporal.PlainDate.from("-000015-01-01[u-ca=gregory]"); + date.era; + // => 'bce' + date.eraYear; + // => 16 + date.year; + // => -15 +} + +{ + const date = Temporal.PlainDate.from("2006-08-24"); + ["MON", "TUE", "WED", "THU", "FRI", "SAT", "SUN"][date.dayOfWeek - 1]; // => 'THU' +} + +{ + const date = Temporal.PlainDate.from("2006-08-24"); + // ISO ordinal date + console.log(date.year, date.dayOfYear); // => '2006 236' +} + +{ + const date = Temporal.PlainDate.from("2022-01-01"); + // ISO week date + console.log(date.yearOfWeek, date.weekOfYear, date.dayOfWeek); // => '2021 52 6' +} + +{ + const date = Temporal.PlainDate.from("2006-08-24"); + date.daysInWeek; // => 7 +} + +{ + // Attempt to write some mnemonic poetry + const monthsByDays: Record = {}; + for (let month = 1; month <= 12; month++) { + const date = Temporal.Now.plainDateISO().with({ month }); + monthsByDays[date.daysInMonth] = (monthsByDays[date.daysInMonth] || []).concat(date); + } + + const strings = monthsByDays[30].map(date => date.toLocaleString("en", { month: "long" })); + // Shuffle to improve poem as determined empirically + strings.unshift(strings.pop()!); + const format = new Intl.ListFormat("en"); + const poem = `Thirty days hath ${format.format(strings)}`; + + console.log(poem); +} + +{ + const date = Temporal.Now.plainDateISO(); + const percent = date.dayOfYear / date.daysInYear; + `The year is ${percent.toLocaleString("en", { style: "percent" })} over!`; + // example output: "The year is 10% over!" +} + +{ + const date = Temporal.PlainDate.from("1900-01-01"); + date.monthsInYear; // => 12 +} + +{ + // Is this year a leap year? + const date = Temporal.Now.plainDateISO(); + date.inLeapYear; // example output: true + // Is 2100 a leap year? (no, because it's divisible by 100 and not 400) + date.with({ year: 2100 }).inLeapYear; // => false +} + +{ + const date = Temporal.PlainDate.from("2006-01-24"); + // What's the first day of this month? + date.with({ day: 1 }); // => 2006-01-01 + // What's the last day of the next month? + const nextMonthDate = date.add({ months: 1 }); + nextMonthDate.with({ day: nextMonthDate.daysInMonth }); // => 2006-02-28 +} + +{ + const date = Temporal.PlainDate.from("2006-08-24[u-ca=japanese]"); + date.withCalendar("iso8601"); // => 2006-08-24 +} + +{ + let date: Temporal.PlainDate; + + date = Temporal.PlainDate.from("2006-08-24"); + date.add({ years: 20, months: 4 }); // => 2026-12-24 + + date = Temporal.PlainDate.from("2019-01-31"); + date.add({ months: 1 }); // => 2019-02-28 + date.add({ months: 1 }, { overflow: "reject" }); // => throws +} + +{ + let date: Temporal.PlainDate; + + date = Temporal.PlainDate.from("2006-08-24"); + date.subtract({ years: 20, months: 4 }); // => 1986-04-24 + + date = Temporal.PlainDate.from("2019-03-31"); + date.subtract({ months: 1 }); // => 2019-02-28 + date.subtract({ months: 1 }, { overflow: "reject" }); // => throws +} + +{ + const earlier = Temporal.PlainDate.from("2006-08-24"); + const later = Temporal.PlainDate.from("2019-01-31"); + earlier.until(later); // => P4543D + earlier.until(later, { largestUnit: "year" }); // => P12Y5M7D + later.until(earlier, { largestUnit: "year" }); // => -P12Y5M7D + + // If you really need to calculate the difference between two Dates in + // hours, you can eliminate the ambiguity by explicitly choosing the + // point in time from which you want to reckon the difference. For + // example, using noon: + const noon = Temporal.PlainTime.from("12:00"); + earlier.toPlainDateTime(noon).until(later.toPlainDateTime(noon), { largestUnit: "hour" }); + // => PT109032H + + const newyear = Temporal.PlainDate.from("2020-01-01"); + newyear.until("2020-01-15", { smallestUnit: "month", roundingMode: "halfExpand" }); + // => PT0S + newyear.until("2020-01-16", { smallestUnit: "month", roundingMode: "halfExpand" }); + // => PT0S (mid-month dates rounded down to match `Temporal.PlainDateTime` behavior) + newyear.until("2020-01-17", { smallestUnit: "month", roundingMode: "halfExpand" }); + // => PT1M +} + +{ + const earlier = Temporal.PlainDate.from("2006-08-24"); + const later = Temporal.PlainDate.from("2019-01-31"); + later.since(earlier); // => P4543D +} + +{ + const date = Temporal.PlainDate.from("2006-08-24"); + const other = Temporal.PlainDate.from("2019-01-31"); + date.equals(other); // => false + date.equals(date); // => true +} + +{ + const date = Temporal.PlainDate.from("2006-08-24"); + date.toString(); // => '2006-08-24' +} + +{ + const date = Temporal.PlainDate.from("2006-08-24"); + date.toLocaleString(); // example output: 8/24/2006 + date.toLocaleString("de-DE"); // example output: '24.8.2006' + date.toLocaleString("de-DE", { weekday: "long" }); // => 'Donnerstag' + date.toLocaleString("en-US-u-nu-fullwide"); // => '8/24/2006' +} + +{ + const plainDate = Temporal.PlainDate.from("2006-08-24"); + const plainTime = Temporal.PlainTime.from("15:23:30.003"); + plainDate.toZonedDateTime({ timeZone: "America/Los_Angeles", plainTime }); + // => 2006-08-24T15:23:30.003-07:00[America/Los_Angeles] + plainDate.toZonedDateTime({ timeZone: "America/Los_Angeles" }); + // => 2006-08-24T00:00:00-07:00[America/Los_Angeles] +} + +{ + const date = Temporal.PlainDate.from("2006-08-24"); + const time = Temporal.PlainTime.from("15:23:30.003"); + date.toPlainDateTime(time); // => 2006-08-24T15:23:30.003 + date.toPlainDateTime(); // => 2006-08-24T00:00:00 +} + +{ + const date = Temporal.PlainDate.from("2006-08-24"); + date.toPlainYearMonth(); // => 2006-08 + date.toPlainMonthDay(); // => 08-24 +} + +{ + // Leet hour + const time = new Temporal.PlainTime(13, 37); // => 13:37:00 +} + +{ + let time: Temporal.PlainTime; + + time = Temporal.PlainTime.from("03:24:30"); // => 03:24:30 + time = Temporal.PlainTime.from("032430"); // => 03:24:30 + time = Temporal.PlainTime.from("1995-12-07T03:24:30"); // => 03:24:30 + time = Temporal.PlainTime.from("1995-12-07T03:24:30+01:00[Europe/Brussels]"); + // => 03:24:30 + // (same as above; time zone is ignored) + time === Temporal.PlainTime.from(time); // => false + + time = Temporal.PlainTime.from({ + hour: 19, + minute: 39, + second: 9, + millisecond: 68, + microsecond: 346, + nanosecond: 205, + }); // => 19:39:09.068346205 + time = Temporal.PlainTime.from({ hour: 19, minute: 39, second: 9 }); // => 19:39:09 + time = Temporal.PlainTime.from(Temporal.PlainDateTime.from("2020-02-15T19:39:09")); + // => 19:39:09 + // (same as above; Temporal.PlainDateTime has hour, minute, etc. properties) + + // Different overflow modes + time = Temporal.PlainTime.from({ hour: 15, minute: 60 }, { overflow: "constrain" }); + // => 15:59:00 + time = Temporal.PlainTime.from({ hour: 15, minute: -1 }, { overflow: "constrain" }); + // => 15:00:00 + time = Temporal.PlainTime.from({ hour: 15, minute: 60 }, { overflow: "reject" }); + // => throws + time = Temporal.PlainTime.from({ hour: 15, minute: -1 }, { overflow: "reject" }); + // => throws +} + +{ + const one = Temporal.PlainTime.from("03:24"); + const two = Temporal.PlainTime.from("01:24"); + const three = Temporal.PlainTime.from("01:24:05"); + const sorted = [one, two, three].sort(Temporal.PlainTime.compare); + sorted.join(" "); // => '01:24:00 01:24:05 03:24:00' +} + +{ + // Backward transitions will repeat clock times + const zdtDst = Temporal.ZonedDateTime.from("2020-11-01T01:45-07:00[America/Los_Angeles]"); + const zdtStandard = Temporal.ZonedDateTime.from("2020-11-01T01:30-08:00[America/Los_Angeles]"); + // The "first" 1:45 (in Daylight Time) is earlier than the "second" 1:30 (in Standard Time) + Temporal.ZonedDateTime.compare(zdtDst, zdtStandard); // => -1 + // 1:45 is later than 1:30 when looking at a wall clock + Temporal.PlainTime.compare(zdtDst, zdtStandard); // => 1 + + // Forward transitions will skip clock times. Skipped times will be disambiguated. + const zdtBase = Temporal.ZonedDateTime.from("2020-03-08[America/Los_Angeles]"); + const timeSkipped = Temporal.PlainTime.from("02:30"); + const timeValid = Temporal.PlainTime.from("03:30"); + const zdtSkipped = zdtBase.withPlainTime(timeSkipped); + const zdtValid = zdtBase.withPlainTime(timeValid); + // The skipped time 2:30AM is disambiguated to 3:30AM, so the instants are equal + Temporal.ZonedDateTime.compare(zdtSkipped, zdtValid); // => 0 + // 2:30 is earlier than 3:30 on a wall clock + Temporal.PlainTime.compare(timeSkipped, timeValid); // => -1 +} + +{ + const time = Temporal.PlainTime.from("19:39:09.068346205"); + time.hour; // => 19 + time.minute; // => 39 + time.second; // => 9 + time.millisecond; // => 68 + time.microsecond; // => 346 + time.nanosecond; // => 205 +} + +{ + const time = Temporal.PlainTime.from("19:39:09.068346205"); + // What's the top of the next hour? + time.add({ hours: 1 }).with({ + minute: 0, + second: 0, + millisecond: 0, + microsecond: 0, + nanosecond: 0, + }); // => 20:00:00 +} + +{ + const time = Temporal.PlainTime.from("19:39:09.068346205"); + time.add({ minutes: 5, nanoseconds: 800 }); // => 19:44:09.068347005 +} + +{ + const time = Temporal.PlainTime.from("19:39:09.068346205"); + time.subtract({ minutes: 5, nanoseconds: 800 }); // => 19:34:09.068345405 +} + +{ + const time = Temporal.PlainTime.from("20:13:20.971398099"); + time.until(Temporal.PlainTime.from("22:39:09.068346205")); // => PT2H25M48.096948106S + time.until(Temporal.PlainTime.from("19:39:09.068346205")); // => -PT34M11.903051894S + + // Rounding, for example if you don't care about sub-seconds + time.until(Temporal.PlainTime.from("22:39:09.068346205"), { smallestUnit: "second" }); + // => PT2H25M48S +} + +{ + const time = Temporal.PlainTime.from("20:13:20.971398099"); + time.since(Temporal.PlainTime.from("19:39:09.068346205")); // => PT34M11.903051894S + time.since(Temporal.PlainTime.from("22:39:09.068346205")); // => -PT2H25M48.096948106S +} + +{ + const time = Temporal.PlainTime.from("19:39:09.068346205"); + + // Round to a particular unit + time.round({ smallestUnit: "hour" }); // => 20:00:00 + // Round to an increment of a unit, e.g. half an hour: + time.round({ roundingIncrement: 30, smallestUnit: "minute" }); + // => 19:30:00 + // Round to the same increment but round up instead: + time.round({ roundingIncrement: 30, smallestUnit: "minute", roundingMode: "ceil" }); + // => 20:00:00 +} + +{ + const time = Temporal.PlainTime.from("19:39:09.068346205"); + const other = Temporal.PlainTime.from("20:13:20.971398099"); + time.equals(other); // => false + time.equals(time); // => true +} + +{ + const time = Temporal.PlainTime.from("19:39:09.068346205"); + time.toString(); // => '19:39:09.068346205' + + time.toString({ smallestUnit: "minute" }); // => '19:39' + time.toString({ fractionalSecondDigits: 0 }); // => '19:39:09' + time.toString({ fractionalSecondDigits: 4 }); // => '19:39:09.0683' + time.toString({ fractionalSecondDigits: 5, roundingMode: "halfExpand" }); + // => '19:39:09.06835' +} + +{ + const time = Temporal.PlainTime.from("19:39:09.068346205"); + time.toLocaleString(); // example output: '7:39:09 PM' + time.toLocaleString("de-DE"); // example output: '19:39:09' + time.toLocaleString("de-DE", { timeZone: "Europe/Berlin" }); // => '19:39:09' + time.toLocaleString("en-US-u-nu-fullwide-hc-h24"); // => '19:39:09' +} + +{ + // Leet hour on pi day in 2020 + const datetime = new Temporal.PlainDateTime(2020, 3, 14, 13, 37); // => 2020-03-14T13:37:00 +} + +{ + let dt: Temporal.PlainDateTime; + + dt = Temporal.PlainDateTime.from("1995-12-07T03:24:30"); + dt = Temporal.PlainDateTime.from("19951207T032430"); + dt = Temporal.PlainDateTime.from("1995-12-07T03:24:30+01:00[Europe/Brussels]"); + // => 1995-12-07T03:24:30 + // same as above; time zone is ignored + dt === Temporal.PlainDateTime.from(dt); // => false + + dt = Temporal.PlainDateTime.from({ + year: 1995, + month: 12, + day: 7, + hour: 3, + minute: 24, + second: 30, + millisecond: 0, + microsecond: 3, + nanosecond: 500, + }); // => 1995-12-07T03:24:30.0000035 + dt = Temporal.PlainDateTime.from({ year: 1995, month: 12, day: 7 }); // => 1995-12-07T00:00:00 + dt = Temporal.PlainDateTime.from(Temporal.PlainDate.from("1995-12-07T03:24:30")); + // => 1995-12-07T00:00:00 + // same as above; Temporal.PlainDate has year, month, and day properties + + dt = Temporal.PlainDateTime.from({ year: 5756, month: 3, day: 14, hour: 3, minute: 24, second: 30, calendar: "hebrew" }); + // => 1995-12-07T03:24:30[u-ca=hebrew] + + // Different overflow modes + dt = Temporal.PlainDateTime.from({ year: 2001, month: 13, day: 1 }, { overflow: "constrain" }); + // => 2001-12-01T00:00:00 + dt = Temporal.PlainDateTime.from({ year: 2001, month: 1, day: 32 }, { overflow: "constrain" }); + // => 2001-01-31T00:00:00 + dt = Temporal.PlainDateTime.from({ year: 2001, month: 1, day: 1, hour: 25 }, { overflow: "constrain" }); + // => 2001-01-01T23:00:00 + dt = Temporal.PlainDateTime.from({ year: 2001, month: 1, day: 1, minute: 60 }, { overflow: "constrain" }); + // => 2001-01-01T00:59:00 + dt = Temporal.PlainDateTime.from({ year: 2001, month: 13, day: 1 }, { overflow: "reject" }); + // => throws + dt = Temporal.PlainDateTime.from({ year: 2001, month: 1, day: 32 }, { overflow: "reject" }); + // => throws + dt = Temporal.PlainDateTime.from({ year: 2001, month: 1, day: 1, hour: 25 }, { overflow: "reject" }); + // => throws + dt = Temporal.PlainDateTime.from({ year: 2001, month: 1, day: 1, minute: 60 }, { overflow: "reject" }); + // => throws +} + +{ + const one = Temporal.PlainDateTime.from("1995-12-07T03:24"); + const two = Temporal.PlainDateTime.from("1995-12-07T01:24"); + const three = Temporal.PlainDateTime.from("2015-12-07T01:24"); + const sorted = [one, two, three].sort(Temporal.PlainDateTime.compare); + sorted.join(" "); + // => '1995-12-07T01:24:00 1995-12-07T03:24:00 2015-12-07T01:24:00' +} + +{ + let dt: Temporal.PlainDateTime; + + dt = Temporal.PlainDateTime.from("1995-12-07T03:24:30.000003500"); + dt.year; // => 1995 + dt.month; // => 12 + dt.monthCode; // => 'M12' + dt.day; // => 7 + dt.hour; // => 3 + dt.minute; // => 24 + dt.second; // => 30 + dt.millisecond; // => 0 + dt.microsecond; // => 3 + dt.nanosecond; // => 500 + + dt = Temporal.PlainDateTime.from("2019-02-23T03:24:30.000003500[u-ca=hebrew]"); + dt.year; // => 5779 + dt.month; // => 6 + dt.monthCode; // => 'M05L' + dt.day; // => 18 + dt.hour; // => 3 + dt.minute; // => 24 + dt.second; // => 30 + dt.millisecond; // => 0 + dt.microsecond; // => 3 + dt.nanosecond; // => 500 +} + +{ + const date = Temporal.PlainDateTime.from("-000015-01-01T12:30[u-ca=gregory]"); + date.era; + // => 'bce' + date.eraYear; + // => 16 + date.year; + // => -15 +} + +{ + const dt = Temporal.PlainDateTime.from("1995-12-07T03:24:30.000003500"); + ["MON", "TUE", "WED", "THU", "FRI", "SAT", "SUN"][dt.dayOfWeek - 1]; // => 'THU' +} + +{ + const dt = Temporal.PlainDateTime.from("1995-12-07T03:24:30.000003500"); + // ISO ordinal date + console.log(dt.year, dt.dayOfYear); // => '1995 341' +} + +{ + const dt = Temporal.PlainDateTime.from("2022-01-01T03:24:30.000003500"); + // ISO week date + console.log(dt.yearOfWeek, dt.weekOfYear, dt.dayOfWeek); // => '2021 52 6' +} + +{ + const dt = Temporal.PlainDateTime.from("1995-12-07T03:24:30.000003500"); + dt.daysInWeek; // => 7 +} + +{ + // Attempt to write some mnemonic poetry + const monthsByDays: Record = {}; + for (let month = 1; month <= 12; month++) { + const dt = Temporal.Now.plainDateTimeISO().with({ month }); + monthsByDays[dt.daysInMonth] = (monthsByDays[dt.daysInMonth] || []).concat(dt); + } + + const strings = monthsByDays[30].map(dt => dt.toLocaleString("en", { month: "long" })); + // Shuffle to improve poem as determined empirically + strings.unshift(strings.pop()!); + const format = new Intl.ListFormat("en"); + const poem = `Thirty days hath ${format.format(strings)}`; + + console.log(poem); +} + +{ + const dt = Temporal.Now.plainDateTimeISO(); + const percent = dt.dayOfYear / dt.daysInYear; + `The year is ${percent.toLocaleString("en", { style: "percent" })} over!`; + // example output: "The year is 10% over!" +} + +{ + const dt = Temporal.PlainDate.from("1900-01-01T12:00"); + dt.monthsInYear; // => 12 +} + +{ + // Is this year a leap year? + const dt = Temporal.Now.plainDateTimeISO(); + dt.inLeapYear; // example output: true + // Is 2100 a leap year? (no, because it's divisible by 100 and not 400) + dt.with({ year: 2100 }).inLeapYear; // => false +} + +{ + const dt = Temporal.PlainDateTime.from("1995-12-07T03:24:30.000003500"); + dt.with({ year: 2015, second: 31 }); // => 2015-12-07T03:24:31.0000035 +} + +{ + const dt = Temporal.PlainDateTime.from("2015-12-07T03:24:30.000003500"); + dt.withPlainTime({ hour: 10 }); // => 2015-12-07T10:00:00 + const time = Temporal.PlainTime.from("11:22"); + dt.withPlainTime(time); // => 2015-12-07T11:22:00 + dt.withPlainTime("12:34"); // => 2015-12-07T12:34:00 + + // easier for chaining + dt.add({ days: 2, hours: 22 }).withPlainTime("00:00"); // => 2015-12-10T00:00:00 +} + +{ + const dt = Temporal.PlainDateTime.from("1995-12-07T03:24:30.000003500[u-ca=japanese]"); + dt.withCalendar("iso8601"); // => 1995-12-07T03:24:30.0000035 +} + +{ + let dt: Temporal.PlainDateTime; + + dt = Temporal.PlainDateTime.from("1995-12-07T03:24:30.000003500"); + dt.add({ years: 20, months: 4, nanoseconds: 500 }); // => 2016-04-07T03:24:30.000004 + + dt = Temporal.PlainDateTime.from("2019-01-31T15:30"); + dt.add({ months: 1 }); // => 2019-02-28T15:30:00 + dt.add({ months: 1 }, { overflow: "reject" }); // => throws +} + +{ + let dt: Temporal.PlainDateTime; + + dt = Temporal.PlainDateTime.from("1995-12-07T03:24:30.000003500"); + dt.subtract({ years: 20, months: 4, nanoseconds: 500 }); // => 1975-08-07T03:24:30.000003 + + dt = Temporal.PlainDateTime.from("2019-03-31T15:30"); + dt.subtract({ months: 1 }); // => 2019-02-28T15:30:00 + dt.subtract({ months: 1 }, { overflow: "reject" }); // => throws +} + +{ + const dt1 = Temporal.PlainDateTime.from("1995-12-07T03:24:30.000003500"); + const dt2 = Temporal.PlainDateTime.from("2019-01-31T15:30"); + dt1.until(dt2); + // => P8456DT12H5M29.9999965S + dt1.until(dt2, { largestUnit: "year" }); + // => P23Y1M24DT12H5M29.9999965S + dt2.until(dt1, { largestUnit: "year" }); + // => -P23Y1M24DT12H5M29.9999965S + dt1.until(dt2, { largestUnit: "nanosecond" }); + // => PT730641929.999996544S + // (precision lost) + + // Rounding, for example if you don't care about sub-seconds + dt1.until(dt2, { smallestUnit: "second" }); + // => P8456DT12H5M29S + + // Months and years can be different lengths + const [jan1, feb1, mar1] = [1, 2, 3].map(month => Temporal.PlainDateTime.from({ year: 2020, month, day: 1 })); + jan1.until(feb1); // => P31D + jan1.until(feb1, { largestUnit: "month" }); // => P1M + feb1.until(mar1); // => P29D + feb1.until(mar1, { largestUnit: "month" }); // => P1M + jan1.until(mar1); // => P60D +} + +{ + const dt1 = Temporal.PlainDateTime.from("1995-12-07T03:24:30.000003500"); + const dt2 = Temporal.PlainDateTime.from("2019-01-31T15:30"); + dt2.since(dt1); // => P8456DT12H5M29.9999965S +} + +{ + const dt = Temporal.PlainDateTime.from("1995-12-07T03:24:30.000003500"); + + // Round to a particular unit + dt.round({ smallestUnit: "hour" }); // => 1995-12-07T03:00:00 + // Round to an increment of a unit, e.g. half an hour: + dt.round({ roundingIncrement: 30, smallestUnit: "minute" }); + // => 1995-12-07T03:30:00 + // Round to the same increment but round down instead: + dt.round({ roundingIncrement: 30, smallestUnit: "minute", roundingMode: "floor" }); + // => 1995-12-07T03:00:00 +} + +{ + const dt1 = Temporal.PlainDateTime.from("1995-12-07T03:24:30.000003500"); + const dt2 = Temporal.PlainDateTime.from("2019-01-31T15:30"); + dt1.equals(dt2); // => false + dt1.equals(dt1); // => true +} + +{ + const dt = Temporal.PlainDateTime.from({ + year: 1999, + month: 12, + day: 31, + hour: 23, + minute: 59, + second: 59, + millisecond: 999, + microsecond: 999, + nanosecond: 999, + }); + dt.toString(); // => '1999-12-31T23:59:59.999999999' + + dt.toString({ smallestUnit: "minute" }); // => '1999-12-31T23:59' + dt.toString({ fractionalSecondDigits: 0 }); // => '1999-12-31T23:59:59' + dt.toString({ fractionalSecondDigits: 4 }); // => '1999-12-31T23:59:59.9999' + dt.toString({ fractionalSecondDigits: 8, roundingMode: "halfExpand" }); + // => '2000-01-01T00:00:00.00000000' +} + +{ + const dt = Temporal.PlainDateTime.from("1995-12-07T03:24:30.000003500"); + dt.toLocaleString(); // example output: 1995-12-07, 3:24:30 a.m. + dt.toLocaleString("de-DE"); // example output: 7.12.1995, 03:24:30 + dt.toLocaleString("de-DE", { timeZone: "Europe/Berlin", weekday: "long" }); // => 'Donnerstag' + dt.toLocaleString("en-US-u-nu-fullwide-hc-h12"); // => '12/7/1995, 3:24:30 AM' +} + +{ + const dt = Temporal.PlainDateTime.from("1995-12-07T03:24:30.000003500"); + dt.toPlainDate(); // => 1995-12-07 + dt.toPlainTime(); // => 03:24:30.0000035 + dt.toPlainDate().toPlainYearMonth(); // => 1995-12 + dt.toPlainDate().toPlainMonthDay(); // => 12-07 +} + +{ + // The June 2019 meeting + const ym = new Temporal.PlainYearMonth(2019, 6); + // => 2019-06 +} + +{ + let ym: Temporal.PlainYearMonth; + + ym = Temporal.PlainYearMonth.from("2019-06"); // => 2019-06 + ym = Temporal.PlainYearMonth.from("2019-06-24"); // => 2019-06 + ym = Temporal.PlainYearMonth.from("2019-06-24T15:43:27"); // => 2019-06 + ym = Temporal.PlainYearMonth.from("2019-06-24T15:43:27+01:00[Europe/Brussels]"); + // => 2019-06 + ym === Temporal.PlainYearMonth.from(ym); // => false + + ym = Temporal.PlainYearMonth.from({ year: 2019, month: 6 }); // => 2019-06 + ym = Temporal.PlainYearMonth.from(Temporal.PlainDate.from("2019-06-24")); + // => 2019-06 + // (same as above; Temporal.PlainDate has year and month properties) + + // Different overflow modes + ym = Temporal.PlainYearMonth.from({ year: 2001, month: 13 }, { overflow: "constrain" }); + // => 2001-12 + ym = Temporal.PlainYearMonth.from({ year: 2001, month: 13 }, { overflow: "reject" }); + // => throws +} + +{ + const one = Temporal.PlainYearMonth.from("2006-08"); + const two = Temporal.PlainYearMonth.from("2015-07"); + const three = Temporal.PlainYearMonth.from("1930-02"); + const sorted = [one, two, three].sort(Temporal.PlainYearMonth.compare); + sorted.join(" "); // => '1930-02 2006-08 2015-07' +} + +{ + let ym: Temporal.PlainYearMonth; + + ym = Temporal.PlainYearMonth.from("2019-06"); + ym.year; // => 2019 + ym.month; // => 6 + ym.monthCode; // => 'M06' + + ym = Temporal.PlainYearMonth.from("2019-02-23[u-ca=hebrew]"); + ym.year; // => 5779 + ym.month; // => 6 + ym.monthCode; // => 'M05L' +} + +{ + const ym = Temporal.PlainYearMonth.from("-000015-01-01[u-ca=gregory]"); + ym.era; + // => 'bce' + ym.eraYear; + // => 16 + ym.year; + // => -15 +} + +{ + // Attempt to write some mnemonic poetry + const monthsByDays: Record = {}; + for (let month = 1; month <= 12; month++) { + const ym = Temporal.PlainYearMonth.from({ year: 2020, calendar: "iso8601", month }); + monthsByDays[ym.daysInMonth] = (monthsByDays[ym.daysInMonth] || []).concat(ym); + } + + const strings = monthsByDays[30].map(ym => ym.toLocaleString("en", { month: "long", calendar: "iso8601" })); + // Shuffle to improve poem as determined empirically + strings.unshift(strings.pop()!); + const format = new Intl.ListFormat("en"); + const poem = `Thirty days hath ${format.format(strings)}`; + + console.log(poem); +} + +{ + const ym = Temporal.PlainYearMonth.from({ year: 2019, month: 6, calendar: "iso8601" }); + const percent = ym.daysInMonth / ym.daysInYear; + `${ym.toLocaleString("en", { month: "long", year: "numeric", calendar: "iso8601" })} was ${percent.toLocaleString("en", { style: "percent" })} of the year!`; + // => 'June 2019 was 8% of the year!' +} + +{ + const ym = Temporal.PlainYearMonth.from("1900-01"); + ym.monthsInYear; // => 12 +} + +{ + // Was June 2019 in a leap year? + const ym = Temporal.PlainYearMonth.from("2019-06"); + ym.inLeapYear; // => false + // Is 2100 a leap year? (no, because it's divisible by 100 and not 400) + ym.with({ year: 2100 }).inLeapYear; // => false +} + +{ + const ym = Temporal.PlainYearMonth.from("2019-06"); + // Get December of that year + ym.with({ month: 12 }); // => 2019-12 +} + +{ + const ym = Temporal.PlainYearMonth.from("2019-06"); + ym.add({ years: 20, months: 4 }); // => 2039-10 +} + +{ + const ym = Temporal.PlainYearMonth.from("2019-06"); + ym.subtract({ years: 20, months: 4 }); // => 1999-02 +} + +{ + const ym = Temporal.PlainYearMonth.from("2006-08"); + const other = Temporal.PlainYearMonth.from("2019-06"); + ym.until(other); // => P12Y10M + ym.until(other, { largestUnit: "month" }); // => P154M + other.until(ym, { largestUnit: "month" }); // => -P154M + + // If you really need to calculate the difference between two YearMonths + // in days, you can eliminate the ambiguity by explicitly choosing the + // day of the month (and if applicable, the time of that day) from which + // you want to reckon the difference. For example, using the first of + // the month to calculate a number of days: + ym.toPlainDate({ day: 1 }).until(other.toPlainDate({ day: 1 }), { largestUnit: "day" }); // => P4687D +} + +{ + const ym = Temporal.PlainYearMonth.from("2019-06"); + const other = Temporal.PlainYearMonth.from("2006-08"); + ym.since(other); // => P12Y10M +} + +{ + const ym = Temporal.PlainYearMonth.from("2019-06"); + const other = Temporal.PlainYearMonth.from("2006-08"); + ym.equals(other); // => false + ym.equals(ym); // => true +} + +{ + const ym = Temporal.PlainYearMonth.from("2019-06"); + ym.toString(); // => '2019-06' +} + +{ + const { calendar } = new Intl.DateTimeFormat().resolvedOptions(); + const ym = Temporal.PlainYearMonth.from({ year: 2019, month: 6, calendar }); + ym.toLocaleString(); // example output: '6/2019' + // Same as above, but explicitly specifying the calendar: + ym.toLocaleString(undefined, { calendar }); + + ym.toLocaleString("de-DE", { calendar }); // example output: '6.2019' + ym.toLocaleString("de-DE", { month: "long", year: "numeric", calendar }); // => 'Juni 2019' + ym.toLocaleString(`en-US-u-nu-fullwide-ca-${calendar}`); // => '6/2019' +} + +{ + const ym = Temporal.PlainYearMonth.from("2019-06"); + ym.toPlainDate({ day: 24 }); // => 2019-06-24 +} + +{ + let md: Temporal.PlainMonthDay; + + // Pi day + md = new Temporal.PlainMonthDay(3, 14); // => 03-14 + // Leap day + md = new Temporal.PlainMonthDay(2, 29); // => 02-29 +} + +{ + let md: Temporal.PlainMonthDay; + + md = Temporal.PlainMonthDay.from("08-24"); // => 08-24 + md = Temporal.PlainMonthDay.from("0824"); // => 08-24 + md = Temporal.PlainMonthDay.from("2006-08-24"); // => 08-24 + md = Temporal.PlainMonthDay.from("2006-08-24T15:43:27"); // => 08-24 + md = Temporal.PlainMonthDay.from("2006-08-24T15:43:27+01:00[Europe/Brussels]"); + // => 08-24 + md === Temporal.PlainMonthDay.from(md); // => false + + md = Temporal.PlainMonthDay.from({ monthCode: "M08", day: 24 }); // => 08-24 + md = Temporal.PlainMonthDay.from(Temporal.PlainDate.from("2006-08-24")); + // => 08-24 + // (same as above; Temporal.PlainDate has month and day properties) + + // Different overflow modes + md = Temporal.PlainMonthDay.from({ month: 13, day: 1, year: 2000 }, { overflow: "constrain" }); + // => 12-01 + md = Temporal.PlainMonthDay.from({ month: 1, day: 32, year: 2000 }, { overflow: "constrain" }); + // => 01-31 + md = Temporal.PlainMonthDay.from({ month: 13, day: 1, year: 2000 }, { overflow: "reject" }); + // => throws + md = Temporal.PlainMonthDay.from({ month: 1, day: 32, year: 2000 }, { overflow: "reject" }); + // => throws + md = Temporal.PlainMonthDay.from({ month: 2, day: 29, year: 2001 }, { overflow: "reject" }); + // => throws (this year is not a leap year in the ISO 8601 calendar) + + // non-ISO calendars + md = Temporal.PlainMonthDay.from({ monthCode: "M05L", day: 15, calendar: "hebrew" }); + // => 1970-02-21[u-ca=hebrew] + md = Temporal.PlainMonthDay.from({ month: 6, day: 15, year: 5779, calendar: "hebrew" }); + // => 1970-02-21[u-ca=hebrew] + /* WRONG */ md = Temporal.PlainMonthDay.from({ month: 6, day: 15, calendar: "hebrew" }); + // => throws (either year or monthCode is required) + md = Temporal.PlainMonthDay.from("2019-02-20[u-ca=hebrew]"); + md.monthCode; // => 'M05L' + md.day; // => 15 + md.month; // undefined + // (month property is not present in this type; use monthCode instead) +} + +{ + let md: Temporal.PlainMonthDay; + + md = Temporal.PlainMonthDay.from("08-24"); + md.monthCode; // => 'M08' + md.day; // => 24 + md.month; // => undefined + // (no `month` property; use `monthCode` instead) + + md = Temporal.PlainMonthDay.from("2019-02-20[u-ca=hebrew]"); + md.monthCode; // => 'M05L' + md.day; // => 15 + md.month; // => undefined + // (no `month` property; use `monthCode` instead) +} + +{ + const md = Temporal.PlainMonthDay.from("11-15"); + // What's the last day of that month? + md.with({ day: 31 }); // => 11-30 + Temporal.PlainMonthDay.from("02-01").with({ day: 31 }); // => 02-29 +} + +{ + const md1 = Temporal.PlainMonthDay.from("02-28"); + const md2 = Temporal.PlainMonthDay.from("02-29"); + md1.equals(md2); // => false + md1.equals("02-29"); // => false + md1.equals({ monthCode: "M02", day: 29 }); // => false + md2.equals(md2); // => true + md2.equals("02-29"); // => true + md2.equals({ monthCode: "M02", day: 29 }); // => true +} + +{ + const md = Temporal.PlainMonthDay.from("08-24"); + md.toString(); // => '08-24' +} + +{ + const { calendar } = new Intl.DateTimeFormat().resolvedOptions(); + const md = Temporal.PlainMonthDay.from({ monthCode: "M08", day: 24, calendar }); + md.toLocaleString(); // example output: '8/24' + // Same as above, but explicitly specifying the calendar: + md.toLocaleString(undefined, { calendar }); // example output: '8/24' + + md.toLocaleString("de-DE", { calendar }); // => '24.8.' + md.toLocaleString("de-DE", { month: "long", day: "numeric", calendar }); // => '24. August' + md.toLocaleString(`en-US-u-nu-fullwide-ca-${calendar}`); // => '8/24' +} + +{ + const md = Temporal.PlainMonthDay.from({ + calendar: "japanese", + monthCode: "M01", + day: 1, + }); + + const date = md.toPlainDate({ era: "reiwa", eraYear: 2 }); // => 2020-01-01[u-ca=japanese] +} + +{ + new Temporal.Duration(1, 2, 3, 4, 5, 6, 7, 987, 654, 321); // => P1Y2M3W4DT5H6M7.987654321S + new Temporal.Duration(0, 0, 0, 40); // => P40D + new Temporal.Duration(undefined, undefined, undefined, 40); // => P40D + new Temporal.Duration(); // => PT0S +} + +{ + let d: Temporal.Duration; + + d = Temporal.Duration.from({ years: 1, days: 1 }); // => P1Y1D + d = Temporal.Duration.from({ days: -2, hours: -12 }); // => -P2DT12H + + Temporal.Duration.from(d) === d; // => false + + d = Temporal.Duration.from("P1Y1D"); // => P1Y1D + d = Temporal.Duration.from("-P2DT12H"); // => -P2DT12H + d = Temporal.Duration.from("P0D"); // => PT0S +} + +{ + const one = Temporal.Duration.from({ hours: 79, minutes: 10 }); + const two = Temporal.Duration.from({ days: 3, hours: 7, seconds: 630 }); + const three = Temporal.Duration.from({ days: 3, hours: 6, minutes: 50 }); + const sorted1 = [one, two, three].sort(Temporal.Duration.compare); + sorted1.join(" "); + // => 'P3DT6H50M PT79H10M P3DT7H630S' + + // Sorting relative to a date, taking DST changes into account: + const relativeTo = Temporal.ZonedDateTime.from("2020-11-01T00:00-07:00[America/Los_Angeles]"); + const sorted2 = [one, two, three].sort((one, two) => Temporal.Duration.compare(one, two, { relativeTo })); + sorted2.join(" "); + // => 'PT79H10M P3DT6H50M P3DT7H630S' +} + +{ + const d = Temporal.Duration.from("P1Y2M3W4DT5H6M7.987654321S"); + d.years; // => 1 + d.months; // => 2 + d.weeks; // => 3 + d.days; // => 4 + d.hours; // => 5 + d.minutes; // => 6 + d.seconds; // => 7 + d.milliseconds; // => 987 + d.microseconds; // => 654 + d.nanoseconds; // => 321 +} + +{ + let d: Temporal.Duration; + + d = Temporal.Duration.from("PT0S"); + d.blank; // => true + + d = Temporal.Duration.from({ days: 0, hours: 0, minutes: 0 }); + d.blank; // => true +} + +{ + let duration: Temporal.Duration; + + duration = Temporal.Duration.from({ months: 50, days: 50, hours: 50, minutes: 100 }); + // Perform a balance operation using additional ISO 8601 calendar rules: + let { years, months } = duration; + years += Math.floor(months / 12); + months %= 12; + duration = duration.with({ years, months }); + // => P4Y2M50DT50H100M +} + +{ + const hour = Temporal.Duration.from("PT1H"); + hour.add({ minutes: 30 }); // => PT1H30M + + // Examples of balancing: + const one = Temporal.Duration.from({ hours: 1, minutes: 30 }); + const two = Temporal.Duration.from({ hours: 2, minutes: 45 }); + const result = one.add(two); // => PT4H15M + + // Example of adding calendar units + const oneAndAHalfMonth = Temporal.Duration.from({ months: 1, days: 16 }); + + // To convert units, use arithmetic relative to a start date: + const startDate1 = Temporal.PlainDate.from("2000-12-01"); + startDate1.add(oneAndAHalfMonth).add(oneAndAHalfMonth) + .since(startDate1, { largestUnit: "months" }); // => P3M4D + + const startDate2 = Temporal.PlainDate.from("2001-01-01"); + startDate2.add(oneAndAHalfMonth).add(oneAndAHalfMonth) + .since(startDate2, { largestUnit: "months" }); // => P3M1D +} + +{ + const hourAndAHalf = Temporal.Duration.from("PT1H30M"); + hourAndAHalf.subtract({ hours: 1 }); // => PT30M + + const one = Temporal.Duration.from({ minutes: 180 }); + const two = Temporal.Duration.from({ seconds: 30 }); + one.subtract(two); // => PT179M30S + one.subtract(two).round({ largestUnit: "hour" }); // => PT2H59M30S + + // Example of subtracting calendar units; cannot be subtracted using + // subtract() because units need to be converted + const threeMonths = Temporal.Duration.from({ months: 3 }); + const oneAndAHalfMonth = Temporal.Duration.from({ months: 1, days: 15 }); + + // To convert units, use arithmetic relative to a start date: + const startDate1 = Temporal.PlainDate.from("2001-01-01"); + startDate1.add(threeMonths).subtract(oneAndAHalfMonth) + .since(startDate1, { largestUnit: "months" }); // => P1M13D + + const startDate2 = Temporal.PlainDate.from("2001-02-01"); + startDate2.add(threeMonths).subtract(oneAndAHalfMonth) + .since(startDate2, { largestUnit: "months" }); // => P1M16D +} + +{ + const d = Temporal.Duration.from("P1Y2M3DT4H5M6.987654321S"); + d.sign; // 1 + d.negated(); // -P1Y2M3DT4H5M6.987654321S + d.negated().sign; // -1 +} + +{ + const d = Temporal.Duration.from("-PT8H30M"); + d.abs(); // PT8H30M +} + +{ + let d: Temporal.Duration; + + // Balance a duration as far as possible without knowing a starting point + d = Temporal.Duration.from({ minutes: 130 }); + d.round({ largestUnit: "day" }); // => PT2H10M + + // Round to the nearest unit + d = Temporal.Duration.from({ minutes: 10, seconds: 52 }); + d.round({ smallestUnit: "minute" }); // => PT11M + d.round({ smallestUnit: "minute", roundingMode: "trunc" }); // => PT10M + + // How many seconds in a multi-unit duration? + d = Temporal.Duration.from("PT2H34M18S"); + d.round({ largestUnit: "second" }).seconds; // => 9258 + + // Normalize, with and without taking DST into account + d = Temporal.Duration.from({ hours: 2756 }); + d.round({ + relativeTo: "2020-01-01T00:00+01:00[Europe/Rome]", + largestUnit: "year", + }); // => P114DT21H + // (one hour longer because DST skipped an hour) + d.round({ + relativeTo: "2020-01-01", + largestUnit: "year", + }); // => P114DT20H + // (one hour shorter if ignoring DST) + + // Normalize days into months or years + d = Temporal.Duration.from({ days: 190 }); + const refDate = Temporal.PlainDate.from("2020-01-01"); + d.round({ relativeTo: refDate, largestUnit: "year" }); // => P6M8D + + // Same, but in a different calendar system + d.round({ + relativeTo: refDate.withCalendar("hebrew"), + largestUnit: "year", + }); // => P6M13D + + // Round a duration up to the next 5-minute billing period + d = Temporal.Duration.from({ minutes: 6 }); + d.round({ + smallestUnit: "minute", + roundingIncrement: 5, + roundingMode: "ceil", + }); // => PT10M + + // How many full 3-month quarters of this year, are in this duration? + d = Temporal.Duration.from({ months: 10, days: 15 }); + d = d.round({ + smallestUnit: "month", + roundingIncrement: 3, + roundingMode: "trunc", + relativeTo: Temporal.Now.plainDateISO(), + }); + const quarters = d.months / 3; + quarters; // => 3 +} + +{ + let d: Temporal.Duration; + + // How many seconds in 130 hours and 20 minutes? + d = Temporal.Duration.from({ hours: 130, minutes: 20 }); + d.total({ unit: "second" }); // => 469200 + + // How many 24-hour days is 123456789 seconds? + d = Temporal.Duration.from("PT123456789S"); + d.total({ unit: "day" }); // 1428.8980208333332 + + // Find totals in months, with and without taking DST into account + d = Temporal.Duration.from({ hours: 2756 }); + d.total({ + relativeTo: "2020-01-01T00:00+01:00[Europe/Rome]", + unit: "month", + }); // => 3.7958333333333334 + d.total({ + unit: "month", + relativeTo: "2020-01-01", + }); // => 3.7944444444444443 +} + +{ + let d: Temporal.Duration; + + d = Temporal.Duration.from({ years: 1, days: 1 }); + d.toString(); // => P1Y1D + d = Temporal.Duration.from({ years: -1, days: -1 }); + d.toString(); // => -P1Y1D + d = Temporal.Duration.from({ milliseconds: 1000 }); + d.toString(); // => PT1S + + // The output format always balances units under 1 s, even if the + // underlying Temporal.Duration object doesn't. + const nobal = Temporal.Duration.from({ milliseconds: 3500 }); + console.log(`${nobal}`, nobal.seconds, nobal.milliseconds); // => 'PT3.5S 0 3500' + const bal = nobal.round({ largestUnit: "year" }); // balance through round + console.log(`${bal}`, bal.seconds, bal.milliseconds); // => 'PT3.5S 3 500' + + d = Temporal.Duration.from("PT59.999999999S"); + d.toString({ smallestUnit: "second" }); // => PT59S + d.toString({ fractionalSecondDigits: 0 }); // => PT59S + d.toString({ fractionalSecondDigits: 4 }); // => PT59.9999S + d.toString({ fractionalSecondDigits: 8, roundingMode: "halfExpand" }); + // => PT60.00000000S +} + +{ + const d = Temporal.Duration.from("P1DT6H30M"); + d.toLocaleString(); // example output: '1 day 6 hours 30 minutes' + d.toLocaleString("de-DE"); // example output: '1 Tag 6 Stunden 30 Minuten' + d.toLocaleString("en-US", { days: "short", hours: "numeric" }); // example output: '1 day 6 hours' +} + +{ + Temporal.Now.instant(); // get the current system exact time + Temporal.Now.timeZoneId(); // get the current system time zone + Temporal.Now.zonedDateTimeISO(); // get the current date and wall-clock time in the system time zone and ISO-8601 calendar + Temporal.Now.plainDateISO(); // get the current date in the system time zone and ISO-8601 calendar + Temporal.Now.plainTimeISO(); // get the current wall-clock time in the system time zone and ISO-8601 calendar + Temporal.Now.plainDateTimeISO(); // same as above, but return the DateTime in the ISO-8601 calendar +} From ca43d7a1f1f150bb5dca222b41dc8ad72b8b9a2c Mon Sep 17 00:00:00 2001 From: Renegade334 Date: Sat, 7 Feb 2026 00:47:38 +0000 Subject: [PATCH 8/8] remove implicit coercion test --- tests/baselines/reference/temporal.errors.txt | 12 +- tests/baselines/reference/temporal.js | 2 - tests/baselines/reference/temporal.symbols | 3037 ++++++++--------- tests/baselines/reference/temporal.types | 20 - tests/cases/compiler/temporal.ts | 1 - 5 files changed, 1518 insertions(+), 1554 deletions(-) diff --git a/tests/baselines/reference/temporal.errors.txt b/tests/baselines/reference/temporal.errors.txt index fcbaab22e4c23..5ab55589f8214 100644 --- a/tests/baselines/reference/temporal.errors.txt +++ b/tests/baselines/reference/temporal.errors.txt @@ -1,11 +1,10 @@ temporal.ts(25,13): error TS2339: Property 'year' does not exist on type 'Instant'. -temporal.ts(72,54): error TS2345: Argument of type 'Date' is not assignable to parameter of type 'number'. -temporal.ts(1503,8): error TS2339: Property 'month' does not exist on type 'PlainMonthDay'. -temporal.ts(1513,8): error TS2339: Property 'month' does not exist on type 'PlainMonthDay'. -temporal.ts(1519,8): error TS2339: Property 'month' does not exist on type 'PlainMonthDay'. +temporal.ts(1502,8): error TS2339: Property 'month' does not exist on type 'PlainMonthDay'. +temporal.ts(1512,8): error TS2339: Property 'month' does not exist on type 'PlainMonthDay'. +temporal.ts(1518,8): error TS2339: Property 'month' does not exist on type 'PlainMonthDay'. -==== temporal.ts (5 errors) ==== +==== temporal.ts (4 errors) ==== /** * Test cases derived from documentation at tc39/proposal-temporal, * under the following license: @@ -79,9 +78,6 @@ temporal.ts(1519,8): error TS2339: Property 'month' does not exist on type 'Plai const legacyDate = new Date("1995-12-17T03:24Z"); let instant: Temporal.Instant; instant = Temporal.Instant.fromEpochMilliseconds(legacyDate.getTime()); // => 1995-12-17T03:24:00Z - instant = Temporal.Instant.fromEpochMilliseconds(legacyDate); // valueOf() called implicitly - ~~~~~~~~~~ -!!! error TS2345: Argument of type 'Date' is not assignable to parameter of type 'number'. instant = legacyDate.toTemporalInstant(); // recommended } diff --git a/tests/baselines/reference/temporal.js b/tests/baselines/reference/temporal.js index ba0634e9b8cd2..5e88e5df300f3 100644 --- a/tests/baselines/reference/temporal.js +++ b/tests/baselines/reference/temporal.js @@ -72,7 +72,6 @@ const legacyDate = new Date("1995-12-17T03:24Z"); let instant: Temporal.Instant; instant = Temporal.Instant.fromEpochMilliseconds(legacyDate.getTime()); // => 1995-12-17T03:24:00Z - instant = Temporal.Instant.fromEpochMilliseconds(legacyDate); // valueOf() called implicitly instant = legacyDate.toTemporalInstant(); // recommended } @@ -1886,7 +1885,6 @@ const legacyDate = new Date("1995-12-17T03:24Z"); let instant; instant = Temporal.Instant.fromEpochMilliseconds(legacyDate.getTime()); // => 1995-12-17T03:24:00Z - instant = Temporal.Instant.fromEpochMilliseconds(legacyDate); // valueOf() called implicitly instant = legacyDate.toTemporalInstant(); // recommended } { diff --git a/tests/baselines/reference/temporal.symbols b/tests/baselines/reference/temporal.symbols index d3c5080ad61da..bcd445fd8c059 100644 --- a/tests/baselines/reference/temporal.symbols +++ b/tests/baselines/reference/temporal.symbols @@ -204,15 +204,6 @@ >legacyDate : Symbol(legacyDate, Decl(temporal.ts, 68, 9)) >getTime : Symbol(Date.getTime, Decl(lib.es5.d.ts, --, --)) - instant = Temporal.Instant.fromEpochMilliseconds(legacyDate); // valueOf() called implicitly ->instant : Symbol(instant, Decl(temporal.ts, 69, 7)) ->Temporal.Instant.fromEpochMilliseconds : Symbol(Temporal.InstantConstructor.fromEpochMilliseconds, Decl(lib.esnext.temporal.d.ts, --, --)) ->Temporal.Instant : Symbol(Temporal.Instant, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) ->Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) ->Instant : Symbol(Temporal.Instant, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) ->fromEpochMilliseconds : Symbol(Temporal.InstantConstructor.fromEpochMilliseconds, Decl(lib.esnext.temporal.d.ts, --, --)) ->legacyDate : Symbol(legacyDate, Decl(temporal.ts, 68, 9)) - instant = legacyDate.toTemporalInstant(); // recommended >instant : Symbol(instant, Decl(temporal.ts, 69, 7)) >legacyDate.toTemporalInstant : Symbol(Date.toTemporalInstant, Decl(lib.esnext.date.d.ts, --, --)) @@ -222,7 +213,7 @@ { const one = Temporal.Instant.fromEpochMilliseconds(1.0e12); ->one : Symbol(one, Decl(temporal.ts, 76, 9)) +>one : Symbol(one, Decl(temporal.ts, 75, 9)) >Temporal.Instant.fromEpochMilliseconds : Symbol(Temporal.InstantConstructor.fromEpochMilliseconds, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.Instant : Symbol(Temporal.Instant, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -230,7 +221,7 @@ >fromEpochMilliseconds : Symbol(Temporal.InstantConstructor.fromEpochMilliseconds, Decl(lib.esnext.temporal.d.ts, --, --)) const two = Temporal.Instant.fromEpochMilliseconds(1.1e12); ->two : Symbol(two, Decl(temporal.ts, 77, 9)) +>two : Symbol(two, Decl(temporal.ts, 76, 9)) >Temporal.Instant.fromEpochMilliseconds : Symbol(Temporal.InstantConstructor.fromEpochMilliseconds, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.Instant : Symbol(Temporal.Instant, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -238,7 +229,7 @@ >fromEpochMilliseconds : Symbol(Temporal.InstantConstructor.fromEpochMilliseconds, Decl(lib.esnext.temporal.d.ts, --, --)) const three = Temporal.Instant.fromEpochMilliseconds(1.2e12); ->three : Symbol(three, Decl(temporal.ts, 78, 9)) +>three : Symbol(three, Decl(temporal.ts, 77, 9)) >Temporal.Instant.fromEpochMilliseconds : Symbol(Temporal.InstantConstructor.fromEpochMilliseconds, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.Instant : Symbol(Temporal.Instant, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -246,11 +237,11 @@ >fromEpochMilliseconds : Symbol(Temporal.InstantConstructor.fromEpochMilliseconds, Decl(lib.esnext.temporal.d.ts, --, --)) const sorted = [three, one, two].sort(Temporal.Instant.compare); ->sorted : Symbol(sorted, Decl(temporal.ts, 79, 9)) +>sorted : Symbol(sorted, Decl(temporal.ts, 78, 9)) >[three, one, two].sort : Symbol(Array.sort, Decl(lib.es5.d.ts, --, --)) ->three : Symbol(three, Decl(temporal.ts, 78, 9)) ->one : Symbol(one, Decl(temporal.ts, 76, 9)) ->two : Symbol(two, Decl(temporal.ts, 77, 9)) +>three : Symbol(three, Decl(temporal.ts, 77, 9)) +>one : Symbol(one, Decl(temporal.ts, 75, 9)) +>two : Symbol(two, Decl(temporal.ts, 76, 9)) >sort : Symbol(Array.sort, Decl(lib.es5.d.ts, --, --)) >Temporal.Instant.compare : Symbol(Temporal.InstantConstructor.compare, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.Instant : Symbol(Temporal.Instant, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) @@ -260,7 +251,7 @@ sorted.join(" "); >sorted.join : Symbol(Array.join, Decl(lib.es5.d.ts, --, --)) ->sorted : Symbol(sorted, Decl(temporal.ts, 79, 9)) +>sorted : Symbol(sorted, Decl(temporal.ts, 78, 9)) >join : Symbol(Array.join, Decl(lib.es5.d.ts, --, --)) // => '2001-09-09T01:46:40Z 2004-11-09T11:33:20Z 2008-01-10T21:20:00Z' @@ -268,7 +259,7 @@ { const instant = Temporal.Instant.from("2019-03-30T00:45Z"); ->instant : Symbol(instant, Decl(temporal.ts, 85, 9)) +>instant : Symbol(instant, Decl(temporal.ts, 84, 9)) >Temporal.Instant.from : Symbol(Temporal.InstantConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.Instant : Symbol(Temporal.Instant, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -278,40 +269,40 @@ new Date(instant.epochMilliseconds); // => 2019-03-30T00:45:00.000Z >Date : Symbol(Date, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.esnext.date.d.ts, --, --)) >instant.epochMilliseconds : Symbol(Temporal.Instant.epochMilliseconds, Decl(lib.esnext.temporal.d.ts, --, --)) ->instant : Symbol(instant, Decl(temporal.ts, 85, 9)) +>instant : Symbol(instant, Decl(temporal.ts, 84, 9)) >epochMilliseconds : Symbol(Temporal.Instant.epochMilliseconds, Decl(lib.esnext.temporal.d.ts, --, --)) // If you need epoch seconds data: const epochSecs = Math.floor(instant.epochMilliseconds / 1000); // => 1553906700 ->epochSecs : Symbol(epochSecs, Decl(temporal.ts, 89, 9)) +>epochSecs : Symbol(epochSecs, Decl(temporal.ts, 88, 9)) >Math.floor : Symbol(Math.floor, Decl(lib.es5.d.ts, --, --)) >Math : Symbol(Math, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) >floor : Symbol(Math.floor, Decl(lib.es5.d.ts, --, --)) >instant.epochMilliseconds : Symbol(Temporal.Instant.epochMilliseconds, Decl(lib.esnext.temporal.d.ts, --, --)) ->instant : Symbol(instant, Decl(temporal.ts, 85, 9)) +>instant : Symbol(instant, Decl(temporal.ts, 84, 9)) >epochMilliseconds : Symbol(Temporal.Instant.epochMilliseconds, Decl(lib.esnext.temporal.d.ts, --, --)) const ns = instant.epochNanoseconds; ->ns : Symbol(ns, Decl(temporal.ts, 91, 9)) +>ns : Symbol(ns, Decl(temporal.ts, 90, 9)) >instant.epochNanoseconds : Symbol(Temporal.Instant.epochNanoseconds, Decl(lib.esnext.temporal.d.ts, --, --)) ->instant : Symbol(instant, Decl(temporal.ts, 85, 9)) +>instant : Symbol(instant, Decl(temporal.ts, 84, 9)) >epochNanoseconds : Symbol(Temporal.Instant.epochNanoseconds, Decl(lib.esnext.temporal.d.ts, --, --)) const epochMicros = ns / 1000n + ((ns % 1000n) < 0n ? -1n : 0n); ->epochMicros : Symbol(epochMicros, Decl(temporal.ts, 92, 9)) ->ns : Symbol(ns, Decl(temporal.ts, 91, 9)) ->ns : Symbol(ns, Decl(temporal.ts, 91, 9)) +>epochMicros : Symbol(epochMicros, Decl(temporal.ts, 91, 9)) +>ns : Symbol(ns, Decl(temporal.ts, 90, 9)) +>ns : Symbol(ns, Decl(temporal.ts, 90, 9)) } { // Converting a specific exact time to a calendar date / wall-clock time let timestamp: Temporal.Instant; ->timestamp : Symbol(timestamp, Decl(temporal.ts, 97, 7)) +>timestamp : Symbol(timestamp, Decl(temporal.ts, 96, 7)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) >Instant : Symbol(Temporal.Instant, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) timestamp = Temporal.Instant.fromEpochMilliseconds(1553993100_000); ->timestamp : Symbol(timestamp, Decl(temporal.ts, 97, 7)) +>timestamp : Symbol(timestamp, Decl(temporal.ts, 96, 7)) >Temporal.Instant.fromEpochMilliseconds : Symbol(Temporal.InstantConstructor.fromEpochMilliseconds, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.Instant : Symbol(Temporal.Instant, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -320,22 +311,22 @@ timestamp.toZonedDateTimeISO("Europe/Berlin"); // => 2019-03-31T01:45:00+01:00[Europe/Berlin] >timestamp.toZonedDateTimeISO : Symbol(Temporal.Instant.toZonedDateTimeISO, Decl(lib.esnext.temporal.d.ts, --, --)) ->timestamp : Symbol(timestamp, Decl(temporal.ts, 97, 7)) +>timestamp : Symbol(timestamp, Decl(temporal.ts, 96, 7)) >toZonedDateTimeISO : Symbol(Temporal.Instant.toZonedDateTimeISO, Decl(lib.esnext.temporal.d.ts, --, --)) timestamp.toZonedDateTimeISO("UTC"); // => 2019-03-31T00:45:00+00:00[UTC] >timestamp.toZonedDateTimeISO : Symbol(Temporal.Instant.toZonedDateTimeISO, Decl(lib.esnext.temporal.d.ts, --, --)) ->timestamp : Symbol(timestamp, Decl(temporal.ts, 97, 7)) +>timestamp : Symbol(timestamp, Decl(temporal.ts, 96, 7)) >toZonedDateTimeISO : Symbol(Temporal.Instant.toZonedDateTimeISO, Decl(lib.esnext.temporal.d.ts, --, --)) timestamp.toZonedDateTimeISO("-08:00"); // => 2019-03-30T16:45:00-08:00[-08:00] >timestamp.toZonedDateTimeISO : Symbol(Temporal.Instant.toZonedDateTimeISO, Decl(lib.esnext.temporal.d.ts, --, --)) ->timestamp : Symbol(timestamp, Decl(temporal.ts, 97, 7)) +>timestamp : Symbol(timestamp, Decl(temporal.ts, 96, 7)) >toZonedDateTimeISO : Symbol(Temporal.Instant.toZonedDateTimeISO, Decl(lib.esnext.temporal.d.ts, --, --)) // What time was the Unix epoch (timestamp 0) in Bell Labs (Murray Hill, New Jersey, USA) in the Gregorian calendar? const epoch = Temporal.Instant.fromEpochMilliseconds(0); ->epoch : Symbol(epoch, Decl(temporal.ts, 104, 9)) +>epoch : Symbol(epoch, Decl(temporal.ts, 103, 9)) >Temporal.Instant.fromEpochMilliseconds : Symbol(Temporal.InstantConstructor.fromEpochMilliseconds, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.Instant : Symbol(Temporal.Instant, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -345,7 +336,7 @@ epoch.toZonedDateTimeISO("America/New_York").withCalendar("gregory"); >epoch.toZonedDateTimeISO("America/New_York").withCalendar : Symbol(Temporal.ZonedDateTime.withCalendar, Decl(lib.esnext.temporal.d.ts, --, --)) >epoch.toZonedDateTimeISO : Symbol(Temporal.Instant.toZonedDateTimeISO, Decl(lib.esnext.temporal.d.ts, --, --)) ->epoch : Symbol(epoch, Decl(temporal.ts, 104, 9)) +>epoch : Symbol(epoch, Decl(temporal.ts, 103, 9)) >toZonedDateTimeISO : Symbol(Temporal.Instant.toZonedDateTimeISO, Decl(lib.esnext.temporal.d.ts, --, --)) >withCalendar : Symbol(Temporal.ZonedDateTime.withCalendar, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -353,10 +344,10 @@ // What time was the Unix epoch in Tokyo in the Japanese calendar? const zdt = epoch.toZonedDateTimeISO("Asia/Tokyo").withCalendar("japanese"); ->zdt : Symbol(zdt, Decl(temporal.ts, 109, 9)) +>zdt : Symbol(zdt, Decl(temporal.ts, 108, 9)) >epoch.toZonedDateTimeISO("Asia/Tokyo").withCalendar : Symbol(Temporal.ZonedDateTime.withCalendar, Decl(lib.esnext.temporal.d.ts, --, --)) >epoch.toZonedDateTimeISO : Symbol(Temporal.Instant.toZonedDateTimeISO, Decl(lib.esnext.temporal.d.ts, --, --)) ->epoch : Symbol(epoch, Decl(temporal.ts, 104, 9)) +>epoch : Symbol(epoch, Decl(temporal.ts, 103, 9)) >toZonedDateTimeISO : Symbol(Temporal.Instant.toZonedDateTimeISO, Decl(lib.esnext.temporal.d.ts, --, --)) >withCalendar : Symbol(Temporal.ZonedDateTime.withCalendar, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -366,10 +357,10 @@ >console : Symbol(console, Decl(lib.dom.d.ts, --, --)) >log : Symbol(Console.log, Decl(lib.dom.d.ts, --, --)) >zdt.eraYear : Symbol(Temporal.ZonedDateTime.eraYear, Decl(lib.esnext.temporal.d.ts, --, --)) ->zdt : Symbol(zdt, Decl(temporal.ts, 109, 9)) +>zdt : Symbol(zdt, Decl(temporal.ts, 108, 9)) >eraYear : Symbol(Temporal.ZonedDateTime.eraYear, Decl(lib.esnext.temporal.d.ts, --, --)) >zdt.era : Symbol(Temporal.ZonedDateTime.era, Decl(lib.esnext.temporal.d.ts, --, --)) ->zdt : Symbol(zdt, Decl(temporal.ts, 109, 9)) +>zdt : Symbol(zdt, Decl(temporal.ts, 108, 9)) >era : Symbol(Temporal.ZonedDateTime.era, Decl(lib.esnext.temporal.d.ts, --, --)) // => '45 showa' @@ -385,16 +376,16 @@ >Now : Symbol(Temporal.Now, Decl(lib.esnext.temporal.d.ts, --, --)) >instant : Symbol(Temporal.Now.instant, Decl(lib.esnext.temporal.d.ts, --, --)) >add : Symbol(Temporal.Instant.add, Decl(lib.esnext.temporal.d.ts, --, --)) ->hours : Symbol(hours, Decl(temporal.ts, 117, 32)) +>hours : Symbol(hours, Decl(temporal.ts, 116, 32)) const fiveHours = Temporal.Duration.from({ hours: 5 }); ->fiveHours : Symbol(fiveHours, Decl(temporal.ts, 118, 9)) +>fiveHours : Symbol(fiveHours, Decl(temporal.ts, 117, 9)) >Temporal.Duration.from : Symbol(Temporal.DurationConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.Duration : Symbol(Temporal.Duration, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) >Duration : Symbol(Temporal.Duration, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >from : Symbol(Temporal.DurationConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) ->hours : Symbol(hours, Decl(temporal.ts, 118, 46)) +>hours : Symbol(hours, Decl(temporal.ts, 117, 46)) Temporal.Now.instant().add(fiveHours); >Temporal.Now.instant().add : Symbol(Temporal.Instant.add, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -404,7 +395,7 @@ >Now : Symbol(Temporal.Now, Decl(lib.esnext.temporal.d.ts, --, --)) >instant : Symbol(Temporal.Now.instant, Decl(lib.esnext.temporal.d.ts, --, --)) >add : Symbol(Temporal.Instant.add, Decl(lib.esnext.temporal.d.ts, --, --)) ->fiveHours : Symbol(fiveHours, Decl(temporal.ts, 118, 9)) +>fiveHours : Symbol(fiveHours, Decl(temporal.ts, 117, 9)) } { @@ -417,16 +408,16 @@ >Now : Symbol(Temporal.Now, Decl(lib.esnext.temporal.d.ts, --, --)) >instant : Symbol(Temporal.Now.instant, Decl(lib.esnext.temporal.d.ts, --, --)) >subtract : Symbol(Temporal.Instant.subtract, Decl(lib.esnext.temporal.d.ts, --, --)) ->hours : Symbol(hours, Decl(temporal.ts, 124, 37)) +>hours : Symbol(hours, Decl(temporal.ts, 123, 37)) const oneHour = Temporal.Duration.from({ hours: 1 }); ->oneHour : Symbol(oneHour, Decl(temporal.ts, 125, 9)) +>oneHour : Symbol(oneHour, Decl(temporal.ts, 124, 9)) >Temporal.Duration.from : Symbol(Temporal.DurationConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.Duration : Symbol(Temporal.Duration, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) >Duration : Symbol(Temporal.Duration, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >from : Symbol(Temporal.DurationConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) ->hours : Symbol(hours, Decl(temporal.ts, 125, 44)) +>hours : Symbol(hours, Decl(temporal.ts, 124, 44)) Temporal.Now.instant().subtract(oneHour); >Temporal.Now.instant().subtract : Symbol(Temporal.Instant.subtract, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -436,12 +427,12 @@ >Now : Symbol(Temporal.Now, Decl(lib.esnext.temporal.d.ts, --, --)) >instant : Symbol(Temporal.Now.instant, Decl(lib.esnext.temporal.d.ts, --, --)) >subtract : Symbol(Temporal.Instant.subtract, Decl(lib.esnext.temporal.d.ts, --, --)) ->oneHour : Symbol(oneHour, Decl(temporal.ts, 125, 9)) +>oneHour : Symbol(oneHour, Decl(temporal.ts, 124, 9)) } { const startOfMoonMission = Temporal.Instant.from("1969-07-16T13:32:00Z"); ->startOfMoonMission : Symbol(startOfMoonMission, Decl(temporal.ts, 130, 9)) +>startOfMoonMission : Symbol(startOfMoonMission, Decl(temporal.ts, 129, 9)) >Temporal.Instant.from : Symbol(Temporal.InstantConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.Instant : Symbol(Temporal.Instant, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -449,7 +440,7 @@ >from : Symbol(Temporal.InstantConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) const endOfMoonMission = Temporal.Instant.from("1969-07-24T16:50:35Z"); ->endOfMoonMission : Symbol(endOfMoonMission, Decl(temporal.ts, 131, 9)) +>endOfMoonMission : Symbol(endOfMoonMission, Decl(temporal.ts, 130, 9)) >Temporal.Instant.from : Symbol(Temporal.InstantConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.Instant : Symbol(Temporal.Instant, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -457,41 +448,41 @@ >from : Symbol(Temporal.InstantConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) const missionLength = startOfMoonMission.until(endOfMoonMission, { largestUnit: "hour" }); ->missionLength : Symbol(missionLength, Decl(temporal.ts, 132, 9)) +>missionLength : Symbol(missionLength, Decl(temporal.ts, 131, 9)) >startOfMoonMission.until : Symbol(Temporal.Instant.until, Decl(lib.esnext.temporal.d.ts, --, --)) ->startOfMoonMission : Symbol(startOfMoonMission, Decl(temporal.ts, 130, 9)) +>startOfMoonMission : Symbol(startOfMoonMission, Decl(temporal.ts, 129, 9)) >until : Symbol(Temporal.Instant.until, Decl(lib.esnext.temporal.d.ts, --, --)) ->endOfMoonMission : Symbol(endOfMoonMission, Decl(temporal.ts, 131, 9)) ->largestUnit : Symbol(largestUnit, Decl(temporal.ts, 132, 70)) +>endOfMoonMission : Symbol(endOfMoonMission, Decl(temporal.ts, 130, 9)) +>largestUnit : Symbol(largestUnit, Decl(temporal.ts, 131, 70)) // => PT195H18M35S missionLength.toLocaleString(); >missionLength.toLocaleString : Symbol(Temporal.Duration.toLocaleString, Decl(lib.esnext.temporal.d.ts, --, --)) ->missionLength : Symbol(missionLength, Decl(temporal.ts, 132, 9)) +>missionLength : Symbol(missionLength, Decl(temporal.ts, 131, 9)) >toLocaleString : Symbol(Temporal.Duration.toLocaleString, Decl(lib.esnext.temporal.d.ts, --, --)) // example output: '195 hours 18 minutes 35 seconds' // Rounding, for example if you don't care about the minutes and seconds const approxMissionLength = startOfMoonMission.until(endOfMoonMission, { ->approxMissionLength : Symbol(approxMissionLength, Decl(temporal.ts, 138, 9)) +>approxMissionLength : Symbol(approxMissionLength, Decl(temporal.ts, 137, 9)) >startOfMoonMission.until : Symbol(Temporal.Instant.until, Decl(lib.esnext.temporal.d.ts, --, --)) ->startOfMoonMission : Symbol(startOfMoonMission, Decl(temporal.ts, 130, 9)) +>startOfMoonMission : Symbol(startOfMoonMission, Decl(temporal.ts, 129, 9)) >until : Symbol(Temporal.Instant.until, Decl(lib.esnext.temporal.d.ts, --, --)) ->endOfMoonMission : Symbol(endOfMoonMission, Decl(temporal.ts, 131, 9)) +>endOfMoonMission : Symbol(endOfMoonMission, Decl(temporal.ts, 130, 9)) largestUnit: "hour", ->largestUnit : Symbol(largestUnit, Decl(temporal.ts, 138, 76)) +>largestUnit : Symbol(largestUnit, Decl(temporal.ts, 137, 76)) smallestUnit: "hour", ->smallestUnit : Symbol(smallestUnit, Decl(temporal.ts, 139, 28)) +>smallestUnit : Symbol(smallestUnit, Decl(temporal.ts, 138, 28)) }); // => PT195H // A billion (10^9) seconds since the epoch in different units const epoch = Temporal.Instant.fromEpochMilliseconds(0); ->epoch : Symbol(epoch, Decl(temporal.ts, 145, 9)) +>epoch : Symbol(epoch, Decl(temporal.ts, 144, 9)) >Temporal.Instant.fromEpochMilliseconds : Symbol(Temporal.InstantConstructor.fromEpochMilliseconds, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.Instant : Symbol(Temporal.Instant, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -499,7 +490,7 @@ >fromEpochMilliseconds : Symbol(Temporal.InstantConstructor.fromEpochMilliseconds, Decl(lib.esnext.temporal.d.ts, --, --)) const billion = Temporal.Instant.fromEpochMilliseconds(1e9); ->billion : Symbol(billion, Decl(temporal.ts, 146, 9)) +>billion : Symbol(billion, Decl(temporal.ts, 145, 9)) >Temporal.Instant.fromEpochMilliseconds : Symbol(Temporal.InstantConstructor.fromEpochMilliseconds, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.Instant : Symbol(Temporal.Instant, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -508,33 +499,33 @@ epoch.until(billion); >epoch.until : Symbol(Temporal.Instant.until, Decl(lib.esnext.temporal.d.ts, --, --)) ->epoch : Symbol(epoch, Decl(temporal.ts, 145, 9)) +>epoch : Symbol(epoch, Decl(temporal.ts, 144, 9)) >until : Symbol(Temporal.Instant.until, Decl(lib.esnext.temporal.d.ts, --, --)) ->billion : Symbol(billion, Decl(temporal.ts, 146, 9)) +>billion : Symbol(billion, Decl(temporal.ts, 145, 9)) // => PT1000000000S epoch.until(billion, { largestUnit: "hour" }); >epoch.until : Symbol(Temporal.Instant.until, Decl(lib.esnext.temporal.d.ts, --, --)) ->epoch : Symbol(epoch, Decl(temporal.ts, 145, 9)) +>epoch : Symbol(epoch, Decl(temporal.ts, 144, 9)) >until : Symbol(Temporal.Instant.until, Decl(lib.esnext.temporal.d.ts, --, --)) ->billion : Symbol(billion, Decl(temporal.ts, 146, 9)) ->largestUnit : Symbol(largestUnit, Decl(temporal.ts, 149, 26)) +>billion : Symbol(billion, Decl(temporal.ts, 145, 9)) +>largestUnit : Symbol(largestUnit, Decl(temporal.ts, 148, 26)) // => PT277777H46M40S const ns = epoch.until(billion, { largestUnit: "nanosecond" }); ->ns : Symbol(ns, Decl(temporal.ts, 151, 9)) +>ns : Symbol(ns, Decl(temporal.ts, 150, 9)) >epoch.until : Symbol(Temporal.Instant.until, Decl(lib.esnext.temporal.d.ts, --, --)) ->epoch : Symbol(epoch, Decl(temporal.ts, 145, 9)) +>epoch : Symbol(epoch, Decl(temporal.ts, 144, 9)) >until : Symbol(Temporal.Instant.until, Decl(lib.esnext.temporal.d.ts, --, --)) ->billion : Symbol(billion, Decl(temporal.ts, 146, 9)) ->largestUnit : Symbol(largestUnit, Decl(temporal.ts, 151, 37)) +>billion : Symbol(billion, Decl(temporal.ts, 145, 9)) +>largestUnit : Symbol(largestUnit, Decl(temporal.ts, 150, 37)) // => PT1000000000S ns.add({ nanoseconds: 1 }); >ns.add : Symbol(Temporal.Duration.add, Decl(lib.esnext.temporal.d.ts, --, --)) ->ns : Symbol(ns, Decl(temporal.ts, 151, 9)) +>ns : Symbol(ns, Decl(temporal.ts, 150, 9)) >add : Symbol(Temporal.Duration.add, Decl(lib.esnext.temporal.d.ts, --, --)) ->nanoseconds : Symbol(nanoseconds, Decl(temporal.ts, 153, 12)) +>nanoseconds : Symbol(nanoseconds, Decl(temporal.ts, 152, 12)) // => PT1000000000S // (lost precision) @@ -544,17 +535,17 @@ epoch.toZonedDateTimeISO("UTC").until( >epoch.toZonedDateTimeISO("UTC").until : Symbol(Temporal.ZonedDateTime.until, Decl(lib.esnext.temporal.d.ts, --, --)) >epoch.toZonedDateTimeISO : Symbol(Temporal.Instant.toZonedDateTimeISO, Decl(lib.esnext.temporal.d.ts, --, --)) ->epoch : Symbol(epoch, Decl(temporal.ts, 145, 9)) +>epoch : Symbol(epoch, Decl(temporal.ts, 144, 9)) >toZonedDateTimeISO : Symbol(Temporal.Instant.toZonedDateTimeISO, Decl(lib.esnext.temporal.d.ts, --, --)) >until : Symbol(Temporal.ZonedDateTime.until, Decl(lib.esnext.temporal.d.ts, --, --)) billion.toZonedDateTimeISO("UTC"), >billion.toZonedDateTimeISO : Symbol(Temporal.Instant.toZonedDateTimeISO, Decl(lib.esnext.temporal.d.ts, --, --)) ->billion : Symbol(billion, Decl(temporal.ts, 146, 9)) +>billion : Symbol(billion, Decl(temporal.ts, 145, 9)) >toZonedDateTimeISO : Symbol(Temporal.Instant.toZonedDateTimeISO, Decl(lib.esnext.temporal.d.ts, --, --)) { largestUnit: "year" }, ->largestUnit : Symbol(largestUnit, Decl(temporal.ts, 161, 9)) +>largestUnit : Symbol(largestUnit, Decl(temporal.ts, 160, 9)) ); // => P31Y8M8DT1H46M40S @@ -562,7 +553,7 @@ { const instant = Temporal.Instant.from("2019-03-30T02:45:59.999999999Z"); ->instant : Symbol(instant, Decl(temporal.ts, 167, 9)) +>instant : Symbol(instant, Decl(temporal.ts, 166, 9)) >Temporal.Instant.from : Symbol(Temporal.InstantConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.Instant : Symbol(Temporal.Instant, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -572,34 +563,34 @@ // Round to a particular unit instant.round({ smallestUnit: "second" }); // => 2019-03-30T02:46:00Z >instant.round : Symbol(Temporal.Instant.round, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) ->instant : Symbol(instant, Decl(temporal.ts, 167, 9)) +>instant : Symbol(instant, Decl(temporal.ts, 166, 9)) >round : Symbol(Temporal.Instant.round, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) ->smallestUnit : Symbol(smallestUnit, Decl(temporal.ts, 170, 19)) +>smallestUnit : Symbol(smallestUnit, Decl(temporal.ts, 169, 19)) // Round to an increment of a unit, e.g. an hour: instant.round({ roundingIncrement: 60, smallestUnit: "minute" }); >instant.round : Symbol(Temporal.Instant.round, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) ->instant : Symbol(instant, Decl(temporal.ts, 167, 9)) +>instant : Symbol(instant, Decl(temporal.ts, 166, 9)) >round : Symbol(Temporal.Instant.round, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) ->roundingIncrement : Symbol(roundingIncrement, Decl(temporal.ts, 172, 19)) ->smallestUnit : Symbol(smallestUnit, Decl(temporal.ts, 172, 42)) +>roundingIncrement : Symbol(roundingIncrement, Decl(temporal.ts, 171, 19)) +>smallestUnit : Symbol(smallestUnit, Decl(temporal.ts, 171, 42)) // => 2019-03-30T03:00:00Z // Round to the same increment but round down instead: instant.round({ roundingIncrement: 60, smallestUnit: "minute", roundingMode: "floor" }); >instant.round : Symbol(Temporal.Instant.round, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) ->instant : Symbol(instant, Decl(temporal.ts, 167, 9)) +>instant : Symbol(instant, Decl(temporal.ts, 166, 9)) >round : Symbol(Temporal.Instant.round, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) ->roundingIncrement : Symbol(roundingIncrement, Decl(temporal.ts, 175, 19)) ->smallestUnit : Symbol(smallestUnit, Decl(temporal.ts, 175, 42)) ->roundingMode : Symbol(roundingMode, Decl(temporal.ts, 175, 66)) +>roundingIncrement : Symbol(roundingIncrement, Decl(temporal.ts, 174, 19)) +>smallestUnit : Symbol(smallestUnit, Decl(temporal.ts, 174, 42)) +>roundingMode : Symbol(roundingMode, Decl(temporal.ts, 174, 66)) // => 2019-03-30T02:00:00Z } { const one = Temporal.Instant.fromEpochMilliseconds(1.0e12); ->one : Symbol(one, Decl(temporal.ts, 180, 9)) +>one : Symbol(one, Decl(temporal.ts, 179, 9)) >Temporal.Instant.fromEpochMilliseconds : Symbol(Temporal.InstantConstructor.fromEpochMilliseconds, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.Instant : Symbol(Temporal.Instant, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -607,7 +598,7 @@ >fromEpochMilliseconds : Symbol(Temporal.InstantConstructor.fromEpochMilliseconds, Decl(lib.esnext.temporal.d.ts, --, --)) const two = Temporal.Instant.fromEpochMilliseconds(1.1e12); ->two : Symbol(two, Decl(temporal.ts, 181, 9)) +>two : Symbol(two, Decl(temporal.ts, 180, 9)) >Temporal.Instant.fromEpochMilliseconds : Symbol(Temporal.InstantConstructor.fromEpochMilliseconds, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.Instant : Symbol(Temporal.Instant, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -616,20 +607,20 @@ one.equals(two); // => false >one.equals : Symbol(Temporal.Instant.equals, Decl(lib.esnext.temporal.d.ts, --, --)) ->one : Symbol(one, Decl(temporal.ts, 180, 9)) +>one : Symbol(one, Decl(temporal.ts, 179, 9)) >equals : Symbol(Temporal.Instant.equals, Decl(lib.esnext.temporal.d.ts, --, --)) ->two : Symbol(two, Decl(temporal.ts, 181, 9)) +>two : Symbol(two, Decl(temporal.ts, 180, 9)) one.equals(one); // => true >one.equals : Symbol(Temporal.Instant.equals, Decl(lib.esnext.temporal.d.ts, --, --)) ->one : Symbol(one, Decl(temporal.ts, 180, 9)) +>one : Symbol(one, Decl(temporal.ts, 179, 9)) >equals : Symbol(Temporal.Instant.equals, Decl(lib.esnext.temporal.d.ts, --, --)) ->one : Symbol(one, Decl(temporal.ts, 180, 9)) +>one : Symbol(one, Decl(temporal.ts, 179, 9)) } { const instant = Temporal.Instant.fromEpochMilliseconds(1574074321816); ->instant : Symbol(instant, Decl(temporal.ts, 187, 9)) +>instant : Symbol(instant, Decl(temporal.ts, 186, 9)) >Temporal.Instant.fromEpochMilliseconds : Symbol(Temporal.InstantConstructor.fromEpochMilliseconds, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.Instant : Symbol(Temporal.Instant, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -638,58 +629,58 @@ instant.toString(); // => '2019-11-18T10:52:01.816Z' >instant.toString : Symbol(Temporal.Instant.toString, Decl(lib.esnext.temporal.d.ts, --, --)) ->instant : Symbol(instant, Decl(temporal.ts, 187, 9)) +>instant : Symbol(instant, Decl(temporal.ts, 186, 9)) >toString : Symbol(Temporal.Instant.toString, Decl(lib.esnext.temporal.d.ts, --, --)) instant.toString({ timeZone: "UTC" }); >instant.toString : Symbol(Temporal.Instant.toString, Decl(lib.esnext.temporal.d.ts, --, --)) ->instant : Symbol(instant, Decl(temporal.ts, 187, 9)) +>instant : Symbol(instant, Decl(temporal.ts, 186, 9)) >toString : Symbol(Temporal.Instant.toString, Decl(lib.esnext.temporal.d.ts, --, --)) ->timeZone : Symbol(timeZone, Decl(temporal.ts, 189, 22)) +>timeZone : Symbol(timeZone, Decl(temporal.ts, 188, 22)) // => '2019-11-18T10:52:01.816+00:00' instant.toString({ timeZone: "Asia/Seoul" }); >instant.toString : Symbol(Temporal.Instant.toString, Decl(lib.esnext.temporal.d.ts, --, --)) ->instant : Symbol(instant, Decl(temporal.ts, 187, 9)) +>instant : Symbol(instant, Decl(temporal.ts, 186, 9)) >toString : Symbol(Temporal.Instant.toString, Decl(lib.esnext.temporal.d.ts, --, --)) ->timeZone : Symbol(timeZone, Decl(temporal.ts, 191, 22)) +>timeZone : Symbol(timeZone, Decl(temporal.ts, 190, 22)) // => '2019-11-18T19:52:01.816+09:00' instant.toString({ smallestUnit: "minute" }); >instant.toString : Symbol(Temporal.Instant.toString, Decl(lib.esnext.temporal.d.ts, --, --)) ->instant : Symbol(instant, Decl(temporal.ts, 187, 9)) +>instant : Symbol(instant, Decl(temporal.ts, 186, 9)) >toString : Symbol(Temporal.Instant.toString, Decl(lib.esnext.temporal.d.ts, --, --)) ->smallestUnit : Symbol(smallestUnit, Decl(temporal.ts, 194, 22)) +>smallestUnit : Symbol(smallestUnit, Decl(temporal.ts, 193, 22)) // => '2019-11-18T10:52Z' instant.toString({ fractionalSecondDigits: 0 }); >instant.toString : Symbol(Temporal.Instant.toString, Decl(lib.esnext.temporal.d.ts, --, --)) ->instant : Symbol(instant, Decl(temporal.ts, 187, 9)) +>instant : Symbol(instant, Decl(temporal.ts, 186, 9)) >toString : Symbol(Temporal.Instant.toString, Decl(lib.esnext.temporal.d.ts, --, --)) ->fractionalSecondDigits : Symbol(fractionalSecondDigits, Decl(temporal.ts, 196, 22)) +>fractionalSecondDigits : Symbol(fractionalSecondDigits, Decl(temporal.ts, 195, 22)) // => '2019-11-18T10:52:01Z' instant.toString({ fractionalSecondDigits: 4 }); >instant.toString : Symbol(Temporal.Instant.toString, Decl(lib.esnext.temporal.d.ts, --, --)) ->instant : Symbol(instant, Decl(temporal.ts, 187, 9)) +>instant : Symbol(instant, Decl(temporal.ts, 186, 9)) >toString : Symbol(Temporal.Instant.toString, Decl(lib.esnext.temporal.d.ts, --, --)) ->fractionalSecondDigits : Symbol(fractionalSecondDigits, Decl(temporal.ts, 198, 22)) +>fractionalSecondDigits : Symbol(fractionalSecondDigits, Decl(temporal.ts, 197, 22)) // => '2019-11-18T10:52:01.8160Z' instant.toString({ smallestUnit: "second", roundingMode: "halfExpand" }); >instant.toString : Symbol(Temporal.Instant.toString, Decl(lib.esnext.temporal.d.ts, --, --)) ->instant : Symbol(instant, Decl(temporal.ts, 187, 9)) +>instant : Symbol(instant, Decl(temporal.ts, 186, 9)) >toString : Symbol(Temporal.Instant.toString, Decl(lib.esnext.temporal.d.ts, --, --)) ->smallestUnit : Symbol(smallestUnit, Decl(temporal.ts, 200, 22)) ->roundingMode : Symbol(roundingMode, Decl(temporal.ts, 200, 46)) +>smallestUnit : Symbol(smallestUnit, Decl(temporal.ts, 199, 22)) +>roundingMode : Symbol(roundingMode, Decl(temporal.ts, 199, 46)) // => '2019-11-18T10:52:02Z' } { const instant = Temporal.Instant.from("2019-11-18T11:00:00.000Z"); ->instant : Symbol(instant, Decl(temporal.ts, 205, 9)) +>instant : Symbol(instant, Decl(temporal.ts, 204, 9)) >Temporal.Instant.from : Symbol(Temporal.InstantConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.Instant : Symbol(Temporal.Instant, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -698,48 +689,48 @@ instant.toLocaleString(); // example output: '2019-11-18, 3:00:00 a.m.' >instant.toLocaleString : Symbol(Temporal.Instant.toLocaleString, Decl(lib.esnext.temporal.d.ts, --, --)) ->instant : Symbol(instant, Decl(temporal.ts, 205, 9)) +>instant : Symbol(instant, Decl(temporal.ts, 204, 9)) >toLocaleString : Symbol(Temporal.Instant.toLocaleString, Decl(lib.esnext.temporal.d.ts, --, --)) instant.toLocaleString("de-DE"); // example output: '18.11.2019, 03:00:00' >instant.toLocaleString : Symbol(Temporal.Instant.toLocaleString, Decl(lib.esnext.temporal.d.ts, --, --)) ->instant : Symbol(instant, Decl(temporal.ts, 205, 9)) +>instant : Symbol(instant, Decl(temporal.ts, 204, 9)) >toLocaleString : Symbol(Temporal.Instant.toLocaleString, Decl(lib.esnext.temporal.d.ts, --, --)) instant.toLocaleString("de-DE", { >instant.toLocaleString : Symbol(Temporal.Instant.toLocaleString, Decl(lib.esnext.temporal.d.ts, --, --)) ->instant : Symbol(instant, Decl(temporal.ts, 205, 9)) +>instant : Symbol(instant, Decl(temporal.ts, 204, 9)) >toLocaleString : Symbol(Temporal.Instant.toLocaleString, Decl(lib.esnext.temporal.d.ts, --, --)) timeZone: "Europe/Berlin", ->timeZone : Symbol(timeZone, Decl(temporal.ts, 208, 37)) +>timeZone : Symbol(timeZone, Decl(temporal.ts, 207, 37)) year: "numeric", ->year : Symbol(year, Decl(temporal.ts, 209, 34)) +>year : Symbol(year, Decl(temporal.ts, 208, 34)) month: "numeric", ->month : Symbol(month, Decl(temporal.ts, 210, 24)) +>month : Symbol(month, Decl(temporal.ts, 209, 24)) day: "numeric", ->day : Symbol(day, Decl(temporal.ts, 211, 25)) +>day : Symbol(day, Decl(temporal.ts, 210, 25)) hour: "numeric", ->hour : Symbol(hour, Decl(temporal.ts, 212, 23)) +>hour : Symbol(hour, Decl(temporal.ts, 211, 23)) minute: "numeric", ->minute : Symbol(minute, Decl(temporal.ts, 213, 24)) +>minute : Symbol(minute, Decl(temporal.ts, 212, 24)) timeZoneName: "long", ->timeZoneName : Symbol(timeZoneName, Decl(temporal.ts, 214, 26)) +>timeZoneName : Symbol(timeZoneName, Decl(temporal.ts, 213, 26)) }); // => '18.11.2019, 12:00 Mitteleuropäische Normalzeit' instant.toLocaleString("en-US-u-nu-fullwide-hc-h12", { >instant.toLocaleString : Symbol(Temporal.Instant.toLocaleString, Decl(lib.esnext.temporal.d.ts, --, --)) ->instant : Symbol(instant, Decl(temporal.ts, 205, 9)) +>instant : Symbol(instant, Decl(temporal.ts, 204, 9)) >toLocaleString : Symbol(Temporal.Instant.toLocaleString, Decl(lib.esnext.temporal.d.ts, --, --)) timeZone: "Asia/Kolkata", ->timeZone : Symbol(timeZone, Decl(temporal.ts, 217, 58)) +>timeZone : Symbol(timeZone, Decl(temporal.ts, 216, 58)) }); // => '11/18/2019, 4:30:00 PM' } @@ -763,12 +754,12 @@ { let zdt: Temporal.ZonedDateTime; ->zdt : Symbol(zdt, Decl(temporal.ts, 232, 7)) +>zdt : Symbol(zdt, Decl(temporal.ts, 231, 7)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) >ZonedDateTime : Symbol(Temporal.ZonedDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) zdt = Temporal.ZonedDateTime.from("1995-12-07T03:24:30+02:00[Africa/Cairo]"); ->zdt : Symbol(zdt, Decl(temporal.ts, 232, 7)) +>zdt : Symbol(zdt, Decl(temporal.ts, 231, 7)) >Temporal.ZonedDateTime.from : Symbol(Temporal.ZonedDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.ZonedDateTime : Symbol(Temporal.ZonedDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -776,7 +767,7 @@ >from : Symbol(Temporal.ZonedDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) zdt = Temporal.ZonedDateTime.from("1995-12-07T03:24:30+02:00[Africa/Cairo][u-ca=islamic]"); ->zdt : Symbol(zdt, Decl(temporal.ts, 232, 7)) +>zdt : Symbol(zdt, Decl(temporal.ts, 231, 7)) >Temporal.ZonedDateTime.from : Symbol(Temporal.ZonedDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.ZonedDateTime : Symbol(Temporal.ZonedDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -784,7 +775,7 @@ >from : Symbol(Temporal.ZonedDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) zdt = Temporal.ZonedDateTime.from("19951207T032430+0200[Africa/Cairo]"); ->zdt : Symbol(zdt, Decl(temporal.ts, 232, 7)) +>zdt : Symbol(zdt, Decl(temporal.ts, 231, 7)) >Temporal.ZonedDateTime.from : Symbol(Temporal.ZonedDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.ZonedDateTime : Symbol(Temporal.ZonedDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -792,7 +783,7 @@ >from : Symbol(Temporal.ZonedDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) zdt = Temporal.ZonedDateTime.from({ ->zdt : Symbol(zdt, Decl(temporal.ts, 232, 7)) +>zdt : Symbol(zdt, Decl(temporal.ts, 231, 7)) >Temporal.ZonedDateTime.from : Symbol(Temporal.ZonedDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.ZonedDateTime : Symbol(Temporal.ZonedDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -800,71 +791,71 @@ >from : Symbol(Temporal.ZonedDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) timeZone: "America/Los_Angeles", ->timeZone : Symbol(timeZone, Decl(temporal.ts, 238, 39)) +>timeZone : Symbol(timeZone, Decl(temporal.ts, 237, 39)) year: 1995, ->year : Symbol(year, Decl(temporal.ts, 239, 40)) +>year : Symbol(year, Decl(temporal.ts, 238, 40)) month: 12, ->month : Symbol(month, Decl(temporal.ts, 240, 19)) +>month : Symbol(month, Decl(temporal.ts, 239, 19)) day: 7, ->day : Symbol(day, Decl(temporal.ts, 241, 18)) +>day : Symbol(day, Decl(temporal.ts, 240, 18)) hour: 3, ->hour : Symbol(hour, Decl(temporal.ts, 242, 15)) +>hour : Symbol(hour, Decl(temporal.ts, 241, 15)) minute: 24, ->minute : Symbol(minute, Decl(temporal.ts, 243, 16)) +>minute : Symbol(minute, Decl(temporal.ts, 242, 16)) second: 30, ->second : Symbol(second, Decl(temporal.ts, 244, 19)) +>second : Symbol(second, Decl(temporal.ts, 243, 19)) millisecond: 0, ->millisecond : Symbol(millisecond, Decl(temporal.ts, 245, 19)) +>millisecond : Symbol(millisecond, Decl(temporal.ts, 244, 19)) microsecond: 3, ->microsecond : Symbol(microsecond, Decl(temporal.ts, 246, 23)) +>microsecond : Symbol(microsecond, Decl(temporal.ts, 245, 23)) nanosecond: 500, ->nanosecond : Symbol(nanosecond, Decl(temporal.ts, 247, 23)) +>nanosecond : Symbol(nanosecond, Decl(temporal.ts, 246, 23)) }); // => 1995-12-07T03:24:30.0000035-08:00[America/Los_Angeles] // Different overflow modes zdt = Temporal.ZonedDateTime.from({ timeZone: "Europe/Paris", year: 2001, month: 13, day: 1 }, { overflow: "constrain" }); ->zdt : Symbol(zdt, Decl(temporal.ts, 232, 7)) +>zdt : Symbol(zdt, Decl(temporal.ts, 231, 7)) >Temporal.ZonedDateTime.from : Symbol(Temporal.ZonedDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.ZonedDateTime : Symbol(Temporal.ZonedDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) >ZonedDateTime : Symbol(Temporal.ZonedDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >from : Symbol(Temporal.ZonedDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) ->timeZone : Symbol(timeZone, Decl(temporal.ts, 252, 39)) ->year : Symbol(year, Decl(temporal.ts, 252, 65)) ->month : Symbol(month, Decl(temporal.ts, 252, 77)) ->day : Symbol(day, Decl(temporal.ts, 252, 88)) ->overflow : Symbol(overflow, Decl(temporal.ts, 252, 100)) +>timeZone : Symbol(timeZone, Decl(temporal.ts, 251, 39)) +>year : Symbol(year, Decl(temporal.ts, 251, 65)) +>month : Symbol(month, Decl(temporal.ts, 251, 77)) +>day : Symbol(day, Decl(temporal.ts, 251, 88)) +>overflow : Symbol(overflow, Decl(temporal.ts, 251, 100)) // => 2001-12-01T00:00:00+01:00[Europe/Paris] zdt = Temporal.ZonedDateTime.from({ timeZone: "Europe/Paris", year: 2001, month: 13, day: 1 }, { overflow: "reject" }); ->zdt : Symbol(zdt, Decl(temporal.ts, 232, 7)) +>zdt : Symbol(zdt, Decl(temporal.ts, 231, 7)) >Temporal.ZonedDateTime.from : Symbol(Temporal.ZonedDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.ZonedDateTime : Symbol(Temporal.ZonedDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) >ZonedDateTime : Symbol(Temporal.ZonedDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >from : Symbol(Temporal.ZonedDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) ->timeZone : Symbol(timeZone, Decl(temporal.ts, 254, 39)) ->year : Symbol(year, Decl(temporal.ts, 254, 65)) ->month : Symbol(month, Decl(temporal.ts, 254, 77)) ->day : Symbol(day, Decl(temporal.ts, 254, 88)) ->overflow : Symbol(overflow, Decl(temporal.ts, 254, 100)) +>timeZone : Symbol(timeZone, Decl(temporal.ts, 253, 39)) +>year : Symbol(year, Decl(temporal.ts, 253, 65)) +>month : Symbol(month, Decl(temporal.ts, 253, 77)) +>day : Symbol(day, Decl(temporal.ts, 253, 88)) +>overflow : Symbol(overflow, Decl(temporal.ts, 253, 100)) // => throws RangeError } { const arr = [ ->arr : Symbol(arr, Decl(temporal.ts, 259, 9)) +>arr : Symbol(arr, Decl(temporal.ts, 258, 9)) Temporal.ZonedDateTime.from("2020-02-01T12:30-05:00[America/Toronto]"), >Temporal.ZonedDateTime.from : Symbol(Temporal.ZonedDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -896,9 +887,9 @@ ]; const sorted = arr.sort(Temporal.ZonedDateTime.compare); ->sorted : Symbol(sorted, Decl(temporal.ts, 265, 9)) +>sorted : Symbol(sorted, Decl(temporal.ts, 264, 9)) >arr.sort : Symbol(Array.sort, Decl(lib.es5.d.ts, --, --)) ->arr : Symbol(arr, Decl(temporal.ts, 259, 9)) +>arr : Symbol(arr, Decl(temporal.ts, 258, 9)) >sort : Symbol(Array.sort, Decl(lib.es5.d.ts, --, --)) >Temporal.ZonedDateTime.compare : Symbol(Temporal.ZonedDateTimeConstructor.compare, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.ZonedDateTime : Symbol(Temporal.ZonedDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) @@ -910,7 +901,7 @@ >JSON.stringify : Symbol(JSON.stringify, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >JSON : Symbol(JSON, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) >stringify : Symbol(JSON.stringify, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) ->sorted : Symbol(sorted, Decl(temporal.ts, 265, 9)) +>sorted : Symbol(sorted, Decl(temporal.ts, 264, 9)) >undefined : Symbol(undefined) // => @@ -924,7 +915,7 @@ { const dt = Temporal.ZonedDateTime.from("1995-12-07T03:24:30.000003500[Europe/Rome]"); ->dt : Symbol(dt, Decl(temporal.ts, 277, 9)) +>dt : Symbol(dt, Decl(temporal.ts, 276, 9)) >Temporal.ZonedDateTime.from : Symbol(Temporal.ZonedDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.ZonedDateTime : Symbol(Temporal.ZonedDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -933,58 +924,58 @@ dt.year; // => 1995 >dt.year : Symbol(Temporal.ZonedDateTime.year, Decl(lib.esnext.temporal.d.ts, --, --)) ->dt : Symbol(dt, Decl(temporal.ts, 277, 9)) +>dt : Symbol(dt, Decl(temporal.ts, 276, 9)) >year : Symbol(Temporal.ZonedDateTime.year, Decl(lib.esnext.temporal.d.ts, --, --)) dt.month; // => 12 >dt.month : Symbol(Temporal.ZonedDateTime.month, Decl(lib.esnext.temporal.d.ts, --, --)) ->dt : Symbol(dt, Decl(temporal.ts, 277, 9)) +>dt : Symbol(dt, Decl(temporal.ts, 276, 9)) >month : Symbol(Temporal.ZonedDateTime.month, Decl(lib.esnext.temporal.d.ts, --, --)) dt.monthCode; // => 'M12' >dt.monthCode : Symbol(Temporal.ZonedDateTime.monthCode, Decl(lib.esnext.temporal.d.ts, --, --)) ->dt : Symbol(dt, Decl(temporal.ts, 277, 9)) +>dt : Symbol(dt, Decl(temporal.ts, 276, 9)) >monthCode : Symbol(Temporal.ZonedDateTime.monthCode, Decl(lib.esnext.temporal.d.ts, --, --)) dt.day; // => 7 >dt.day : Symbol(Temporal.ZonedDateTime.day, Decl(lib.esnext.temporal.d.ts, --, --)) ->dt : Symbol(dt, Decl(temporal.ts, 277, 9)) +>dt : Symbol(dt, Decl(temporal.ts, 276, 9)) >day : Symbol(Temporal.ZonedDateTime.day, Decl(lib.esnext.temporal.d.ts, --, --)) dt.hour; // => 3 >dt.hour : Symbol(Temporal.ZonedDateTime.hour, Decl(lib.esnext.temporal.d.ts, --, --)) ->dt : Symbol(dt, Decl(temporal.ts, 277, 9)) +>dt : Symbol(dt, Decl(temporal.ts, 276, 9)) >hour : Symbol(Temporal.ZonedDateTime.hour, Decl(lib.esnext.temporal.d.ts, --, --)) dt.minute; // => 24 >dt.minute : Symbol(Temporal.ZonedDateTime.minute, Decl(lib.esnext.temporal.d.ts, --, --)) ->dt : Symbol(dt, Decl(temporal.ts, 277, 9)) +>dt : Symbol(dt, Decl(temporal.ts, 276, 9)) >minute : Symbol(Temporal.ZonedDateTime.minute, Decl(lib.esnext.temporal.d.ts, --, --)) dt.second; // => 30 >dt.second : Symbol(Temporal.ZonedDateTime.second, Decl(lib.esnext.temporal.d.ts, --, --)) ->dt : Symbol(dt, Decl(temporal.ts, 277, 9)) +>dt : Symbol(dt, Decl(temporal.ts, 276, 9)) >second : Symbol(Temporal.ZonedDateTime.second, Decl(lib.esnext.temporal.d.ts, --, --)) dt.millisecond; // => 0 >dt.millisecond : Symbol(Temporal.ZonedDateTime.millisecond, Decl(lib.esnext.temporal.d.ts, --, --)) ->dt : Symbol(dt, Decl(temporal.ts, 277, 9)) +>dt : Symbol(dt, Decl(temporal.ts, 276, 9)) >millisecond : Symbol(Temporal.ZonedDateTime.millisecond, Decl(lib.esnext.temporal.d.ts, --, --)) dt.microsecond; // => 3 >dt.microsecond : Symbol(Temporal.ZonedDateTime.microsecond, Decl(lib.esnext.temporal.d.ts, --, --)) ->dt : Symbol(dt, Decl(temporal.ts, 277, 9)) +>dt : Symbol(dt, Decl(temporal.ts, 276, 9)) >microsecond : Symbol(Temporal.ZonedDateTime.microsecond, Decl(lib.esnext.temporal.d.ts, --, --)) dt.nanosecond; // => 500 >dt.nanosecond : Symbol(Temporal.ZonedDateTime.nanosecond, Decl(lib.esnext.temporal.d.ts, --, --)) ->dt : Symbol(dt, Decl(temporal.ts, 277, 9)) +>dt : Symbol(dt, Decl(temporal.ts, 276, 9)) >nanosecond : Symbol(Temporal.ZonedDateTime.nanosecond, Decl(lib.esnext.temporal.d.ts, --, --)) } { const zdt = Temporal.ZonedDateTime.from("2020-02-01T12:30+09:00[Asia/Tokyo]"); ->zdt : Symbol(zdt, Decl(temporal.ts, 291, 9)) +>zdt : Symbol(zdt, Decl(temporal.ts, 290, 9)) >Temporal.ZonedDateTime.from : Symbol(Temporal.ZonedDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.ZonedDateTime : Symbol(Temporal.ZonedDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -992,43 +983,43 @@ >from : Symbol(Temporal.ZonedDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) const epochMs = zdt.epochMilliseconds; ->epochMs : Symbol(epochMs, Decl(temporal.ts, 292, 9)) +>epochMs : Symbol(epochMs, Decl(temporal.ts, 291, 9)) >zdt.epochMilliseconds : Symbol(Temporal.ZonedDateTime.epochMilliseconds, Decl(lib.esnext.temporal.d.ts, --, --)) ->zdt : Symbol(zdt, Decl(temporal.ts, 291, 9)) +>zdt : Symbol(zdt, Decl(temporal.ts, 290, 9)) >epochMilliseconds : Symbol(Temporal.ZonedDateTime.epochMilliseconds, Decl(lib.esnext.temporal.d.ts, --, --)) // => 1580527800000 zdt.toInstant().epochMilliseconds; >zdt.toInstant().epochMilliseconds : Symbol(Temporal.Instant.epochMilliseconds, Decl(lib.esnext.temporal.d.ts, --, --)) >zdt.toInstant : Symbol(Temporal.ZonedDateTime.toInstant, Decl(lib.esnext.temporal.d.ts, --, --)) ->zdt : Symbol(zdt, Decl(temporal.ts, 291, 9)) +>zdt : Symbol(zdt, Decl(temporal.ts, 290, 9)) >toInstant : Symbol(Temporal.ZonedDateTime.toInstant, Decl(lib.esnext.temporal.d.ts, --, --)) >epochMilliseconds : Symbol(Temporal.Instant.epochMilliseconds, Decl(lib.esnext.temporal.d.ts, --, --)) // => 1580527800000 const legacyDate = new Date(epochMs); ->legacyDate : Symbol(legacyDate, Decl(temporal.ts, 296, 9)) +>legacyDate : Symbol(legacyDate, Decl(temporal.ts, 295, 9)) >Date : Symbol(Date, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.esnext.date.d.ts, --, --)) ->epochMs : Symbol(epochMs, Decl(temporal.ts, 292, 9)) +>epochMs : Symbol(epochMs, Decl(temporal.ts, 291, 9)) // => 2020-02-01T03:30:00.000Z // (if the system time zone is America/Los_Angeles) const epochNanos = zdt.epochNanoseconds; ->epochNanos : Symbol(epochNanos, Decl(temporal.ts, 299, 9)) +>epochNanos : Symbol(epochNanos, Decl(temporal.ts, 298, 9)) >zdt.epochNanoseconds : Symbol(Temporal.ZonedDateTime.epochNanoseconds, Decl(lib.esnext.temporal.d.ts, --, --)) ->zdt : Symbol(zdt, Decl(temporal.ts, 291, 9)) +>zdt : Symbol(zdt, Decl(temporal.ts, 290, 9)) >epochNanoseconds : Symbol(Temporal.ZonedDateTime.epochNanoseconds, Decl(lib.esnext.temporal.d.ts, --, --)) // => 1580527800000000000n // If you need epoch seconds data: const epochSecs = Math.floor(zdt.epochMilliseconds / 1000); // => 1553906700 ->epochSecs : Symbol(epochSecs, Decl(temporal.ts, 303, 9)) +>epochSecs : Symbol(epochSecs, Decl(temporal.ts, 302, 9)) >Math.floor : Symbol(Math.floor, Decl(lib.es5.d.ts, --, --)) >Math : Symbol(Math, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) >floor : Symbol(Math.floor, Decl(lib.es5.d.ts, --, --)) >zdt.epochMilliseconds : Symbol(Temporal.ZonedDateTime.epochMilliseconds, Decl(lib.esnext.temporal.d.ts, --, --)) ->zdt : Symbol(zdt, Decl(temporal.ts, 291, 9)) +>zdt : Symbol(zdt, Decl(temporal.ts, 290, 9)) >epochMilliseconds : Symbol(Temporal.ZonedDateTime.epochMilliseconds, Decl(lib.esnext.temporal.d.ts, --, --)) // => 1580527800 @@ -1036,22 +1027,22 @@ // If you need epoch microseconds data: // (Note the extra check for correct floor rounding with bigints) const ns = zdt.epochNanoseconds; ->ns : Symbol(ns, Decl(temporal.ts, 308, 9)) +>ns : Symbol(ns, Decl(temporal.ts, 307, 9)) >zdt.epochNanoseconds : Symbol(Temporal.ZonedDateTime.epochNanoseconds, Decl(lib.esnext.temporal.d.ts, --, --)) ->zdt : Symbol(zdt, Decl(temporal.ts, 291, 9)) +>zdt : Symbol(zdt, Decl(temporal.ts, 290, 9)) >epochNanoseconds : Symbol(Temporal.ZonedDateTime.epochNanoseconds, Decl(lib.esnext.temporal.d.ts, --, --)) const epochMicros = ns / 1000n + ((ns % 1000n) < 0n ? -1n : 0n); ->epochMicros : Symbol(epochMicros, Decl(temporal.ts, 309, 9)) ->ns : Symbol(ns, Decl(temporal.ts, 308, 9)) ->ns : Symbol(ns, Decl(temporal.ts, 308, 9)) +>epochMicros : Symbol(epochMicros, Decl(temporal.ts, 308, 9)) +>ns : Symbol(ns, Decl(temporal.ts, 307, 9)) +>ns : Symbol(ns, Decl(temporal.ts, 307, 9)) // => 1580527800000000n } { const zdt = Temporal.ZonedDateTime.from("1995-12-07T03:24-08:00[America/Los_Angeles]"); ->zdt : Symbol(zdt, Decl(temporal.ts, 314, 9)) +>zdt : Symbol(zdt, Decl(temporal.ts, 313, 9)) >Temporal.ZonedDateTime.from : Symbol(Temporal.ZonedDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.ZonedDateTime : Symbol(Temporal.ZonedDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -1060,14 +1051,14 @@ `Time zone is: ${zdt.timeZoneId}`; >zdt.timeZoneId : Symbol(Temporal.ZonedDateTime.timeZoneId, Decl(lib.esnext.temporal.d.ts, --, --)) ->zdt : Symbol(zdt, Decl(temporal.ts, 314, 9)) +>zdt : Symbol(zdt, Decl(temporal.ts, 313, 9)) >timeZoneId : Symbol(Temporal.ZonedDateTime.timeZoneId, Decl(lib.esnext.temporal.d.ts, --, --)) // => 'Time zone is: America/Los_Angeles' zdt.withTimeZone("Asia/Kolkata").timeZoneId; >zdt.withTimeZone("Asia/Kolkata").timeZoneId : Symbol(Temporal.ZonedDateTime.timeZoneId, Decl(lib.esnext.temporal.d.ts, --, --)) >zdt.withTimeZone : Symbol(Temporal.ZonedDateTime.withTimeZone, Decl(lib.esnext.temporal.d.ts, --, --)) ->zdt : Symbol(zdt, Decl(temporal.ts, 314, 9)) +>zdt : Symbol(zdt, Decl(temporal.ts, 313, 9)) >withTimeZone : Symbol(Temporal.ZonedDateTime.withTimeZone, Decl(lib.esnext.temporal.d.ts, --, --)) >timeZoneId : Symbol(Temporal.ZonedDateTime.timeZoneId, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -1075,7 +1066,7 @@ zdt.withTimeZone("Asia/Calcutta").timeZoneId; >zdt.withTimeZone("Asia/Calcutta").timeZoneId : Symbol(Temporal.ZonedDateTime.timeZoneId, Decl(lib.esnext.temporal.d.ts, --, --)) >zdt.withTimeZone : Symbol(Temporal.ZonedDateTime.withTimeZone, Decl(lib.esnext.temporal.d.ts, --, --)) ->zdt : Symbol(zdt, Decl(temporal.ts, 314, 9)) +>zdt : Symbol(zdt, Decl(temporal.ts, 313, 9)) >withTimeZone : Symbol(Temporal.ZonedDateTime.withTimeZone, Decl(lib.esnext.temporal.d.ts, --, --)) >timeZoneId : Symbol(Temporal.ZonedDateTime.timeZoneId, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -1084,7 +1075,7 @@ zdt.withTimeZone("europe/paris").timeZoneId; >zdt.withTimeZone("europe/paris").timeZoneId : Symbol(Temporal.ZonedDateTime.timeZoneId, Decl(lib.esnext.temporal.d.ts, --, --)) >zdt.withTimeZone : Symbol(Temporal.ZonedDateTime.withTimeZone, Decl(lib.esnext.temporal.d.ts, --, --)) ->zdt : Symbol(zdt, Decl(temporal.ts, 314, 9)) +>zdt : Symbol(zdt, Decl(temporal.ts, 313, 9)) >withTimeZone : Symbol(Temporal.ZonedDateTime.withTimeZone, Decl(lib.esnext.temporal.d.ts, --, --)) >timeZoneId : Symbol(Temporal.ZonedDateTime.timeZoneId, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -1093,7 +1084,7 @@ zdt.withTimeZone("+05:00").timeZoneId; >zdt.withTimeZone("+05:00").timeZoneId : Symbol(Temporal.ZonedDateTime.timeZoneId, Decl(lib.esnext.temporal.d.ts, --, --)) >zdt.withTimeZone : Symbol(Temporal.ZonedDateTime.withTimeZone, Decl(lib.esnext.temporal.d.ts, --, --)) ->zdt : Symbol(zdt, Decl(temporal.ts, 314, 9)) +>zdt : Symbol(zdt, Decl(temporal.ts, 313, 9)) >withTimeZone : Symbol(Temporal.ZonedDateTime.withTimeZone, Decl(lib.esnext.temporal.d.ts, --, --)) >timeZoneId : Symbol(Temporal.ZonedDateTime.timeZoneId, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -1101,7 +1092,7 @@ zdt.withTimeZone("+05").timeZoneId; >zdt.withTimeZone("+05").timeZoneId : Symbol(Temporal.ZonedDateTime.timeZoneId, Decl(lib.esnext.temporal.d.ts, --, --)) >zdt.withTimeZone : Symbol(Temporal.ZonedDateTime.withTimeZone, Decl(lib.esnext.temporal.d.ts, --, --)) ->zdt : Symbol(zdt, Decl(temporal.ts, 314, 9)) +>zdt : Symbol(zdt, Decl(temporal.ts, 313, 9)) >withTimeZone : Symbol(Temporal.ZonedDateTime.withTimeZone, Decl(lib.esnext.temporal.d.ts, --, --)) >timeZoneId : Symbol(Temporal.ZonedDateTime.timeZoneId, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -1109,7 +1100,7 @@ zdt.withTimeZone("+0500").timeZoneId; >zdt.withTimeZone("+0500").timeZoneId : Symbol(Temporal.ZonedDateTime.timeZoneId, Decl(lib.esnext.temporal.d.ts, --, --)) >zdt.withTimeZone : Symbol(Temporal.ZonedDateTime.withTimeZone, Decl(lib.esnext.temporal.d.ts, --, --)) ->zdt : Symbol(zdt, Decl(temporal.ts, 314, 9)) +>zdt : Symbol(zdt, Decl(temporal.ts, 313, 9)) >withTimeZone : Symbol(Temporal.ZonedDateTime.withTimeZone, Decl(lib.esnext.temporal.d.ts, --, --)) >timeZoneId : Symbol(Temporal.ZonedDateTime.timeZoneId, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -1118,7 +1109,7 @@ { const date = Temporal.ZonedDateTime.from("-000015-01-01T12:30[Europe/Rome][u-ca=gregory]"); ->date : Symbol(date, Decl(temporal.ts, 334, 9)) +>date : Symbol(date, Decl(temporal.ts, 333, 9)) >Temporal.ZonedDateTime.from : Symbol(Temporal.ZonedDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.ZonedDateTime : Symbol(Temporal.ZonedDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -1127,19 +1118,19 @@ date.era; >date.era : Symbol(Temporal.ZonedDateTime.era, Decl(lib.esnext.temporal.d.ts, --, --)) ->date : Symbol(date, Decl(temporal.ts, 334, 9)) +>date : Symbol(date, Decl(temporal.ts, 333, 9)) >era : Symbol(Temporal.ZonedDateTime.era, Decl(lib.esnext.temporal.d.ts, --, --)) // => 'bce' date.eraYear; >date.eraYear : Symbol(Temporal.ZonedDateTime.eraYear, Decl(lib.esnext.temporal.d.ts, --, --)) ->date : Symbol(date, Decl(temporal.ts, 334, 9)) +>date : Symbol(date, Decl(temporal.ts, 333, 9)) >eraYear : Symbol(Temporal.ZonedDateTime.eraYear, Decl(lib.esnext.temporal.d.ts, --, --)) // => 16 date.year; >date.year : Symbol(Temporal.ZonedDateTime.year, Decl(lib.esnext.temporal.d.ts, --, --)) ->date : Symbol(date, Decl(temporal.ts, 334, 9)) +>date : Symbol(date, Decl(temporal.ts, 333, 9)) >year : Symbol(Temporal.ZonedDateTime.year, Decl(lib.esnext.temporal.d.ts, --, --)) // => -15 @@ -1147,7 +1138,7 @@ { const zdt = Temporal.ZonedDateTime.from("1995-12-07T03:24-08:00[America/Los_Angeles]"); ->zdt : Symbol(zdt, Decl(temporal.ts, 344, 9)) +>zdt : Symbol(zdt, Decl(temporal.ts, 343, 9)) >Temporal.ZonedDateTime.from : Symbol(Temporal.ZonedDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.ZonedDateTime : Symbol(Temporal.ZonedDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -1156,13 +1147,13 @@ ["MON", "TUE", "WED", "THU", "FRI", "SAT", "SUN"][zdt.dayOfWeek - 1]; // => 'THU' >zdt.dayOfWeek : Symbol(Temporal.ZonedDateTime.dayOfWeek, Decl(lib.esnext.temporal.d.ts, --, --)) ->zdt : Symbol(zdt, Decl(temporal.ts, 344, 9)) +>zdt : Symbol(zdt, Decl(temporal.ts, 343, 9)) >dayOfWeek : Symbol(Temporal.ZonedDateTime.dayOfWeek, Decl(lib.esnext.temporal.d.ts, --, --)) } { const zdt = Temporal.ZonedDateTime.from("1995-12-07T03:24-08:00[America/Los_Angeles]"); ->zdt : Symbol(zdt, Decl(temporal.ts, 349, 9)) +>zdt : Symbol(zdt, Decl(temporal.ts, 348, 9)) >Temporal.ZonedDateTime.from : Symbol(Temporal.ZonedDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.ZonedDateTime : Symbol(Temporal.ZonedDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -1175,16 +1166,16 @@ >console : Symbol(console, Decl(lib.dom.d.ts, --, --)) >log : Symbol(Console.log, Decl(lib.dom.d.ts, --, --)) >zdt.year : Symbol(Temporal.ZonedDateTime.year, Decl(lib.esnext.temporal.d.ts, --, --)) ->zdt : Symbol(zdt, Decl(temporal.ts, 349, 9)) +>zdt : Symbol(zdt, Decl(temporal.ts, 348, 9)) >year : Symbol(Temporal.ZonedDateTime.year, Decl(lib.esnext.temporal.d.ts, --, --)) >zdt.dayOfYear : Symbol(Temporal.ZonedDateTime.dayOfYear, Decl(lib.esnext.temporal.d.ts, --, --)) ->zdt : Symbol(zdt, Decl(temporal.ts, 349, 9)) +>zdt : Symbol(zdt, Decl(temporal.ts, 348, 9)) >dayOfYear : Symbol(Temporal.ZonedDateTime.dayOfYear, Decl(lib.esnext.temporal.d.ts, --, --)) } { const zdt = Temporal.ZonedDateTime.from("2022-01-01T03:24-08:00[America/Los_Angeles]"); ->zdt : Symbol(zdt, Decl(temporal.ts, 355, 9)) +>zdt : Symbol(zdt, Decl(temporal.ts, 354, 9)) >Temporal.ZonedDateTime.from : Symbol(Temporal.ZonedDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.ZonedDateTime : Symbol(Temporal.ZonedDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -1197,19 +1188,19 @@ >console : Symbol(console, Decl(lib.dom.d.ts, --, --)) >log : Symbol(Console.log, Decl(lib.dom.d.ts, --, --)) >zdt.yearOfWeek : Symbol(Temporal.ZonedDateTime.yearOfWeek, Decl(lib.esnext.temporal.d.ts, --, --)) ->zdt : Symbol(zdt, Decl(temporal.ts, 355, 9)) +>zdt : Symbol(zdt, Decl(temporal.ts, 354, 9)) >yearOfWeek : Symbol(Temporal.ZonedDateTime.yearOfWeek, Decl(lib.esnext.temporal.d.ts, --, --)) >zdt.weekOfYear : Symbol(Temporal.ZonedDateTime.weekOfYear, Decl(lib.esnext.temporal.d.ts, --, --)) ->zdt : Symbol(zdt, Decl(temporal.ts, 355, 9)) +>zdt : Symbol(zdt, Decl(temporal.ts, 354, 9)) >weekOfYear : Symbol(Temporal.ZonedDateTime.weekOfYear, Decl(lib.esnext.temporal.d.ts, --, --)) >zdt.dayOfWeek : Symbol(Temporal.ZonedDateTime.dayOfWeek, Decl(lib.esnext.temporal.d.ts, --, --)) ->zdt : Symbol(zdt, Decl(temporal.ts, 355, 9)) +>zdt : Symbol(zdt, Decl(temporal.ts, 354, 9)) >dayOfWeek : Symbol(Temporal.ZonedDateTime.dayOfWeek, Decl(lib.esnext.temporal.d.ts, --, --)) } { const zdt = Temporal.ZonedDateTime.from("1995-12-07T03:24-08:00[America/Los_Angeles]"); ->zdt : Symbol(zdt, Decl(temporal.ts, 361, 9)) +>zdt : Symbol(zdt, Decl(temporal.ts, 360, 9)) >Temporal.ZonedDateTime.from : Symbol(Temporal.ZonedDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.ZonedDateTime : Symbol(Temporal.ZonedDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -1218,25 +1209,25 @@ zdt.daysInWeek; // => 7 >zdt.daysInWeek : Symbol(Temporal.ZonedDateTime.daysInWeek, Decl(lib.esnext.temporal.d.ts, --, --)) ->zdt : Symbol(zdt, Decl(temporal.ts, 361, 9)) +>zdt : Symbol(zdt, Decl(temporal.ts, 360, 9)) >daysInWeek : Symbol(Temporal.ZonedDateTime.daysInWeek, Decl(lib.esnext.temporal.d.ts, --, --)) } { // Attempt to write some mnemonic poetry const monthsByDays: Record = {}; ->monthsByDays : Symbol(monthsByDays, Decl(temporal.ts, 367, 9)) +>monthsByDays : Symbol(monthsByDays, Decl(temporal.ts, 366, 9)) >Record : Symbol(Record, Decl(lib.es5.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) >ZonedDateTime : Symbol(Temporal.ZonedDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) for (let month = 1; month <= 12; month++) { ->month : Symbol(month, Decl(temporal.ts, 368, 12)) ->month : Symbol(month, Decl(temporal.ts, 368, 12)) ->month : Symbol(month, Decl(temporal.ts, 368, 12)) +>month : Symbol(month, Decl(temporal.ts, 367, 12)) +>month : Symbol(month, Decl(temporal.ts, 367, 12)) +>month : Symbol(month, Decl(temporal.ts, 367, 12)) const zdt = Temporal.Now.zonedDateTimeISO().with({ month }); ->zdt : Symbol(zdt, Decl(temporal.ts, 369, 13)) +>zdt : Symbol(zdt, Decl(temporal.ts, 368, 13)) >Temporal.Now.zonedDateTimeISO().with : Symbol(Temporal.ZonedDateTime.with, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.Now.zonedDateTimeISO : Symbol(Temporal.Now.zonedDateTimeISO, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.Now : Symbol(Temporal.Now, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -1244,65 +1235,65 @@ >Now : Symbol(Temporal.Now, Decl(lib.esnext.temporal.d.ts, --, --)) >zonedDateTimeISO : Symbol(Temporal.Now.zonedDateTimeISO, Decl(lib.esnext.temporal.d.ts, --, --)) >with : Symbol(Temporal.ZonedDateTime.with, Decl(lib.esnext.temporal.d.ts, --, --)) ->month : Symbol(month, Decl(temporal.ts, 369, 58)) +>month : Symbol(month, Decl(temporal.ts, 368, 58)) monthsByDays[zdt.daysInMonth] = (monthsByDays[zdt.daysInMonth] || []).concat(zdt); ->monthsByDays : Symbol(monthsByDays, Decl(temporal.ts, 367, 9)) +>monthsByDays : Symbol(monthsByDays, Decl(temporal.ts, 366, 9)) >zdt.daysInMonth : Symbol(Temporal.ZonedDateTime.daysInMonth, Decl(lib.esnext.temporal.d.ts, --, --)) ->zdt : Symbol(zdt, Decl(temporal.ts, 369, 13)) +>zdt : Symbol(zdt, Decl(temporal.ts, 368, 13)) >daysInMonth : Symbol(Temporal.ZonedDateTime.daysInMonth, Decl(lib.esnext.temporal.d.ts, --, --)) >(monthsByDays[zdt.daysInMonth] || []).concat : Symbol(Array.concat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) ->monthsByDays : Symbol(monthsByDays, Decl(temporal.ts, 367, 9)) +>monthsByDays : Symbol(monthsByDays, Decl(temporal.ts, 366, 9)) >zdt.daysInMonth : Symbol(Temporal.ZonedDateTime.daysInMonth, Decl(lib.esnext.temporal.d.ts, --, --)) ->zdt : Symbol(zdt, Decl(temporal.ts, 369, 13)) +>zdt : Symbol(zdt, Decl(temporal.ts, 368, 13)) >daysInMonth : Symbol(Temporal.ZonedDateTime.daysInMonth, Decl(lib.esnext.temporal.d.ts, --, --)) >concat : Symbol(Array.concat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) ->zdt : Symbol(zdt, Decl(temporal.ts, 369, 13)) +>zdt : Symbol(zdt, Decl(temporal.ts, 368, 13)) } const strings = monthsByDays[30].map(zdt => zdt.toLocaleString("en", { month: "long" })); ->strings : Symbol(strings, Decl(temporal.ts, 373, 9)) +>strings : Symbol(strings, Decl(temporal.ts, 372, 9)) >monthsByDays[30].map : Symbol(Array.map, Decl(lib.es5.d.ts, --, --)) ->monthsByDays : Symbol(monthsByDays, Decl(temporal.ts, 367, 9)) +>monthsByDays : Symbol(monthsByDays, Decl(temporal.ts, 366, 9)) >map : Symbol(Array.map, Decl(lib.es5.d.ts, --, --)) ->zdt : Symbol(zdt, Decl(temporal.ts, 373, 41)) +>zdt : Symbol(zdt, Decl(temporal.ts, 372, 41)) >zdt.toLocaleString : Symbol(Temporal.ZonedDateTime.toLocaleString, Decl(lib.esnext.temporal.d.ts, --, --)) ->zdt : Symbol(zdt, Decl(temporal.ts, 373, 41)) +>zdt : Symbol(zdt, Decl(temporal.ts, 372, 41)) >toLocaleString : Symbol(Temporal.ZonedDateTime.toLocaleString, Decl(lib.esnext.temporal.d.ts, --, --)) ->month : Symbol(month, Decl(temporal.ts, 373, 74)) +>month : Symbol(month, Decl(temporal.ts, 372, 74)) // Shuffle to improve poem as determined empirically strings.unshift(strings.pop()!); >strings.unshift : Symbol(Array.unshift, Decl(lib.es5.d.ts, --, --)) ->strings : Symbol(strings, Decl(temporal.ts, 373, 9)) +>strings : Symbol(strings, Decl(temporal.ts, 372, 9)) >unshift : Symbol(Array.unshift, Decl(lib.es5.d.ts, --, --)) >strings.pop : Symbol(Array.pop, Decl(lib.es5.d.ts, --, --)) ->strings : Symbol(strings, Decl(temporal.ts, 373, 9)) +>strings : Symbol(strings, Decl(temporal.ts, 372, 9)) >pop : Symbol(Array.pop, Decl(lib.es5.d.ts, --, --)) const format = new Intl.ListFormat("en"); ->format : Symbol(format, Decl(temporal.ts, 376, 9)) +>format : Symbol(format, Decl(temporal.ts, 375, 9)) >Intl.ListFormat : Symbol(Intl.ListFormat, Decl(lib.es2021.intl.d.ts, --, --), Decl(lib.es2021.intl.d.ts, --, --)) >Intl : Symbol(Intl, Decl(lib.es5.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2020.intl.d.ts, --, --), Decl(lib.es2021.intl.d.ts, --, --), Decl(lib.es2025.intl.d.ts, --, --) ... and 1 more) >ListFormat : Symbol(Intl.ListFormat, Decl(lib.es2021.intl.d.ts, --, --), Decl(lib.es2021.intl.d.ts, --, --)) const poem = `Thirty days hath ${format.format(strings)}`; ->poem : Symbol(poem, Decl(temporal.ts, 377, 9)) +>poem : Symbol(poem, Decl(temporal.ts, 376, 9)) >format.format : Symbol(Intl.ListFormat.format, Decl(lib.es2021.intl.d.ts, --, --)) ->format : Symbol(format, Decl(temporal.ts, 376, 9)) +>format : Symbol(format, Decl(temporal.ts, 375, 9)) >format : Symbol(Intl.ListFormat.format, Decl(lib.es2021.intl.d.ts, --, --)) ->strings : Symbol(strings, Decl(temporal.ts, 373, 9)) +>strings : Symbol(strings, Decl(temporal.ts, 372, 9)) console.log(poem); >console.log : Symbol(Console.log, Decl(lib.dom.d.ts, --, --)) >console : Symbol(console, Decl(lib.dom.d.ts, --, --)) >log : Symbol(Console.log, Decl(lib.dom.d.ts, --, --)) ->poem : Symbol(poem, Decl(temporal.ts, 377, 9)) +>poem : Symbol(poem, Decl(temporal.ts, 376, 9)) } { const zdt = Temporal.Now.zonedDateTimeISO(); ->zdt : Symbol(zdt, Decl(temporal.ts, 383, 9)) +>zdt : Symbol(zdt, Decl(temporal.ts, 382, 9)) >Temporal.Now.zonedDateTimeISO : Symbol(Temporal.Now.zonedDateTimeISO, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.Now : Symbol(Temporal.Now, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -1310,26 +1301,26 @@ >zonedDateTimeISO : Symbol(Temporal.Now.zonedDateTimeISO, Decl(lib.esnext.temporal.d.ts, --, --)) const percent = zdt.dayOfYear / zdt.daysInYear; ->percent : Symbol(percent, Decl(temporal.ts, 384, 9)) +>percent : Symbol(percent, Decl(temporal.ts, 383, 9)) >zdt.dayOfYear : Symbol(Temporal.ZonedDateTime.dayOfYear, Decl(lib.esnext.temporal.d.ts, --, --)) ->zdt : Symbol(zdt, Decl(temporal.ts, 383, 9)) +>zdt : Symbol(zdt, Decl(temporal.ts, 382, 9)) >dayOfYear : Symbol(Temporal.ZonedDateTime.dayOfYear, Decl(lib.esnext.temporal.d.ts, --, --)) >zdt.daysInYear : Symbol(Temporal.ZonedDateTime.daysInYear, Decl(lib.esnext.temporal.d.ts, --, --)) ->zdt : Symbol(zdt, Decl(temporal.ts, 383, 9)) +>zdt : Symbol(zdt, Decl(temporal.ts, 382, 9)) >daysInYear : Symbol(Temporal.ZonedDateTime.daysInYear, Decl(lib.esnext.temporal.d.ts, --, --)) `The year is ${percent.toLocaleString("en", { style: "percent" })} over!`; >percent.toLocaleString : Symbol(Number.toLocaleString, Decl(lib.es5.d.ts, --, --)) ->percent : Symbol(percent, Decl(temporal.ts, 384, 9)) +>percent : Symbol(percent, Decl(temporal.ts, 383, 9)) >toLocaleString : Symbol(Number.toLocaleString, Decl(lib.es5.d.ts, --, --)) ->style : Symbol(style, Decl(temporal.ts, 385, 49)) +>style : Symbol(style, Decl(temporal.ts, 384, 49)) // example output: "The year is 10% over!" } { const zdt = Temporal.ZonedDateTime.from("1900-01-01T12:00+09:00[Asia/Tokyo]"); ->zdt : Symbol(zdt, Decl(temporal.ts, 390, 9)) +>zdt : Symbol(zdt, Decl(temporal.ts, 389, 9)) >Temporal.ZonedDateTime.from : Symbol(Temporal.ZonedDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.ZonedDateTime : Symbol(Temporal.ZonedDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -1338,14 +1329,14 @@ zdt.monthsInYear; // => 12 >zdt.monthsInYear : Symbol(Temporal.ZonedDateTime.monthsInYear, Decl(lib.esnext.temporal.d.ts, --, --)) ->zdt : Symbol(zdt, Decl(temporal.ts, 390, 9)) +>zdt : Symbol(zdt, Decl(temporal.ts, 389, 9)) >monthsInYear : Symbol(Temporal.ZonedDateTime.monthsInYear, Decl(lib.esnext.temporal.d.ts, --, --)) } { // Is this year a leap year? const zdt = Temporal.Now.zonedDateTimeISO(); ->zdt : Symbol(zdt, Decl(temporal.ts, 396, 9)) +>zdt : Symbol(zdt, Decl(temporal.ts, 395, 9)) >Temporal.Now.zonedDateTimeISO : Symbol(Temporal.Now.zonedDateTimeISO, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.Now : Symbol(Temporal.Now, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -1354,22 +1345,22 @@ zdt.inLeapYear; // example output: true >zdt.inLeapYear : Symbol(Temporal.ZonedDateTime.inLeapYear, Decl(lib.esnext.temporal.d.ts, --, --)) ->zdt : Symbol(zdt, Decl(temporal.ts, 396, 9)) +>zdt : Symbol(zdt, Decl(temporal.ts, 395, 9)) >inLeapYear : Symbol(Temporal.ZonedDateTime.inLeapYear, Decl(lib.esnext.temporal.d.ts, --, --)) // Is 2100 a leap year? (no, because it's divisible by 100 and not 400) zdt.with({ year: 2100 }).inLeapYear; // => false >zdt.with({ year: 2100 }).inLeapYear : Symbol(Temporal.ZonedDateTime.inLeapYear, Decl(lib.esnext.temporal.d.ts, --, --)) >zdt.with : Symbol(Temporal.ZonedDateTime.with, Decl(lib.esnext.temporal.d.ts, --, --)) ->zdt : Symbol(zdt, Decl(temporal.ts, 396, 9)) +>zdt : Symbol(zdt, Decl(temporal.ts, 395, 9)) >with : Symbol(Temporal.ZonedDateTime.with, Decl(lib.esnext.temporal.d.ts, --, --)) ->year : Symbol(year, Decl(temporal.ts, 399, 14)) +>year : Symbol(year, Decl(temporal.ts, 398, 14)) >inLeapYear : Symbol(Temporal.ZonedDateTime.inLeapYear, Decl(lib.esnext.temporal.d.ts, --, --)) } { const zdt = Temporal.ZonedDateTime.from("2010-11-07T23:00:00-03:30[America/St_Johns]"); ->zdt : Symbol(zdt, Decl(temporal.ts, 403, 9)) +>zdt : Symbol(zdt, Decl(temporal.ts, 402, 9)) >Temporal.ZonedDateTime.from : Symbol(Temporal.ZonedDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.ZonedDateTime : Symbol(Temporal.ZonedDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -1378,13 +1369,13 @@ zdt.hoursInDay; // 25 >zdt.hoursInDay : Symbol(Temporal.ZonedDateTime.hoursInDay, Decl(lib.esnext.temporal.d.ts, --, --)) ->zdt : Symbol(zdt, Decl(temporal.ts, 403, 9)) +>zdt : Symbol(zdt, Decl(temporal.ts, 402, 9)) >hoursInDay : Symbol(Temporal.ZonedDateTime.hoursInDay, Decl(lib.esnext.temporal.d.ts, --, --)) } { const zdt = Temporal.ZonedDateTime.from("2020-11-01T01:30-07:00[America/Los_Angeles]"); ->zdt : Symbol(zdt, Decl(temporal.ts, 408, 9)) +>zdt : Symbol(zdt, Decl(temporal.ts, 407, 9)) >Temporal.ZonedDateTime.from : Symbol(Temporal.ZonedDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.ZonedDateTime : Symbol(Temporal.ZonedDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -1393,7 +1384,7 @@ zdt.offsetNanoseconds; >zdt.offsetNanoseconds : Symbol(Temporal.ZonedDateTime.offsetNanoseconds, Decl(lib.esnext.temporal.d.ts, --, --)) ->zdt : Symbol(zdt, Decl(temporal.ts, 408, 9)) +>zdt : Symbol(zdt, Decl(temporal.ts, 407, 9)) >offsetNanoseconds : Symbol(Temporal.ZonedDateTime.offsetNanoseconds, Decl(lib.esnext.temporal.d.ts, --, --)) // => -25200000000000 @@ -1402,7 +1393,7 @@ { const zdt = Temporal.ZonedDateTime.from("2020-11-01T01:30-07:00[America/Los_Angeles]"); ->zdt : Symbol(zdt, Decl(temporal.ts, 415, 9)) +>zdt : Symbol(zdt, Decl(temporal.ts, 414, 9)) >Temporal.ZonedDateTime.from : Symbol(Temporal.ZonedDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.ZonedDateTime : Symbol(Temporal.ZonedDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -1411,24 +1402,24 @@ zdt.offset; >zdt.offset : Symbol(Temporal.ZonedDateTime.offset, Decl(lib.esnext.temporal.d.ts, --, --)) ->zdt : Symbol(zdt, Decl(temporal.ts, 415, 9)) +>zdt : Symbol(zdt, Decl(temporal.ts, 414, 9)) >offset : Symbol(Temporal.ZonedDateTime.offset, Decl(lib.esnext.temporal.d.ts, --, --)) // => '-07:00' zdt.withTimeZone("Asia/Kolkata").offset; >zdt.withTimeZone("Asia/Kolkata").offset : Symbol(Temporal.ZonedDateTime.offset, Decl(lib.esnext.temporal.d.ts, --, --)) >zdt.withTimeZone : Symbol(Temporal.ZonedDateTime.withTimeZone, Decl(lib.esnext.temporal.d.ts, --, --)) ->zdt : Symbol(zdt, Decl(temporal.ts, 415, 9)) +>zdt : Symbol(zdt, Decl(temporal.ts, 414, 9)) >withTimeZone : Symbol(Temporal.ZonedDateTime.withTimeZone, Decl(lib.esnext.temporal.d.ts, --, --)) >offset : Symbol(Temporal.ZonedDateTime.offset, Decl(lib.esnext.temporal.d.ts, --, --)) // => '+05:30' const minus8Hours = "-08:00"; ->minus8Hours : Symbol(minus8Hours, Decl(temporal.ts, 421, 9)) +>minus8Hours : Symbol(minus8Hours, Decl(temporal.ts, 420, 9)) const daylightTime0130 = Temporal.ZonedDateTime.from("2020-11-01T01:30-07:00[America/Los_Angeles]"); ->daylightTime0130 : Symbol(daylightTime0130, Decl(temporal.ts, 422, 9)) +>daylightTime0130 : Symbol(daylightTime0130, Decl(temporal.ts, 421, 9)) >Temporal.ZonedDateTime.from : Symbol(Temporal.ZonedDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.ZonedDateTime : Symbol(Temporal.ZonedDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -1438,12 +1429,12 @@ // => 2020-11-01T01:30:00-07:00[America/Los_Angeles] // This is Pacific Daylight Time 1:30AM const repeated0130 = daylightTime0130.with({ offset: minus8Hours }); ->repeated0130 : Symbol(repeated0130, Decl(temporal.ts, 425, 9)) +>repeated0130 : Symbol(repeated0130, Decl(temporal.ts, 424, 9)) >daylightTime0130.with : Symbol(Temporal.ZonedDateTime.with, Decl(lib.esnext.temporal.d.ts, --, --)) ->daylightTime0130 : Symbol(daylightTime0130, Decl(temporal.ts, 422, 9)) +>daylightTime0130 : Symbol(daylightTime0130, Decl(temporal.ts, 421, 9)) >with : Symbol(Temporal.ZonedDateTime.with, Decl(lib.esnext.temporal.d.ts, --, --)) ->offset : Symbol(offset, Decl(temporal.ts, 425, 48)) ->minus8Hours : Symbol(minus8Hours, Decl(temporal.ts, 421, 9)) +>offset : Symbol(offset, Decl(temporal.ts, 424, 48)) +>minus8Hours : Symbol(minus8Hours, Decl(temporal.ts, 420, 9)) // => 2020-11-01T01:30:00-08:00[America/Los_Angeles] // This is Pacific Standard Time 1:30AM @@ -1451,7 +1442,7 @@ { const zdt = Temporal.ZonedDateTime.from("1995-12-07T03:24:00-06:00[America/Chicago]"); ->zdt : Symbol(zdt, Decl(temporal.ts, 431, 9)) +>zdt : Symbol(zdt, Decl(temporal.ts, 430, 9)) >Temporal.ZonedDateTime.from : Symbol(Temporal.ZonedDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.ZonedDateTime : Symbol(Temporal.ZonedDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -1460,15 +1451,15 @@ zdt.with({ year: 2015, minute: 31 }); // => 2015-12-07T03:31:00-06:00[America/Chicago] >zdt.with : Symbol(Temporal.ZonedDateTime.with, Decl(lib.esnext.temporal.d.ts, --, --)) ->zdt : Symbol(zdt, Decl(temporal.ts, 431, 9)) +>zdt : Symbol(zdt, Decl(temporal.ts, 430, 9)) >with : Symbol(Temporal.ZonedDateTime.with, Decl(lib.esnext.temporal.d.ts, --, --)) ->year : Symbol(year, Decl(temporal.ts, 432, 14)) ->minute : Symbol(minute, Decl(temporal.ts, 432, 26)) +>year : Symbol(year, Decl(temporal.ts, 431, 14)) +>minute : Symbol(minute, Decl(temporal.ts, 431, 26)) } { const zdt = Temporal.ZonedDateTime.from("2015-12-07T03:24:30.000003500-08:00[America/Los_Angeles]"); ->zdt : Symbol(zdt, Decl(temporal.ts, 436, 9)) +>zdt : Symbol(zdt, Decl(temporal.ts, 435, 9)) >Temporal.ZonedDateTime.from : Symbol(Temporal.ZonedDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.ZonedDateTime : Symbol(Temporal.ZonedDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -1477,12 +1468,12 @@ zdt.withPlainTime({ hour: 10 }); // => 2015-12-07T10:00:00-08:00[America/Los_Angeles] >zdt.withPlainTime : Symbol(Temporal.ZonedDateTime.withPlainTime, Decl(lib.esnext.temporal.d.ts, --, --)) ->zdt : Symbol(zdt, Decl(temporal.ts, 436, 9)) +>zdt : Symbol(zdt, Decl(temporal.ts, 435, 9)) >withPlainTime : Symbol(Temporal.ZonedDateTime.withPlainTime, Decl(lib.esnext.temporal.d.ts, --, --)) ->hour : Symbol(hour, Decl(temporal.ts, 437, 23)) +>hour : Symbol(hour, Decl(temporal.ts, 436, 23)) const time = Temporal.PlainTime.from("11:22"); ->time : Symbol(time, Decl(temporal.ts, 438, 9)) +>time : Symbol(time, Decl(temporal.ts, 437, 9)) >Temporal.PlainTime.from : Symbol(Temporal.PlainTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.PlainTime : Symbol(Temporal.PlainTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -1491,29 +1482,29 @@ zdt.withPlainTime(time); // => 2015-12-07T11:22:00-08:00[America/Los_Angeles] >zdt.withPlainTime : Symbol(Temporal.ZonedDateTime.withPlainTime, Decl(lib.esnext.temporal.d.ts, --, --)) ->zdt : Symbol(zdt, Decl(temporal.ts, 436, 9)) +>zdt : Symbol(zdt, Decl(temporal.ts, 435, 9)) >withPlainTime : Symbol(Temporal.ZonedDateTime.withPlainTime, Decl(lib.esnext.temporal.d.ts, --, --)) ->time : Symbol(time, Decl(temporal.ts, 438, 9)) +>time : Symbol(time, Decl(temporal.ts, 437, 9)) zdt.withPlainTime("12:34"); // => 2015-12-07T12:34:00-08:00[America/Los_Angeles] >zdt.withPlainTime : Symbol(Temporal.ZonedDateTime.withPlainTime, Decl(lib.esnext.temporal.d.ts, --, --)) ->zdt : Symbol(zdt, Decl(temporal.ts, 436, 9)) +>zdt : Symbol(zdt, Decl(temporal.ts, 435, 9)) >withPlainTime : Symbol(Temporal.ZonedDateTime.withPlainTime, Decl(lib.esnext.temporal.d.ts, --, --)) // easier for chaining zdt.add({ days: 2, hours: 22 }).withPlainTime("00:00"); // => 2015-12-10T00:00:00-08:00[America/Los_Angeles] >zdt.add({ days: 2, hours: 22 }).withPlainTime : Symbol(Temporal.ZonedDateTime.withPlainTime, Decl(lib.esnext.temporal.d.ts, --, --)) >zdt.add : Symbol(Temporal.ZonedDateTime.add, Decl(lib.esnext.temporal.d.ts, --, --)) ->zdt : Symbol(zdt, Decl(temporal.ts, 436, 9)) +>zdt : Symbol(zdt, Decl(temporal.ts, 435, 9)) >add : Symbol(Temporal.ZonedDateTime.add, Decl(lib.esnext.temporal.d.ts, --, --)) ->days : Symbol(days, Decl(temporal.ts, 443, 13)) ->hours : Symbol(hours, Decl(temporal.ts, 443, 22)) +>days : Symbol(days, Decl(temporal.ts, 442, 13)) +>hours : Symbol(hours, Decl(temporal.ts, 442, 22)) >withPlainTime : Symbol(Temporal.ZonedDateTime.withPlainTime, Decl(lib.esnext.temporal.d.ts, --, --)) } { const zdt = Temporal.ZonedDateTime.from("1995-12-07T03:24:30+09:00[Asia/Tokyo]"); ->zdt : Symbol(zdt, Decl(temporal.ts, 447, 9)) +>zdt : Symbol(zdt, Decl(temporal.ts, 446, 9)) >Temporal.ZonedDateTime.from : Symbol(Temporal.ZonedDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.ZonedDateTime : Symbol(Temporal.ZonedDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -1522,20 +1513,20 @@ zdt.toString(); // => '1995-12-07T03:24:30+09:00[Asia/Tokyo]' >zdt.toString : Symbol(Temporal.ZonedDateTime.toString, Decl(lib.esnext.temporal.d.ts, --, --)) ->zdt : Symbol(zdt, Decl(temporal.ts, 447, 9)) +>zdt : Symbol(zdt, Decl(temporal.ts, 446, 9)) >toString : Symbol(Temporal.ZonedDateTime.toString, Decl(lib.esnext.temporal.d.ts, --, --)) zdt.withTimeZone("Africa/Accra").toString(); // => '1995-12-06T18:24:30+00:00[Africa/Accra]' >zdt.withTimeZone("Africa/Accra").toString : Symbol(Temporal.ZonedDateTime.toString, Decl(lib.esnext.temporal.d.ts, --, --)) >zdt.withTimeZone : Symbol(Temporal.ZonedDateTime.withTimeZone, Decl(lib.esnext.temporal.d.ts, --, --)) ->zdt : Symbol(zdt, Decl(temporal.ts, 447, 9)) +>zdt : Symbol(zdt, Decl(temporal.ts, 446, 9)) >withTimeZone : Symbol(Temporal.ZonedDateTime.withTimeZone, Decl(lib.esnext.temporal.d.ts, --, --)) >toString : Symbol(Temporal.ZonedDateTime.toString, Decl(lib.esnext.temporal.d.ts, --, --)) } { const zdt = Temporal.ZonedDateTime.from("1995-12-07T03:24:30.000003500+09:00[Asia/Tokyo][u-ca=japanese]"); ->zdt : Symbol(zdt, Decl(temporal.ts, 453, 9)) +>zdt : Symbol(zdt, Decl(temporal.ts, 452, 9)) >Temporal.ZonedDateTime.from : Symbol(Temporal.ZonedDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.ZonedDateTime : Symbol(Temporal.ZonedDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -1544,23 +1535,23 @@ `${zdt.era} ${zdt.eraYear}`; // => 'heisei 7' >zdt.era : Symbol(Temporal.ZonedDateTime.era, Decl(lib.esnext.temporal.d.ts, --, --)) ->zdt : Symbol(zdt, Decl(temporal.ts, 453, 9)) +>zdt : Symbol(zdt, Decl(temporal.ts, 452, 9)) >era : Symbol(Temporal.ZonedDateTime.era, Decl(lib.esnext.temporal.d.ts, --, --)) >zdt.eraYear : Symbol(Temporal.ZonedDateTime.eraYear, Decl(lib.esnext.temporal.d.ts, --, --)) ->zdt : Symbol(zdt, Decl(temporal.ts, 453, 9)) +>zdt : Symbol(zdt, Decl(temporal.ts, 452, 9)) >eraYear : Symbol(Temporal.ZonedDateTime.eraYear, Decl(lib.esnext.temporal.d.ts, --, --)) zdt.withCalendar("gregory").eraYear; // => 1995 >zdt.withCalendar("gregory").eraYear : Symbol(Temporal.ZonedDateTime.eraYear, Decl(lib.esnext.temporal.d.ts, --, --)) >zdt.withCalendar : Symbol(Temporal.ZonedDateTime.withCalendar, Decl(lib.esnext.temporal.d.ts, --, --)) ->zdt : Symbol(zdt, Decl(temporal.ts, 453, 9)) +>zdt : Symbol(zdt, Decl(temporal.ts, 452, 9)) >withCalendar : Symbol(Temporal.ZonedDateTime.withCalendar, Decl(lib.esnext.temporal.d.ts, --, --)) >eraYear : Symbol(Temporal.ZonedDateTime.eraYear, Decl(lib.esnext.temporal.d.ts, --, --)) } { const zdt = Temporal.ZonedDateTime.from("2020-03-08T00:00-08:00[America/Los_Angeles]"); ->zdt : Symbol(zdt, Decl(temporal.ts, 459, 9)) +>zdt : Symbol(zdt, Decl(temporal.ts, 458, 9)) >Temporal.ZonedDateTime.from : Symbol(Temporal.ZonedDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.ZonedDateTime : Symbol(Temporal.ZonedDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -1569,32 +1560,32 @@ // Add a day to get midnight on the day after DST starts const laterDay = zdt.add({ days: 1 }); ->laterDay : Symbol(laterDay, Decl(temporal.ts, 461, 9)) +>laterDay : Symbol(laterDay, Decl(temporal.ts, 460, 9)) >zdt.add : Symbol(Temporal.ZonedDateTime.add, Decl(lib.esnext.temporal.d.ts, --, --)) ->zdt : Symbol(zdt, Decl(temporal.ts, 459, 9)) +>zdt : Symbol(zdt, Decl(temporal.ts, 458, 9)) >add : Symbol(Temporal.ZonedDateTime.add, Decl(lib.esnext.temporal.d.ts, --, --)) ->days : Symbol(days, Decl(temporal.ts, 461, 30)) +>days : Symbol(days, Decl(temporal.ts, 460, 30)) // => 2020-03-09T00:00:00-07:00[America/Los_Angeles] // Note that the new offset is different, indicating the result is adjusted for DST. laterDay.since(zdt, { largestUnit: "hour" }).hours; >laterDay.since(zdt, { largestUnit: "hour" }).hours : Symbol(Temporal.Duration.hours, Decl(lib.esnext.temporal.d.ts, --, --)) >laterDay.since : Symbol(Temporal.ZonedDateTime.since, Decl(lib.esnext.temporal.d.ts, --, --)) ->laterDay : Symbol(laterDay, Decl(temporal.ts, 461, 9)) +>laterDay : Symbol(laterDay, Decl(temporal.ts, 460, 9)) >since : Symbol(Temporal.ZonedDateTime.since, Decl(lib.esnext.temporal.d.ts, --, --)) ->zdt : Symbol(zdt, Decl(temporal.ts, 459, 9)) ->largestUnit : Symbol(largestUnit, Decl(temporal.ts, 464, 25)) +>zdt : Symbol(zdt, Decl(temporal.ts, 458, 9)) +>largestUnit : Symbol(largestUnit, Decl(temporal.ts, 463, 25)) >hours : Symbol(Temporal.Duration.hours, Decl(lib.esnext.temporal.d.ts, --, --)) // => 23 // because one clock hour lost to DST const laterHours = zdt.add({ hours: 24 }); ->laterHours : Symbol(laterHours, Decl(temporal.ts, 468, 9)) +>laterHours : Symbol(laterHours, Decl(temporal.ts, 467, 9)) >zdt.add : Symbol(Temporal.ZonedDateTime.add, Decl(lib.esnext.temporal.d.ts, --, --)) ->zdt : Symbol(zdt, Decl(temporal.ts, 459, 9)) +>zdt : Symbol(zdt, Decl(temporal.ts, 458, 9)) >add : Symbol(Temporal.ZonedDateTime.add, Decl(lib.esnext.temporal.d.ts, --, --)) ->hours : Symbol(hours, Decl(temporal.ts, 468, 32)) +>hours : Symbol(hours, Decl(temporal.ts, 467, 32)) // => 2020-03-09T01:00:00-07:00[America/Los_Angeles] // Adding time units doesn't adjust for DST. Result is 1:00AM: 24 real-world @@ -1602,16 +1593,16 @@ laterHours.since(zdt, { largestUnit: "hour" }).hours; // => 24 >laterHours.since(zdt, { largestUnit: "hour" }).hours : Symbol(Temporal.Duration.hours, Decl(lib.esnext.temporal.d.ts, --, --)) >laterHours.since : Symbol(Temporal.ZonedDateTime.since, Decl(lib.esnext.temporal.d.ts, --, --)) ->laterHours : Symbol(laterHours, Decl(temporal.ts, 468, 9)) +>laterHours : Symbol(laterHours, Decl(temporal.ts, 467, 9)) >since : Symbol(Temporal.ZonedDateTime.since, Decl(lib.esnext.temporal.d.ts, --, --)) ->zdt : Symbol(zdt, Decl(temporal.ts, 459, 9)) ->largestUnit : Symbol(largestUnit, Decl(temporal.ts, 472, 27)) +>zdt : Symbol(zdt, Decl(temporal.ts, 458, 9)) +>largestUnit : Symbol(largestUnit, Decl(temporal.ts, 471, 27)) >hours : Symbol(Temporal.Duration.hours, Decl(lib.esnext.temporal.d.ts, --, --)) } { const zdt = Temporal.ZonedDateTime.from("2020-03-09T00:00-07:00[America/Los_Angeles]"); ->zdt : Symbol(zdt, Decl(temporal.ts, 476, 9)) +>zdt : Symbol(zdt, Decl(temporal.ts, 475, 9)) >Temporal.ZonedDateTime.from : Symbol(Temporal.ZonedDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.ZonedDateTime : Symbol(Temporal.ZonedDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -1620,32 +1611,32 @@ // Add a day to get midnight on the day after DST starts const earlierDay = zdt.subtract({ days: 1 }); ->earlierDay : Symbol(earlierDay, Decl(temporal.ts, 478, 9)) +>earlierDay : Symbol(earlierDay, Decl(temporal.ts, 477, 9)) >zdt.subtract : Symbol(Temporal.ZonedDateTime.subtract, Decl(lib.esnext.temporal.d.ts, --, --)) ->zdt : Symbol(zdt, Decl(temporal.ts, 476, 9)) +>zdt : Symbol(zdt, Decl(temporal.ts, 475, 9)) >subtract : Symbol(Temporal.ZonedDateTime.subtract, Decl(lib.esnext.temporal.d.ts, --, --)) ->days : Symbol(days, Decl(temporal.ts, 478, 37)) +>days : Symbol(days, Decl(temporal.ts, 477, 37)) // => 2020-03-08T00:00:00-08:00[America/Los_Angeles] // Note that the new offset is different, indicating the result is adjusted for DST. earlierDay.since(zdt, { largestUnit: "hour" }).hours; >earlierDay.since(zdt, { largestUnit: "hour" }).hours : Symbol(Temporal.Duration.hours, Decl(lib.esnext.temporal.d.ts, --, --)) >earlierDay.since : Symbol(Temporal.ZonedDateTime.since, Decl(lib.esnext.temporal.d.ts, --, --)) ->earlierDay : Symbol(earlierDay, Decl(temporal.ts, 478, 9)) +>earlierDay : Symbol(earlierDay, Decl(temporal.ts, 477, 9)) >since : Symbol(Temporal.ZonedDateTime.since, Decl(lib.esnext.temporal.d.ts, --, --)) ->zdt : Symbol(zdt, Decl(temporal.ts, 476, 9)) ->largestUnit : Symbol(largestUnit, Decl(temporal.ts, 481, 27)) +>zdt : Symbol(zdt, Decl(temporal.ts, 475, 9)) +>largestUnit : Symbol(largestUnit, Decl(temporal.ts, 480, 27)) >hours : Symbol(Temporal.Duration.hours, Decl(lib.esnext.temporal.d.ts, --, --)) // => -23 // because one clock hour lost to DST const earlierHours = zdt.subtract({ hours: 24 }); ->earlierHours : Symbol(earlierHours, Decl(temporal.ts, 485, 9)) +>earlierHours : Symbol(earlierHours, Decl(temporal.ts, 484, 9)) >zdt.subtract : Symbol(Temporal.ZonedDateTime.subtract, Decl(lib.esnext.temporal.d.ts, --, --)) ->zdt : Symbol(zdt, Decl(temporal.ts, 476, 9)) +>zdt : Symbol(zdt, Decl(temporal.ts, 475, 9)) >subtract : Symbol(Temporal.ZonedDateTime.subtract, Decl(lib.esnext.temporal.d.ts, --, --)) ->hours : Symbol(hours, Decl(temporal.ts, 485, 39)) +>hours : Symbol(hours, Decl(temporal.ts, 484, 39)) // => 2020-03-07T23:00:00-08:00[America/Los_Angeles] // Subtracting time units doesn't adjust for DST. Result is 11:00PM: 24 real-world @@ -1653,16 +1644,16 @@ earlierHours.since(zdt, { largestUnit: "hour" }).hours; // => -24 >earlierHours.since(zdt, { largestUnit: "hour" }).hours : Symbol(Temporal.Duration.hours, Decl(lib.esnext.temporal.d.ts, --, --)) >earlierHours.since : Symbol(Temporal.ZonedDateTime.since, Decl(lib.esnext.temporal.d.ts, --, --)) ->earlierHours : Symbol(earlierHours, Decl(temporal.ts, 485, 9)) +>earlierHours : Symbol(earlierHours, Decl(temporal.ts, 484, 9)) >since : Symbol(Temporal.ZonedDateTime.since, Decl(lib.esnext.temporal.d.ts, --, --)) ->zdt : Symbol(zdt, Decl(temporal.ts, 476, 9)) ->largestUnit : Symbol(largestUnit, Decl(temporal.ts, 489, 29)) +>zdt : Symbol(zdt, Decl(temporal.ts, 475, 9)) +>largestUnit : Symbol(largestUnit, Decl(temporal.ts, 488, 29)) >hours : Symbol(Temporal.Duration.hours, Decl(lib.esnext.temporal.d.ts, --, --)) } { const zdt1 = Temporal.ZonedDateTime.from("1995-12-07T03:24:30.000003500+05:30[Asia/Kolkata]"); ->zdt1 : Symbol(zdt1, Decl(temporal.ts, 493, 9)) +>zdt1 : Symbol(zdt1, Decl(temporal.ts, 492, 9)) >Temporal.ZonedDateTime.from : Symbol(Temporal.ZonedDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.ZonedDateTime : Symbol(Temporal.ZonedDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -1670,7 +1661,7 @@ >from : Symbol(Temporal.ZonedDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) const zdt2 = Temporal.ZonedDateTime.from("2019-01-31T15:30+05:30[Asia/Kolkata]"); ->zdt2 : Symbol(zdt2, Decl(temporal.ts, 494, 9)) +>zdt2 : Symbol(zdt2, Decl(temporal.ts, 493, 9)) >Temporal.ZonedDateTime.from : Symbol(Temporal.ZonedDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.ZonedDateTime : Symbol(Temporal.ZonedDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -1679,33 +1670,33 @@ zdt1.until(zdt2); >zdt1.until : Symbol(Temporal.ZonedDateTime.until, Decl(lib.esnext.temporal.d.ts, --, --)) ->zdt1 : Symbol(zdt1, Decl(temporal.ts, 493, 9)) +>zdt1 : Symbol(zdt1, Decl(temporal.ts, 492, 9)) >until : Symbol(Temporal.ZonedDateTime.until, Decl(lib.esnext.temporal.d.ts, --, --)) ->zdt2 : Symbol(zdt2, Decl(temporal.ts, 494, 9)) +>zdt2 : Symbol(zdt2, Decl(temporal.ts, 493, 9)) // => PT202956H5M29.9999965S zdt1.until(zdt2, { largestUnit: "year" }); >zdt1.until : Symbol(Temporal.ZonedDateTime.until, Decl(lib.esnext.temporal.d.ts, --, --)) ->zdt1 : Symbol(zdt1, Decl(temporal.ts, 493, 9)) +>zdt1 : Symbol(zdt1, Decl(temporal.ts, 492, 9)) >until : Symbol(Temporal.ZonedDateTime.until, Decl(lib.esnext.temporal.d.ts, --, --)) ->zdt2 : Symbol(zdt2, Decl(temporal.ts, 494, 9)) ->largestUnit : Symbol(largestUnit, Decl(temporal.ts, 497, 22)) +>zdt2 : Symbol(zdt2, Decl(temporal.ts, 493, 9)) +>largestUnit : Symbol(largestUnit, Decl(temporal.ts, 496, 22)) // => P23Y1M24DT12H5M29.9999965S zdt2.until(zdt1, { largestUnit: "year" }); >zdt2.until : Symbol(Temporal.ZonedDateTime.until, Decl(lib.esnext.temporal.d.ts, --, --)) ->zdt2 : Symbol(zdt2, Decl(temporal.ts, 494, 9)) +>zdt2 : Symbol(zdt2, Decl(temporal.ts, 493, 9)) >until : Symbol(Temporal.ZonedDateTime.until, Decl(lib.esnext.temporal.d.ts, --, --)) ->zdt1 : Symbol(zdt1, Decl(temporal.ts, 493, 9)) ->largestUnit : Symbol(largestUnit, Decl(temporal.ts, 499, 22)) +>zdt1 : Symbol(zdt1, Decl(temporal.ts, 492, 9)) +>largestUnit : Symbol(largestUnit, Decl(temporal.ts, 498, 22)) // => -P23Y1M24DT12H5M29.9999965S zdt1.until(zdt2, { largestUnit: "nanosecond" }); >zdt1.until : Symbol(Temporal.ZonedDateTime.until, Decl(lib.esnext.temporal.d.ts, --, --)) ->zdt1 : Symbol(zdt1, Decl(temporal.ts, 493, 9)) +>zdt1 : Symbol(zdt1, Decl(temporal.ts, 492, 9)) >until : Symbol(Temporal.ZonedDateTime.until, Decl(lib.esnext.temporal.d.ts, --, --)) ->zdt2 : Symbol(zdt2, Decl(temporal.ts, 494, 9)) ->largestUnit : Symbol(largestUnit, Decl(temporal.ts, 501, 22)) +>zdt2 : Symbol(zdt2, Decl(temporal.ts, 493, 9)) +>largestUnit : Symbol(largestUnit, Decl(temporal.ts, 500, 22)) // => PT730641929.999996544S // (precision lost) @@ -1713,70 +1704,70 @@ // Rounding, for example if you don't care about sub-seconds zdt1.until(zdt2, { smallestUnit: "second" }); >zdt1.until : Symbol(Temporal.ZonedDateTime.until, Decl(lib.esnext.temporal.d.ts, --, --)) ->zdt1 : Symbol(zdt1, Decl(temporal.ts, 493, 9)) +>zdt1 : Symbol(zdt1, Decl(temporal.ts, 492, 9)) >until : Symbol(Temporal.ZonedDateTime.until, Decl(lib.esnext.temporal.d.ts, --, --)) ->zdt2 : Symbol(zdt2, Decl(temporal.ts, 494, 9)) ->smallestUnit : Symbol(smallestUnit, Decl(temporal.ts, 506, 22)) +>zdt2 : Symbol(zdt2, Decl(temporal.ts, 493, 9)) +>smallestUnit : Symbol(smallestUnit, Decl(temporal.ts, 505, 22)) // => PT202956H5M29S // Months and years can be different lengths const [jan1, feb1, mar1] = [1, 2, 3].map(month => Temporal.ZonedDateTime.from({ year: 2020, month, day: 1, timeZone: "Asia/Seoul" })); ->jan1 : Symbol(jan1, Decl(temporal.ts, 510, 11)) ->feb1 : Symbol(feb1, Decl(temporal.ts, 510, 16)) ->mar1 : Symbol(mar1, Decl(temporal.ts, 510, 22)) +>jan1 : Symbol(jan1, Decl(temporal.ts, 509, 11)) +>feb1 : Symbol(feb1, Decl(temporal.ts, 509, 16)) +>mar1 : Symbol(mar1, Decl(temporal.ts, 509, 22)) >[1, 2, 3].map : Symbol(Array.map, Decl(lib.es5.d.ts, --, --)) >map : Symbol(Array.map, Decl(lib.es5.d.ts, --, --)) ->month : Symbol(month, Decl(temporal.ts, 510, 45)) +>month : Symbol(month, Decl(temporal.ts, 509, 45)) >Temporal.ZonedDateTime.from : Symbol(Temporal.ZonedDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.ZonedDateTime : Symbol(Temporal.ZonedDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) >ZonedDateTime : Symbol(Temporal.ZonedDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >from : Symbol(Temporal.ZonedDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) ->year : Symbol(year, Decl(temporal.ts, 510, 83)) ->month : Symbol(month, Decl(temporal.ts, 510, 95)) ->day : Symbol(day, Decl(temporal.ts, 510, 102)) ->timeZone : Symbol(timeZone, Decl(temporal.ts, 510, 110)) +>year : Symbol(year, Decl(temporal.ts, 509, 83)) +>month : Symbol(month, Decl(temporal.ts, 509, 95)) +>day : Symbol(day, Decl(temporal.ts, 509, 102)) +>timeZone : Symbol(timeZone, Decl(temporal.ts, 509, 110)) jan1.until(feb1, { largestUnit: "day" }); // => P31D >jan1.until : Symbol(Temporal.ZonedDateTime.until, Decl(lib.esnext.temporal.d.ts, --, --)) ->jan1 : Symbol(jan1, Decl(temporal.ts, 510, 11)) +>jan1 : Symbol(jan1, Decl(temporal.ts, 509, 11)) >until : Symbol(Temporal.ZonedDateTime.until, Decl(lib.esnext.temporal.d.ts, --, --)) ->feb1 : Symbol(feb1, Decl(temporal.ts, 510, 16)) ->largestUnit : Symbol(largestUnit, Decl(temporal.ts, 511, 22)) +>feb1 : Symbol(feb1, Decl(temporal.ts, 509, 16)) +>largestUnit : Symbol(largestUnit, Decl(temporal.ts, 510, 22)) jan1.until(feb1, { largestUnit: "month" }); // => P1M >jan1.until : Symbol(Temporal.ZonedDateTime.until, Decl(lib.esnext.temporal.d.ts, --, --)) ->jan1 : Symbol(jan1, Decl(temporal.ts, 510, 11)) +>jan1 : Symbol(jan1, Decl(temporal.ts, 509, 11)) >until : Symbol(Temporal.ZonedDateTime.until, Decl(lib.esnext.temporal.d.ts, --, --)) ->feb1 : Symbol(feb1, Decl(temporal.ts, 510, 16)) ->largestUnit : Symbol(largestUnit, Decl(temporal.ts, 512, 22)) +>feb1 : Symbol(feb1, Decl(temporal.ts, 509, 16)) +>largestUnit : Symbol(largestUnit, Decl(temporal.ts, 511, 22)) feb1.until(mar1, { largestUnit: "day" }); // => P29D >feb1.until : Symbol(Temporal.ZonedDateTime.until, Decl(lib.esnext.temporal.d.ts, --, --)) ->feb1 : Symbol(feb1, Decl(temporal.ts, 510, 16)) +>feb1 : Symbol(feb1, Decl(temporal.ts, 509, 16)) >until : Symbol(Temporal.ZonedDateTime.until, Decl(lib.esnext.temporal.d.ts, --, --)) ->mar1 : Symbol(mar1, Decl(temporal.ts, 510, 22)) ->largestUnit : Symbol(largestUnit, Decl(temporal.ts, 513, 22)) +>mar1 : Symbol(mar1, Decl(temporal.ts, 509, 22)) +>largestUnit : Symbol(largestUnit, Decl(temporal.ts, 512, 22)) feb1.until(mar1, { largestUnit: "month" }); // => P1M >feb1.until : Symbol(Temporal.ZonedDateTime.until, Decl(lib.esnext.temporal.d.ts, --, --)) ->feb1 : Symbol(feb1, Decl(temporal.ts, 510, 16)) +>feb1 : Symbol(feb1, Decl(temporal.ts, 509, 16)) >until : Symbol(Temporal.ZonedDateTime.until, Decl(lib.esnext.temporal.d.ts, --, --)) ->mar1 : Symbol(mar1, Decl(temporal.ts, 510, 22)) ->largestUnit : Symbol(largestUnit, Decl(temporal.ts, 514, 22)) +>mar1 : Symbol(mar1, Decl(temporal.ts, 509, 22)) +>largestUnit : Symbol(largestUnit, Decl(temporal.ts, 513, 22)) jan1.until(mar1, { largestUnit: "day" }); // => P60D >jan1.until : Symbol(Temporal.ZonedDateTime.until, Decl(lib.esnext.temporal.d.ts, --, --)) ->jan1 : Symbol(jan1, Decl(temporal.ts, 510, 11)) +>jan1 : Symbol(jan1, Decl(temporal.ts, 509, 11)) >until : Symbol(Temporal.ZonedDateTime.until, Decl(lib.esnext.temporal.d.ts, --, --)) ->mar1 : Symbol(mar1, Decl(temporal.ts, 510, 22)) ->largestUnit : Symbol(largestUnit, Decl(temporal.ts, 515, 22)) +>mar1 : Symbol(mar1, Decl(temporal.ts, 509, 22)) +>largestUnit : Symbol(largestUnit, Decl(temporal.ts, 514, 22)) } { const zdt1 = Temporal.ZonedDateTime.from("1995-12-07T03:24:30.000003500+05:30[Asia/Kolkata]"); ->zdt1 : Symbol(zdt1, Decl(temporal.ts, 519, 9)) +>zdt1 : Symbol(zdt1, Decl(temporal.ts, 518, 9)) >Temporal.ZonedDateTime.from : Symbol(Temporal.ZonedDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.ZonedDateTime : Symbol(Temporal.ZonedDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -1784,7 +1775,7 @@ >from : Symbol(Temporal.ZonedDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) const zdt2 = Temporal.ZonedDateTime.from("2019-01-31T15:30+05:30[Asia/Kolkata]"); ->zdt2 : Symbol(zdt2, Decl(temporal.ts, 520, 9)) +>zdt2 : Symbol(zdt2, Decl(temporal.ts, 519, 9)) >Temporal.ZonedDateTime.from : Symbol(Temporal.ZonedDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.ZonedDateTime : Symbol(Temporal.ZonedDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -1793,14 +1784,14 @@ zdt2.since(zdt1); // => PT202956H5M29.9999965S >zdt2.since : Symbol(Temporal.ZonedDateTime.since, Decl(lib.esnext.temporal.d.ts, --, --)) ->zdt2 : Symbol(zdt2, Decl(temporal.ts, 520, 9)) +>zdt2 : Symbol(zdt2, Decl(temporal.ts, 519, 9)) >since : Symbol(Temporal.ZonedDateTime.since, Decl(lib.esnext.temporal.d.ts, --, --)) ->zdt1 : Symbol(zdt1, Decl(temporal.ts, 519, 9)) +>zdt1 : Symbol(zdt1, Decl(temporal.ts, 518, 9)) } { const zdt = Temporal.ZonedDateTime.from("1995-12-07T03:24:30.000003500-08:00[America/Los_Angeles]"); ->zdt : Symbol(zdt, Decl(temporal.ts, 525, 9)) +>zdt : Symbol(zdt, Decl(temporal.ts, 524, 9)) >Temporal.ZonedDateTime.from : Symbol(Temporal.ZonedDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.ZonedDateTime : Symbol(Temporal.ZonedDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -1810,35 +1801,35 @@ // Round to a particular unit zdt.round({ smallestUnit: "hour" }); >zdt.round : Symbol(Temporal.ZonedDateTime.round, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) ->zdt : Symbol(zdt, Decl(temporal.ts, 525, 9)) +>zdt : Symbol(zdt, Decl(temporal.ts, 524, 9)) >round : Symbol(Temporal.ZonedDateTime.round, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) ->smallestUnit : Symbol(smallestUnit, Decl(temporal.ts, 528, 15)) +>smallestUnit : Symbol(smallestUnit, Decl(temporal.ts, 527, 15)) // => 1995-12-07T03:00:00-08:00[America/Los_Angeles] // Round to an increment of a unit, e.g. half an hour: zdt.round({ roundingIncrement: 30, smallestUnit: "minute" }); >zdt.round : Symbol(Temporal.ZonedDateTime.round, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) ->zdt : Symbol(zdt, Decl(temporal.ts, 525, 9)) +>zdt : Symbol(zdt, Decl(temporal.ts, 524, 9)) >round : Symbol(Temporal.ZonedDateTime.round, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) ->roundingIncrement : Symbol(roundingIncrement, Decl(temporal.ts, 531, 15)) ->smallestUnit : Symbol(smallestUnit, Decl(temporal.ts, 531, 38)) +>roundingIncrement : Symbol(roundingIncrement, Decl(temporal.ts, 530, 15)) +>smallestUnit : Symbol(smallestUnit, Decl(temporal.ts, 530, 38)) // => 1995-12-07T03:30:00-08:00[America/Los_Angeles] // Round to the same increment but round down instead: zdt.round({ roundingIncrement: 30, smallestUnit: "minute", roundingMode: "floor" }); >zdt.round : Symbol(Temporal.ZonedDateTime.round, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) ->zdt : Symbol(zdt, Decl(temporal.ts, 525, 9)) +>zdt : Symbol(zdt, Decl(temporal.ts, 524, 9)) >round : Symbol(Temporal.ZonedDateTime.round, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) ->roundingIncrement : Symbol(roundingIncrement, Decl(temporal.ts, 534, 15)) ->smallestUnit : Symbol(smallestUnit, Decl(temporal.ts, 534, 38)) ->roundingMode : Symbol(roundingMode, Decl(temporal.ts, 534, 62)) +>roundingIncrement : Symbol(roundingIncrement, Decl(temporal.ts, 533, 15)) +>smallestUnit : Symbol(smallestUnit, Decl(temporal.ts, 533, 38)) +>roundingMode : Symbol(roundingMode, Decl(temporal.ts, 533, 62)) // => 1995-12-07T03:00:00-08:00[America/Los_Angeles] } { const zdt = Temporal.ZonedDateTime.from("2015-10-18T12:00-02:00[America/Sao_Paulo]"); ->zdt : Symbol(zdt, Decl(temporal.ts, 539, 9)) +>zdt : Symbol(zdt, Decl(temporal.ts, 538, 9)) >Temporal.ZonedDateTime.from : Symbol(Temporal.ZonedDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.ZonedDateTime : Symbol(Temporal.ZonedDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -1847,19 +1838,19 @@ zdt.startOfDay(); // => 2015-10-18T01:00:00-02:00[America/Sao_Paulo] >zdt.startOfDay : Symbol(Temporal.ZonedDateTime.startOfDay, Decl(lib.esnext.temporal.d.ts, --, --)) ->zdt : Symbol(zdt, Decl(temporal.ts, 539, 9)) +>zdt : Symbol(zdt, Decl(temporal.ts, 538, 9)) >startOfDay : Symbol(Temporal.ZonedDateTime.startOfDay, Decl(lib.esnext.temporal.d.ts, --, --)) } { let duration: Temporal.Duration; ->duration : Symbol(duration, Decl(temporal.ts, 544, 7)) +>duration : Symbol(duration, Decl(temporal.ts, 543, 7)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) >Duration : Symbol(Temporal.Duration, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) // How long until the next offset change from now, in the current location? const tz = Temporal.Now.timeZoneId(); ->tz : Symbol(tz, Decl(temporal.ts, 546, 9)) +>tz : Symbol(tz, Decl(temporal.ts, 545, 9)) >Temporal.Now.timeZoneId : Symbol(Temporal.Now.timeZoneId, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.Now : Symbol(Temporal.Now, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -1867,55 +1858,55 @@ >timeZoneId : Symbol(Temporal.Now.timeZoneId, Decl(lib.esnext.temporal.d.ts, --, --)) const now = Temporal.Now.zonedDateTimeISO(tz); ->now : Symbol(now, Decl(temporal.ts, 547, 9)) +>now : Symbol(now, Decl(temporal.ts, 546, 9)) >Temporal.Now.zonedDateTimeISO : Symbol(Temporal.Now.zonedDateTimeISO, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.Now : Symbol(Temporal.Now, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) >Now : Symbol(Temporal.Now, Decl(lib.esnext.temporal.d.ts, --, --)) >zonedDateTimeISO : Symbol(Temporal.Now.zonedDateTimeISO, Decl(lib.esnext.temporal.d.ts, --, --)) ->tz : Symbol(tz, Decl(temporal.ts, 546, 9)) +>tz : Symbol(tz, Decl(temporal.ts, 545, 9)) const nextTransition = now.getTimeZoneTransition("next"); ->nextTransition : Symbol(nextTransition, Decl(temporal.ts, 548, 9)) +>nextTransition : Symbol(nextTransition, Decl(temporal.ts, 547, 9)) >now.getTimeZoneTransition : Symbol(Temporal.ZonedDateTime.getTimeZoneTransition, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) ->now : Symbol(now, Decl(temporal.ts, 547, 9)) +>now : Symbol(now, Decl(temporal.ts, 546, 9)) >getTimeZoneTransition : Symbol(Temporal.ZonedDateTime.getTimeZoneTransition, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) duration = nextTransition!.since(now); ->duration : Symbol(duration, Decl(temporal.ts, 544, 7)) +>duration : Symbol(duration, Decl(temporal.ts, 543, 7)) >nextTransition!.since : Symbol(Temporal.ZonedDateTime.since, Decl(lib.esnext.temporal.d.ts, --, --)) ->nextTransition : Symbol(nextTransition, Decl(temporal.ts, 548, 9)) +>nextTransition : Symbol(nextTransition, Decl(temporal.ts, 547, 9)) >since : Symbol(Temporal.ZonedDateTime.since, Decl(lib.esnext.temporal.d.ts, --, --)) ->now : Symbol(now, Decl(temporal.ts, 547, 9)) +>now : Symbol(now, Decl(temporal.ts, 546, 9)) duration.toLocaleString(); // output will vary >duration.toLocaleString : Symbol(Temporal.Duration.toLocaleString, Decl(lib.esnext.temporal.d.ts, --, --)) ->duration : Symbol(duration, Decl(temporal.ts, 544, 7)) +>duration : Symbol(duration, Decl(temporal.ts, 543, 7)) >toLocaleString : Symbol(Temporal.Duration.toLocaleString, Decl(lib.esnext.temporal.d.ts, --, --)) // How long until the previous offset change from now, in the current location? const previousTransition = now.getTimeZoneTransition("previous"); ->previousTransition : Symbol(previousTransition, Decl(temporal.ts, 553, 9)) +>previousTransition : Symbol(previousTransition, Decl(temporal.ts, 552, 9)) >now.getTimeZoneTransition : Symbol(Temporal.ZonedDateTime.getTimeZoneTransition, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) ->now : Symbol(now, Decl(temporal.ts, 547, 9)) +>now : Symbol(now, Decl(temporal.ts, 546, 9)) >getTimeZoneTransition : Symbol(Temporal.ZonedDateTime.getTimeZoneTransition, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) duration = now.since(previousTransition!); ->duration : Symbol(duration, Decl(temporal.ts, 544, 7)) +>duration : Symbol(duration, Decl(temporal.ts, 543, 7)) >now.since : Symbol(Temporal.ZonedDateTime.since, Decl(lib.esnext.temporal.d.ts, --, --)) ->now : Symbol(now, Decl(temporal.ts, 547, 9)) +>now : Symbol(now, Decl(temporal.ts, 546, 9)) >since : Symbol(Temporal.ZonedDateTime.since, Decl(lib.esnext.temporal.d.ts, --, --)) ->previousTransition : Symbol(previousTransition, Decl(temporal.ts, 553, 9)) +>previousTransition : Symbol(previousTransition, Decl(temporal.ts, 552, 9)) duration.toLocaleString(); // output will vary >duration.toLocaleString : Symbol(Temporal.Duration.toLocaleString, Decl(lib.esnext.temporal.d.ts, --, --)) ->duration : Symbol(duration, Decl(temporal.ts, 544, 7)) +>duration : Symbol(duration, Decl(temporal.ts, 543, 7)) >toLocaleString : Symbol(Temporal.Duration.toLocaleString, Decl(lib.esnext.temporal.d.ts, --, --)) } { const zdt1 = Temporal.ZonedDateTime.from("1995-12-07T03:24:30.000003500+01:00[Europe/Paris]"); ->zdt1 : Symbol(zdt1, Decl(temporal.ts, 559, 9)) +>zdt1 : Symbol(zdt1, Decl(temporal.ts, 558, 9)) >Temporal.ZonedDateTime.from : Symbol(Temporal.ZonedDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.ZonedDateTime : Symbol(Temporal.ZonedDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -1923,7 +1914,7 @@ >from : Symbol(Temporal.ZonedDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) const zdt2 = Temporal.ZonedDateTime.from("1995-12-07T03:24:30.000003500+01:00[Europe/Brussels]"); ->zdt2 : Symbol(zdt2, Decl(temporal.ts, 560, 9)) +>zdt2 : Symbol(zdt2, Decl(temporal.ts, 559, 9)) >Temporal.ZonedDateTime.from : Symbol(Temporal.ZonedDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.ZonedDateTime : Symbol(Temporal.ZonedDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -1932,120 +1923,120 @@ zdt1.equals(zdt2); // => false (same offset but different time zones) >zdt1.equals : Symbol(Temporal.ZonedDateTime.equals, Decl(lib.esnext.temporal.d.ts, --, --)) ->zdt1 : Symbol(zdt1, Decl(temporal.ts, 559, 9)) +>zdt1 : Symbol(zdt1, Decl(temporal.ts, 558, 9)) >equals : Symbol(Temporal.ZonedDateTime.equals, Decl(lib.esnext.temporal.d.ts, --, --)) ->zdt2 : Symbol(zdt2, Decl(temporal.ts, 560, 9)) +>zdt2 : Symbol(zdt2, Decl(temporal.ts, 559, 9)) zdt1.equals(zdt1); // => true >zdt1.equals : Symbol(Temporal.ZonedDateTime.equals, Decl(lib.esnext.temporal.d.ts, --, --)) ->zdt1 : Symbol(zdt1, Decl(temporal.ts, 559, 9)) +>zdt1 : Symbol(zdt1, Decl(temporal.ts, 558, 9)) >equals : Symbol(Temporal.ZonedDateTime.equals, Decl(lib.esnext.temporal.d.ts, --, --)) ->zdt1 : Symbol(zdt1, Decl(temporal.ts, 559, 9)) +>zdt1 : Symbol(zdt1, Decl(temporal.ts, 558, 9)) // To compare time zone IDs, use withTimeZone() with each ID on the same // ZonedDateTime instance, and use equals() to compare const kolkata = zdt1.withTimeZone("Asia/Kolkata"); ->kolkata : Symbol(kolkata, Decl(temporal.ts, 566, 9)) +>kolkata : Symbol(kolkata, Decl(temporal.ts, 565, 9)) >zdt1.withTimeZone : Symbol(Temporal.ZonedDateTime.withTimeZone, Decl(lib.esnext.temporal.d.ts, --, --)) ->zdt1 : Symbol(zdt1, Decl(temporal.ts, 559, 9)) +>zdt1 : Symbol(zdt1, Decl(temporal.ts, 558, 9)) >withTimeZone : Symbol(Temporal.ZonedDateTime.withTimeZone, Decl(lib.esnext.temporal.d.ts, --, --)) kolkata.equals(zdt1.withTimeZone("Asia/Calcutta")); // => true >kolkata.equals : Symbol(Temporal.ZonedDateTime.equals, Decl(lib.esnext.temporal.d.ts, --, --)) ->kolkata : Symbol(kolkata, Decl(temporal.ts, 566, 9)) +>kolkata : Symbol(kolkata, Decl(temporal.ts, 565, 9)) >equals : Symbol(Temporal.ZonedDateTime.equals, Decl(lib.esnext.temporal.d.ts, --, --)) >zdt1.withTimeZone : Symbol(Temporal.ZonedDateTime.withTimeZone, Decl(lib.esnext.temporal.d.ts, --, --)) ->zdt1 : Symbol(zdt1, Decl(temporal.ts, 559, 9)) +>zdt1 : Symbol(zdt1, Decl(temporal.ts, 558, 9)) >withTimeZone : Symbol(Temporal.ZonedDateTime.withTimeZone, Decl(lib.esnext.temporal.d.ts, --, --)) // Offset time zones are never equivalent to named time zones kolkata.equals(zdt1.withTimeZone("+05:30")); // => false >kolkata.equals : Symbol(Temporal.ZonedDateTime.equals, Decl(lib.esnext.temporal.d.ts, --, --)) ->kolkata : Symbol(kolkata, Decl(temporal.ts, 566, 9)) +>kolkata : Symbol(kolkata, Decl(temporal.ts, 565, 9)) >equals : Symbol(Temporal.ZonedDateTime.equals, Decl(lib.esnext.temporal.d.ts, --, --)) >zdt1.withTimeZone : Symbol(Temporal.ZonedDateTime.withTimeZone, Decl(lib.esnext.temporal.d.ts, --, --)) ->zdt1 : Symbol(zdt1, Decl(temporal.ts, 559, 9)) +>zdt1 : Symbol(zdt1, Decl(temporal.ts, 558, 9)) >withTimeZone : Symbol(Temporal.ZonedDateTime.withTimeZone, Decl(lib.esnext.temporal.d.ts, --, --)) const zeroOffset = zdt1.withTimeZone("+00:00"); ->zeroOffset : Symbol(zeroOffset, Decl(temporal.ts, 571, 9)) +>zeroOffset : Symbol(zeroOffset, Decl(temporal.ts, 570, 9)) >zdt1.withTimeZone : Symbol(Temporal.ZonedDateTime.withTimeZone, Decl(lib.esnext.temporal.d.ts, --, --)) ->zdt1 : Symbol(zdt1, Decl(temporal.ts, 559, 9)) +>zdt1 : Symbol(zdt1, Decl(temporal.ts, 558, 9)) >withTimeZone : Symbol(Temporal.ZonedDateTime.withTimeZone, Decl(lib.esnext.temporal.d.ts, --, --)) zeroOffset.equals(zdt1.withTimeZone("UTC")); // => false >zeroOffset.equals : Symbol(Temporal.ZonedDateTime.equals, Decl(lib.esnext.temporal.d.ts, --, --)) ->zeroOffset : Symbol(zeroOffset, Decl(temporal.ts, 571, 9)) +>zeroOffset : Symbol(zeroOffset, Decl(temporal.ts, 570, 9)) >equals : Symbol(Temporal.ZonedDateTime.equals, Decl(lib.esnext.temporal.d.ts, --, --)) >zdt1.withTimeZone : Symbol(Temporal.ZonedDateTime.withTimeZone, Decl(lib.esnext.temporal.d.ts, --, --)) ->zdt1 : Symbol(zdt1, Decl(temporal.ts, 559, 9)) +>zdt1 : Symbol(zdt1, Decl(temporal.ts, 558, 9)) >withTimeZone : Symbol(Temporal.ZonedDateTime.withTimeZone, Decl(lib.esnext.temporal.d.ts, --, --)) // For offset time zones, any valid format is accepted zeroOffset.equals(zdt1.withTimeZone("+00:00")); // => true >zeroOffset.equals : Symbol(Temporal.ZonedDateTime.equals, Decl(lib.esnext.temporal.d.ts, --, --)) ->zeroOffset : Symbol(zeroOffset, Decl(temporal.ts, 571, 9)) +>zeroOffset : Symbol(zeroOffset, Decl(temporal.ts, 570, 9)) >equals : Symbol(Temporal.ZonedDateTime.equals, Decl(lib.esnext.temporal.d.ts, --, --)) >zdt1.withTimeZone : Symbol(Temporal.ZonedDateTime.withTimeZone, Decl(lib.esnext.temporal.d.ts, --, --)) ->zdt1 : Symbol(zdt1, Decl(temporal.ts, 559, 9)) +>zdt1 : Symbol(zdt1, Decl(temporal.ts, 558, 9)) >withTimeZone : Symbol(Temporal.ZonedDateTime.withTimeZone, Decl(lib.esnext.temporal.d.ts, --, --)) zeroOffset.equals(zdt1.withTimeZone("+0000")); // => true >zeroOffset.equals : Symbol(Temporal.ZonedDateTime.equals, Decl(lib.esnext.temporal.d.ts, --, --)) ->zeroOffset : Symbol(zeroOffset, Decl(temporal.ts, 571, 9)) +>zeroOffset : Symbol(zeroOffset, Decl(temporal.ts, 570, 9)) >equals : Symbol(Temporal.ZonedDateTime.equals, Decl(lib.esnext.temporal.d.ts, --, --)) >zdt1.withTimeZone : Symbol(Temporal.ZonedDateTime.withTimeZone, Decl(lib.esnext.temporal.d.ts, --, --)) ->zdt1 : Symbol(zdt1, Decl(temporal.ts, 559, 9)) +>zdt1 : Symbol(zdt1, Decl(temporal.ts, 558, 9)) >withTimeZone : Symbol(Temporal.ZonedDateTime.withTimeZone, Decl(lib.esnext.temporal.d.ts, --, --)) zeroOffset.equals(zdt1.withTimeZone("+00")); // => true >zeroOffset.equals : Symbol(Temporal.ZonedDateTime.equals, Decl(lib.esnext.temporal.d.ts, --, --)) ->zeroOffset : Symbol(zeroOffset, Decl(temporal.ts, 571, 9)) +>zeroOffset : Symbol(zeroOffset, Decl(temporal.ts, 570, 9)) >equals : Symbol(Temporal.ZonedDateTime.equals, Decl(lib.esnext.temporal.d.ts, --, --)) >zdt1.withTimeZone : Symbol(Temporal.ZonedDateTime.withTimeZone, Decl(lib.esnext.temporal.d.ts, --, --)) ->zdt1 : Symbol(zdt1, Decl(temporal.ts, 559, 9)) +>zdt1 : Symbol(zdt1, Decl(temporal.ts, 558, 9)) >withTimeZone : Symbol(Temporal.ZonedDateTime.withTimeZone, Decl(lib.esnext.temporal.d.ts, --, --)) } { let zdt: Temporal.ZonedDateTime; ->zdt : Symbol(zdt, Decl(temporal.ts, 581, 7)) +>zdt : Symbol(zdt, Decl(temporal.ts, 580, 7)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) >ZonedDateTime : Symbol(Temporal.ZonedDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) zdt = Temporal.ZonedDateTime.from({ year: 2019, month: 12, day: 1, hour: 12, timeZone: "Africa/Lagos" }); ->zdt : Symbol(zdt, Decl(temporal.ts, 581, 7)) +>zdt : Symbol(zdt, Decl(temporal.ts, 580, 7)) >Temporal.ZonedDateTime.from : Symbol(Temporal.ZonedDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.ZonedDateTime : Symbol(Temporal.ZonedDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) >ZonedDateTime : Symbol(Temporal.ZonedDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >from : Symbol(Temporal.ZonedDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) ->year : Symbol(year, Decl(temporal.ts, 582, 39)) ->month : Symbol(month, Decl(temporal.ts, 582, 51)) ->day : Symbol(day, Decl(temporal.ts, 582, 62)) ->hour : Symbol(hour, Decl(temporal.ts, 582, 70)) ->timeZone : Symbol(timeZone, Decl(temporal.ts, 582, 80)) +>year : Symbol(year, Decl(temporal.ts, 581, 39)) +>month : Symbol(month, Decl(temporal.ts, 581, 51)) +>day : Symbol(day, Decl(temporal.ts, 581, 62)) +>hour : Symbol(hour, Decl(temporal.ts, 581, 70)) +>timeZone : Symbol(timeZone, Decl(temporal.ts, 581, 80)) zdt.toString(); // => '2019-12-01T12:00:00+01:00[Africa/Lagos]' >zdt.toString : Symbol(Temporal.ZonedDateTime.toString, Decl(lib.esnext.temporal.d.ts, --, --)) ->zdt : Symbol(zdt, Decl(temporal.ts, 581, 7)) +>zdt : Symbol(zdt, Decl(temporal.ts, 580, 7)) >toString : Symbol(Temporal.ZonedDateTime.toString, Decl(lib.esnext.temporal.d.ts, --, --)) zdt = zdt.withCalendar("japanese"); ->zdt : Symbol(zdt, Decl(temporal.ts, 581, 7)) +>zdt : Symbol(zdt, Decl(temporal.ts, 580, 7)) >zdt.withCalendar : Symbol(Temporal.ZonedDateTime.withCalendar, Decl(lib.esnext.temporal.d.ts, --, --)) ->zdt : Symbol(zdt, Decl(temporal.ts, 581, 7)) +>zdt : Symbol(zdt, Decl(temporal.ts, 580, 7)) >withCalendar : Symbol(Temporal.ZonedDateTime.withCalendar, Decl(lib.esnext.temporal.d.ts, --, --)) zdt.toString(); // => '2019-12-01T12:00:00+01:00[Africa/Lagos][u-ca=japanese]' >zdt.toString : Symbol(Temporal.ZonedDateTime.toString, Decl(lib.esnext.temporal.d.ts, --, --)) ->zdt : Symbol(zdt, Decl(temporal.ts, 581, 7)) +>zdt : Symbol(zdt, Decl(temporal.ts, 580, 7)) >toString : Symbol(Temporal.ZonedDateTime.toString, Decl(lib.esnext.temporal.d.ts, --, --)) } { const zdt = Temporal.ZonedDateTime.from("2019-12-01T12:00+01:00[Europe/Berlin]"); ->zdt : Symbol(zdt, Decl(temporal.ts, 589, 9)) +>zdt : Symbol(zdt, Decl(temporal.ts, 588, 9)) >Temporal.ZonedDateTime.from : Symbol(Temporal.ZonedDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.ZonedDateTime : Symbol(Temporal.ZonedDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -2054,51 +2045,51 @@ zdt.toLocaleString(); // example output: 12/1/2019, 12:00:00 PM >zdt.toLocaleString : Symbol(Temporal.ZonedDateTime.toLocaleString, Decl(lib.esnext.temporal.d.ts, --, --)) ->zdt : Symbol(zdt, Decl(temporal.ts, 589, 9)) +>zdt : Symbol(zdt, Decl(temporal.ts, 588, 9)) >toLocaleString : Symbol(Temporal.ZonedDateTime.toLocaleString, Decl(lib.esnext.temporal.d.ts, --, --)) zdt.toLocaleString("de-DE"); // => '1.12.2019, 12:00:00 MEZ' >zdt.toLocaleString : Symbol(Temporal.ZonedDateTime.toLocaleString, Decl(lib.esnext.temporal.d.ts, --, --)) ->zdt : Symbol(zdt, Decl(temporal.ts, 589, 9)) +>zdt : Symbol(zdt, Decl(temporal.ts, 588, 9)) >toLocaleString : Symbol(Temporal.ZonedDateTime.toLocaleString, Decl(lib.esnext.temporal.d.ts, --, --)) const options = { weekday: "long", year: "numeric", month: "long", day: "numeric" } as const; ->options : Symbol(options, Decl(temporal.ts, 592, 9)) ->weekday : Symbol(weekday, Decl(temporal.ts, 592, 21)) ->year : Symbol(year, Decl(temporal.ts, 592, 38)) ->month : Symbol(month, Decl(temporal.ts, 592, 55)) ->day : Symbol(day, Decl(temporal.ts, 592, 70)) +>options : Symbol(options, Decl(temporal.ts, 591, 9)) +>weekday : Symbol(weekday, Decl(temporal.ts, 591, 21)) +>year : Symbol(year, Decl(temporal.ts, 591, 38)) +>month : Symbol(month, Decl(temporal.ts, 591, 55)) +>day : Symbol(day, Decl(temporal.ts, 591, 70)) >const : Symbol(const) zdt.toLocaleString("de-DE", options); // => 'Sonntag, 1. Dezember 2019' >zdt.toLocaleString : Symbol(Temporal.ZonedDateTime.toLocaleString, Decl(lib.esnext.temporal.d.ts, --, --)) ->zdt : Symbol(zdt, Decl(temporal.ts, 589, 9)) +>zdt : Symbol(zdt, Decl(temporal.ts, 588, 9)) >toLocaleString : Symbol(Temporal.ZonedDateTime.toLocaleString, Decl(lib.esnext.temporal.d.ts, --, --)) ->options : Symbol(options, Decl(temporal.ts, 592, 9)) +>options : Symbol(options, Decl(temporal.ts, 591, 9)) /* WRONG */ zdt.toLocaleString("de-DE", { timeZone: "Pacific/Auckland" }); >zdt.toLocaleString : Symbol(Temporal.ZonedDateTime.toLocaleString, Decl(lib.esnext.temporal.d.ts, --, --)) ->zdt : Symbol(zdt, Decl(temporal.ts, 589, 9)) +>zdt : Symbol(zdt, Decl(temporal.ts, 588, 9)) >toLocaleString : Symbol(Temporal.ZonedDateTime.toLocaleString, Decl(lib.esnext.temporal.d.ts, --, --)) ->timeZone : Symbol(timeZone, Decl(temporal.ts, 594, 45)) +>timeZone : Symbol(timeZone, Decl(temporal.ts, 593, 45)) // => RangeError: Time zone option Pacific/Auckland does not match actual time zone Europe/Berlin zdt.withTimeZone("Pacific/Auckland").toLocaleString("de-DE"); // => '2.12.2019, 0:00:00 GMT+13' >zdt.withTimeZone("Pacific/Auckland").toLocaleString : Symbol(Temporal.ZonedDateTime.toLocaleString, Decl(lib.esnext.temporal.d.ts, --, --)) >zdt.withTimeZone : Symbol(Temporal.ZonedDateTime.withTimeZone, Decl(lib.esnext.temporal.d.ts, --, --)) ->zdt : Symbol(zdt, Decl(temporal.ts, 589, 9)) +>zdt : Symbol(zdt, Decl(temporal.ts, 588, 9)) >withTimeZone : Symbol(Temporal.ZonedDateTime.withTimeZone, Decl(lib.esnext.temporal.d.ts, --, --)) >toLocaleString : Symbol(Temporal.ZonedDateTime.toLocaleString, Decl(lib.esnext.temporal.d.ts, --, --)) zdt.toLocaleString("en-US-u-nu-fullwide-hc-h12"); // => '12/1/2019, 12:00:00 PM GMT+1' >zdt.toLocaleString : Symbol(Temporal.ZonedDateTime.toLocaleString, Decl(lib.esnext.temporal.d.ts, --, --)) ->zdt : Symbol(zdt, Decl(temporal.ts, 589, 9)) +>zdt : Symbol(zdt, Decl(temporal.ts, 588, 9)) >toLocaleString : Symbol(Temporal.ZonedDateTime.toLocaleString, Decl(lib.esnext.temporal.d.ts, --, --)) } { const zdt = Temporal.ZonedDateTime.from("1995-12-07T03:24:30+02:00[Africa/Johannesburg]"); ->zdt : Symbol(zdt, Decl(temporal.ts, 601, 9)) +>zdt : Symbol(zdt, Decl(temporal.ts, 600, 9)) >Temporal.ZonedDateTime.from : Symbol(Temporal.ZonedDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.ZonedDateTime : Symbol(Temporal.ZonedDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -2107,35 +2098,35 @@ zdt.toInstant(); // => 1995-12-07T01:24:30Z >zdt.toInstant : Symbol(Temporal.ZonedDateTime.toInstant, Decl(lib.esnext.temporal.d.ts, --, --)) ->zdt : Symbol(zdt, Decl(temporal.ts, 601, 9)) +>zdt : Symbol(zdt, Decl(temporal.ts, 600, 9)) >toInstant : Symbol(Temporal.ZonedDateTime.toInstant, Decl(lib.esnext.temporal.d.ts, --, --)) zdt.toPlainDateTime(); // => 1995-12-07T03:24:30 >zdt.toPlainDateTime : Symbol(Temporal.ZonedDateTime.toPlainDateTime, Decl(lib.esnext.temporal.d.ts, --, --)) ->zdt : Symbol(zdt, Decl(temporal.ts, 601, 9)) +>zdt : Symbol(zdt, Decl(temporal.ts, 600, 9)) >toPlainDateTime : Symbol(Temporal.ZonedDateTime.toPlainDateTime, Decl(lib.esnext.temporal.d.ts, --, --)) zdt.toPlainDate(); // => 1995-12-07 >zdt.toPlainDate : Symbol(Temporal.ZonedDateTime.toPlainDate, Decl(lib.esnext.temporal.d.ts, --, --)) ->zdt : Symbol(zdt, Decl(temporal.ts, 601, 9)) +>zdt : Symbol(zdt, Decl(temporal.ts, 600, 9)) >toPlainDate : Symbol(Temporal.ZonedDateTime.toPlainDate, Decl(lib.esnext.temporal.d.ts, --, --)) zdt.toPlainTime(); // => 03:24:30 >zdt.toPlainTime : Symbol(Temporal.ZonedDateTime.toPlainTime, Decl(lib.esnext.temporal.d.ts, --, --)) ->zdt : Symbol(zdt, Decl(temporal.ts, 601, 9)) +>zdt : Symbol(zdt, Decl(temporal.ts, 600, 9)) >toPlainTime : Symbol(Temporal.ZonedDateTime.toPlainTime, Decl(lib.esnext.temporal.d.ts, --, --)) zdt.toPlainDate().toPlainYearMonth(); // => 1995-12 >zdt.toPlainDate().toPlainYearMonth : Symbol(Temporal.PlainDate.toPlainYearMonth, Decl(lib.esnext.temporal.d.ts, --, --)) >zdt.toPlainDate : Symbol(Temporal.ZonedDateTime.toPlainDate, Decl(lib.esnext.temporal.d.ts, --, --)) ->zdt : Symbol(zdt, Decl(temporal.ts, 601, 9)) +>zdt : Symbol(zdt, Decl(temporal.ts, 600, 9)) >toPlainDate : Symbol(Temporal.ZonedDateTime.toPlainDate, Decl(lib.esnext.temporal.d.ts, --, --)) >toPlainYearMonth : Symbol(Temporal.PlainDate.toPlainYearMonth, Decl(lib.esnext.temporal.d.ts, --, --)) zdt.toPlainDate().toPlainMonthDay(); // => 12-07 >zdt.toPlainDate().toPlainMonthDay : Symbol(Temporal.PlainDate.toPlainMonthDay, Decl(lib.esnext.temporal.d.ts, --, --)) >zdt.toPlainDate : Symbol(Temporal.ZonedDateTime.toPlainDate, Decl(lib.esnext.temporal.d.ts, --, --)) ->zdt : Symbol(zdt, Decl(temporal.ts, 601, 9)) +>zdt : Symbol(zdt, Decl(temporal.ts, 600, 9)) >toPlainDate : Symbol(Temporal.ZonedDateTime.toPlainDate, Decl(lib.esnext.temporal.d.ts, --, --)) >toPlainMonthDay : Symbol(Temporal.PlainDate.toPlainMonthDay, Decl(lib.esnext.temporal.d.ts, --, --)) } @@ -2143,7 +2134,7 @@ { // Pi day in 2020 const date = new Temporal.PlainDate(2020, 3, 14); // => 2020-03-14 ->date : Symbol(date, Decl(temporal.ts, 612, 9)) +>date : Symbol(date, Decl(temporal.ts, 611, 9)) >Temporal.PlainDate : Symbol(Temporal.PlainDate, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) >PlainDate : Symbol(Temporal.PlainDate, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) @@ -2151,12 +2142,12 @@ { let date: Temporal.PlainDate; ->date : Symbol(date, Decl(temporal.ts, 616, 7)) +>date : Symbol(date, Decl(temporal.ts, 615, 7)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) >PlainDate : Symbol(Temporal.PlainDate, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) date = Temporal.PlainDate.from("2006-08-24"); // => 2006-08-24 ->date : Symbol(date, Decl(temporal.ts, 616, 7)) +>date : Symbol(date, Decl(temporal.ts, 615, 7)) >Temporal.PlainDate.from : Symbol(Temporal.PlainDateConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.PlainDate : Symbol(Temporal.PlainDate, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -2164,7 +2155,7 @@ >from : Symbol(Temporal.PlainDateConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) date = Temporal.PlainDate.from("20060824"); // => 2006-08-24 ->date : Symbol(date, Decl(temporal.ts, 616, 7)) +>date : Symbol(date, Decl(temporal.ts, 615, 7)) >Temporal.PlainDate.from : Symbol(Temporal.PlainDateConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.PlainDate : Symbol(Temporal.PlainDate, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -2172,7 +2163,7 @@ >from : Symbol(Temporal.PlainDateConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) date = Temporal.PlainDate.from("2006-08-24T15:43:27"); // => 2006-08-24 ->date : Symbol(date, Decl(temporal.ts, 616, 7)) +>date : Symbol(date, Decl(temporal.ts, 615, 7)) >Temporal.PlainDate.from : Symbol(Temporal.PlainDateConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.PlainDate : Symbol(Temporal.PlainDate, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -2180,7 +2171,7 @@ >from : Symbol(Temporal.PlainDateConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) date = Temporal.PlainDate.from("2006-08-24T15:43:27+01:00[Europe/Brussels]"); ->date : Symbol(date, Decl(temporal.ts, 616, 7)) +>date : Symbol(date, Decl(temporal.ts, 615, 7)) >Temporal.PlainDate.from : Symbol(Temporal.PlainDateConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.PlainDate : Symbol(Temporal.PlainDate, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -2189,27 +2180,27 @@ // => 2006-08-24 date === Temporal.PlainDate.from(date); // => false ->date : Symbol(date, Decl(temporal.ts, 616, 7)) +>date : Symbol(date, Decl(temporal.ts, 615, 7)) >Temporal.PlainDate.from : Symbol(Temporal.PlainDateConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.PlainDate : Symbol(Temporal.PlainDate, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) >PlainDate : Symbol(Temporal.PlainDate, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >from : Symbol(Temporal.PlainDateConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) ->date : Symbol(date, Decl(temporal.ts, 616, 7)) +>date : Symbol(date, Decl(temporal.ts, 615, 7)) date = Temporal.PlainDate.from({ year: 2006, month: 8, day: 24 }); // => 2006-08-24 ->date : Symbol(date, Decl(temporal.ts, 616, 7)) +>date : Symbol(date, Decl(temporal.ts, 615, 7)) >Temporal.PlainDate.from : Symbol(Temporal.PlainDateConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.PlainDate : Symbol(Temporal.PlainDate, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) >PlainDate : Symbol(Temporal.PlainDate, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >from : Symbol(Temporal.PlainDateConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) ->year : Symbol(year, Decl(temporal.ts, 625, 36)) ->month : Symbol(month, Decl(temporal.ts, 625, 48)) ->day : Symbol(day, Decl(temporal.ts, 625, 58)) +>year : Symbol(year, Decl(temporal.ts, 624, 36)) +>month : Symbol(month, Decl(temporal.ts, 624, 48)) +>day : Symbol(day, Decl(temporal.ts, 624, 58)) date = Temporal.PlainDate.from(Temporal.PlainDateTime.from("2006-08-24T15:43:27")); ->date : Symbol(date, Decl(temporal.ts, 616, 7)) +>date : Symbol(date, Decl(temporal.ts, 615, 7)) >Temporal.PlainDate.from : Symbol(Temporal.PlainDateConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.PlainDate : Symbol(Temporal.PlainDate, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -2225,77 +2216,77 @@ // same as above; Temporal.PlainDateTime has year, month, and day properties date = Temporal.PlainDate.from({ year: 1427, month: 8, day: 1, calendar: "islamic" }); ->date : Symbol(date, Decl(temporal.ts, 616, 7)) +>date : Symbol(date, Decl(temporal.ts, 615, 7)) >Temporal.PlainDate.from : Symbol(Temporal.PlainDateConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.PlainDate : Symbol(Temporal.PlainDate, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) >PlainDate : Symbol(Temporal.PlainDate, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >from : Symbol(Temporal.PlainDateConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) ->year : Symbol(year, Decl(temporal.ts, 630, 36)) ->month : Symbol(month, Decl(temporal.ts, 630, 48)) ->day : Symbol(day, Decl(temporal.ts, 630, 58)) ->calendar : Symbol(calendar, Decl(temporal.ts, 630, 66)) +>year : Symbol(year, Decl(temporal.ts, 629, 36)) +>month : Symbol(month, Decl(temporal.ts, 629, 48)) +>day : Symbol(day, Decl(temporal.ts, 629, 58)) +>calendar : Symbol(calendar, Decl(temporal.ts, 629, 66)) // => 2006-08-24[u-ca=islamic] // Different overflow modes date = Temporal.PlainDate.from({ year: 2001, month: 13, day: 1 }, { overflow: "constrain" }); ->date : Symbol(date, Decl(temporal.ts, 616, 7)) +>date : Symbol(date, Decl(temporal.ts, 615, 7)) >Temporal.PlainDate.from : Symbol(Temporal.PlainDateConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.PlainDate : Symbol(Temporal.PlainDate, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) >PlainDate : Symbol(Temporal.PlainDate, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >from : Symbol(Temporal.PlainDateConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) ->year : Symbol(year, Decl(temporal.ts, 634, 36)) ->month : Symbol(month, Decl(temporal.ts, 634, 48)) ->day : Symbol(day, Decl(temporal.ts, 634, 59)) ->overflow : Symbol(overflow, Decl(temporal.ts, 634, 71)) +>year : Symbol(year, Decl(temporal.ts, 633, 36)) +>month : Symbol(month, Decl(temporal.ts, 633, 48)) +>day : Symbol(day, Decl(temporal.ts, 633, 59)) +>overflow : Symbol(overflow, Decl(temporal.ts, 633, 71)) // => 2001-12-01 date = Temporal.PlainDate.from({ year: 2001, month: 1, day: 32 }, { overflow: "constrain" }); ->date : Symbol(date, Decl(temporal.ts, 616, 7)) +>date : Symbol(date, Decl(temporal.ts, 615, 7)) >Temporal.PlainDate.from : Symbol(Temporal.PlainDateConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.PlainDate : Symbol(Temporal.PlainDate, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) >PlainDate : Symbol(Temporal.PlainDate, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >from : Symbol(Temporal.PlainDateConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) ->year : Symbol(year, Decl(temporal.ts, 636, 36)) ->month : Symbol(month, Decl(temporal.ts, 636, 48)) ->day : Symbol(day, Decl(temporal.ts, 636, 58)) ->overflow : Symbol(overflow, Decl(temporal.ts, 636, 71)) +>year : Symbol(year, Decl(temporal.ts, 635, 36)) +>month : Symbol(month, Decl(temporal.ts, 635, 48)) +>day : Symbol(day, Decl(temporal.ts, 635, 58)) +>overflow : Symbol(overflow, Decl(temporal.ts, 635, 71)) // => 2001-01-31 date = Temporal.PlainDate.from({ year: 2001, month: 13, day: 1 }, { overflow: "reject" }); ->date : Symbol(date, Decl(temporal.ts, 616, 7)) +>date : Symbol(date, Decl(temporal.ts, 615, 7)) >Temporal.PlainDate.from : Symbol(Temporal.PlainDateConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.PlainDate : Symbol(Temporal.PlainDate, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) >PlainDate : Symbol(Temporal.PlainDate, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >from : Symbol(Temporal.PlainDateConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) ->year : Symbol(year, Decl(temporal.ts, 638, 36)) ->month : Symbol(month, Decl(temporal.ts, 638, 48)) ->day : Symbol(day, Decl(temporal.ts, 638, 59)) ->overflow : Symbol(overflow, Decl(temporal.ts, 638, 71)) +>year : Symbol(year, Decl(temporal.ts, 637, 36)) +>month : Symbol(month, Decl(temporal.ts, 637, 48)) +>day : Symbol(day, Decl(temporal.ts, 637, 59)) +>overflow : Symbol(overflow, Decl(temporal.ts, 637, 71)) // => throws date = Temporal.PlainDate.from({ year: 2001, month: 1, day: 32 }, { overflow: "reject" }); ->date : Symbol(date, Decl(temporal.ts, 616, 7)) +>date : Symbol(date, Decl(temporal.ts, 615, 7)) >Temporal.PlainDate.from : Symbol(Temporal.PlainDateConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.PlainDate : Symbol(Temporal.PlainDate, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) >PlainDate : Symbol(Temporal.PlainDate, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >from : Symbol(Temporal.PlainDateConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) ->year : Symbol(year, Decl(temporal.ts, 640, 36)) ->month : Symbol(month, Decl(temporal.ts, 640, 48)) ->day : Symbol(day, Decl(temporal.ts, 640, 58)) ->overflow : Symbol(overflow, Decl(temporal.ts, 640, 71)) +>year : Symbol(year, Decl(temporal.ts, 639, 36)) +>month : Symbol(month, Decl(temporal.ts, 639, 48)) +>day : Symbol(day, Decl(temporal.ts, 639, 58)) +>overflow : Symbol(overflow, Decl(temporal.ts, 639, 71)) // => throws } { const one = Temporal.PlainDate.from("2006-08-24"); ->one : Symbol(one, Decl(temporal.ts, 645, 9)) +>one : Symbol(one, Decl(temporal.ts, 644, 9)) >Temporal.PlainDate.from : Symbol(Temporal.PlainDateConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.PlainDate : Symbol(Temporal.PlainDate, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -2303,7 +2294,7 @@ >from : Symbol(Temporal.PlainDateConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) const two = Temporal.PlainDate.from("2015-07-14"); ->two : Symbol(two, Decl(temporal.ts, 646, 9)) +>two : Symbol(two, Decl(temporal.ts, 645, 9)) >Temporal.PlainDate.from : Symbol(Temporal.PlainDateConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.PlainDate : Symbol(Temporal.PlainDate, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -2311,7 +2302,7 @@ >from : Symbol(Temporal.PlainDateConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) const three = Temporal.PlainDate.from("1930-02-18"); ->three : Symbol(three, Decl(temporal.ts, 647, 9)) +>three : Symbol(three, Decl(temporal.ts, 646, 9)) >Temporal.PlainDate.from : Symbol(Temporal.PlainDateConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.PlainDate : Symbol(Temporal.PlainDate, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -2319,11 +2310,11 @@ >from : Symbol(Temporal.PlainDateConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) const sorted = [one, two, three].sort(Temporal.PlainDate.compare); ->sorted : Symbol(sorted, Decl(temporal.ts, 648, 9)) +>sorted : Symbol(sorted, Decl(temporal.ts, 647, 9)) >[one, two, three].sort : Symbol(Array.sort, Decl(lib.es5.d.ts, --, --)) ->one : Symbol(one, Decl(temporal.ts, 645, 9)) ->two : Symbol(two, Decl(temporal.ts, 646, 9)) ->three : Symbol(three, Decl(temporal.ts, 647, 9)) +>one : Symbol(one, Decl(temporal.ts, 644, 9)) +>two : Symbol(two, Decl(temporal.ts, 645, 9)) +>three : Symbol(three, Decl(temporal.ts, 646, 9)) >sort : Symbol(Array.sort, Decl(lib.es5.d.ts, --, --)) >Temporal.PlainDate.compare : Symbol(Temporal.PlainDateConstructor.compare, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.PlainDate : Symbol(Temporal.PlainDate, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) @@ -2333,18 +2324,18 @@ sorted.join(" "); // => '1930-02-18 2006-08-24 2015-07-14' >sorted.join : Symbol(Array.join, Decl(lib.es5.d.ts, --, --)) ->sorted : Symbol(sorted, Decl(temporal.ts, 648, 9)) +>sorted : Symbol(sorted, Decl(temporal.ts, 647, 9)) >join : Symbol(Array.join, Decl(lib.es5.d.ts, --, --)) } { let date: Temporal.PlainDate; ->date : Symbol(date, Decl(temporal.ts, 653, 7)) +>date : Symbol(date, Decl(temporal.ts, 652, 7)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) >PlainDate : Symbol(Temporal.PlainDate, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) date = Temporal.PlainDate.from("2006-08-24"); ->date : Symbol(date, Decl(temporal.ts, 653, 7)) +>date : Symbol(date, Decl(temporal.ts, 652, 7)) >Temporal.PlainDate.from : Symbol(Temporal.PlainDateConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.PlainDate : Symbol(Temporal.PlainDate, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -2353,26 +2344,26 @@ date.year; // => 2006 >date.year : Symbol(Temporal.PlainDate.year, Decl(lib.esnext.temporal.d.ts, --, --)) ->date : Symbol(date, Decl(temporal.ts, 653, 7)) +>date : Symbol(date, Decl(temporal.ts, 652, 7)) >year : Symbol(Temporal.PlainDate.year, Decl(lib.esnext.temporal.d.ts, --, --)) date.month; // => 8 >date.month : Symbol(Temporal.PlainDate.month, Decl(lib.esnext.temporal.d.ts, --, --)) ->date : Symbol(date, Decl(temporal.ts, 653, 7)) +>date : Symbol(date, Decl(temporal.ts, 652, 7)) >month : Symbol(Temporal.PlainDate.month, Decl(lib.esnext.temporal.d.ts, --, --)) date.monthCode; // => 'M08' >date.monthCode : Symbol(Temporal.PlainDate.monthCode, Decl(lib.esnext.temporal.d.ts, --, --)) ->date : Symbol(date, Decl(temporal.ts, 653, 7)) +>date : Symbol(date, Decl(temporal.ts, 652, 7)) >monthCode : Symbol(Temporal.PlainDate.monthCode, Decl(lib.esnext.temporal.d.ts, --, --)) date.day; // => 24 >date.day : Symbol(Temporal.PlainDate.day, Decl(lib.esnext.temporal.d.ts, --, --)) ->date : Symbol(date, Decl(temporal.ts, 653, 7)) +>date : Symbol(date, Decl(temporal.ts, 652, 7)) >day : Symbol(Temporal.PlainDate.day, Decl(lib.esnext.temporal.d.ts, --, --)) date = Temporal.PlainDate.from("2019-02-23[u-ca=hebrew]"); ->date : Symbol(date, Decl(temporal.ts, 653, 7)) +>date : Symbol(date, Decl(temporal.ts, 652, 7)) >Temporal.PlainDate.from : Symbol(Temporal.PlainDateConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.PlainDate : Symbol(Temporal.PlainDate, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -2381,28 +2372,28 @@ date.year; // => 5779 >date.year : Symbol(Temporal.PlainDate.year, Decl(lib.esnext.temporal.d.ts, --, --)) ->date : Symbol(date, Decl(temporal.ts, 653, 7)) +>date : Symbol(date, Decl(temporal.ts, 652, 7)) >year : Symbol(Temporal.PlainDate.year, Decl(lib.esnext.temporal.d.ts, --, --)) date.month; // => 6 >date.month : Symbol(Temporal.PlainDate.month, Decl(lib.esnext.temporal.d.ts, --, --)) ->date : Symbol(date, Decl(temporal.ts, 653, 7)) +>date : Symbol(date, Decl(temporal.ts, 652, 7)) >month : Symbol(Temporal.PlainDate.month, Decl(lib.esnext.temporal.d.ts, --, --)) date.monthCode; // => 'M05L' >date.monthCode : Symbol(Temporal.PlainDate.monthCode, Decl(lib.esnext.temporal.d.ts, --, --)) ->date : Symbol(date, Decl(temporal.ts, 653, 7)) +>date : Symbol(date, Decl(temporal.ts, 652, 7)) >monthCode : Symbol(Temporal.PlainDate.monthCode, Decl(lib.esnext.temporal.d.ts, --, --)) date.day; // => 18 >date.day : Symbol(Temporal.PlainDate.day, Decl(lib.esnext.temporal.d.ts, --, --)) ->date : Symbol(date, Decl(temporal.ts, 653, 7)) +>date : Symbol(date, Decl(temporal.ts, 652, 7)) >day : Symbol(Temporal.PlainDate.day, Decl(lib.esnext.temporal.d.ts, --, --)) } { const date = Temporal.PlainDate.from("-000015-01-01[u-ca=gregory]"); ->date : Symbol(date, Decl(temporal.ts, 669, 9)) +>date : Symbol(date, Decl(temporal.ts, 668, 9)) >Temporal.PlainDate.from : Symbol(Temporal.PlainDateConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.PlainDate : Symbol(Temporal.PlainDate, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -2411,19 +2402,19 @@ date.era; >date.era : Symbol(Temporal.PlainDate.era, Decl(lib.esnext.temporal.d.ts, --, --)) ->date : Symbol(date, Decl(temporal.ts, 669, 9)) +>date : Symbol(date, Decl(temporal.ts, 668, 9)) >era : Symbol(Temporal.PlainDate.era, Decl(lib.esnext.temporal.d.ts, --, --)) // => 'bce' date.eraYear; >date.eraYear : Symbol(Temporal.PlainDate.eraYear, Decl(lib.esnext.temporal.d.ts, --, --)) ->date : Symbol(date, Decl(temporal.ts, 669, 9)) +>date : Symbol(date, Decl(temporal.ts, 668, 9)) >eraYear : Symbol(Temporal.PlainDate.eraYear, Decl(lib.esnext.temporal.d.ts, --, --)) // => 16 date.year; >date.year : Symbol(Temporal.PlainDate.year, Decl(lib.esnext.temporal.d.ts, --, --)) ->date : Symbol(date, Decl(temporal.ts, 669, 9)) +>date : Symbol(date, Decl(temporal.ts, 668, 9)) >year : Symbol(Temporal.PlainDate.year, Decl(lib.esnext.temporal.d.ts, --, --)) // => -15 @@ -2431,7 +2422,7 @@ { const date = Temporal.PlainDate.from("2006-08-24"); ->date : Symbol(date, Decl(temporal.ts, 679, 9)) +>date : Symbol(date, Decl(temporal.ts, 678, 9)) >Temporal.PlainDate.from : Symbol(Temporal.PlainDateConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.PlainDate : Symbol(Temporal.PlainDate, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -2440,13 +2431,13 @@ ["MON", "TUE", "WED", "THU", "FRI", "SAT", "SUN"][date.dayOfWeek - 1]; // => 'THU' >date.dayOfWeek : Symbol(Temporal.PlainDate.dayOfWeek, Decl(lib.esnext.temporal.d.ts, --, --)) ->date : Symbol(date, Decl(temporal.ts, 679, 9)) +>date : Symbol(date, Decl(temporal.ts, 678, 9)) >dayOfWeek : Symbol(Temporal.PlainDate.dayOfWeek, Decl(lib.esnext.temporal.d.ts, --, --)) } { const date = Temporal.PlainDate.from("2006-08-24"); ->date : Symbol(date, Decl(temporal.ts, 684, 9)) +>date : Symbol(date, Decl(temporal.ts, 683, 9)) >Temporal.PlainDate.from : Symbol(Temporal.PlainDateConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.PlainDate : Symbol(Temporal.PlainDate, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -2459,16 +2450,16 @@ >console : Symbol(console, Decl(lib.dom.d.ts, --, --)) >log : Symbol(Console.log, Decl(lib.dom.d.ts, --, --)) >date.year : Symbol(Temporal.PlainDate.year, Decl(lib.esnext.temporal.d.ts, --, --)) ->date : Symbol(date, Decl(temporal.ts, 684, 9)) +>date : Symbol(date, Decl(temporal.ts, 683, 9)) >year : Symbol(Temporal.PlainDate.year, Decl(lib.esnext.temporal.d.ts, --, --)) >date.dayOfYear : Symbol(Temporal.PlainDate.dayOfYear, Decl(lib.esnext.temporal.d.ts, --, --)) ->date : Symbol(date, Decl(temporal.ts, 684, 9)) +>date : Symbol(date, Decl(temporal.ts, 683, 9)) >dayOfYear : Symbol(Temporal.PlainDate.dayOfYear, Decl(lib.esnext.temporal.d.ts, --, --)) } { const date = Temporal.PlainDate.from("2022-01-01"); ->date : Symbol(date, Decl(temporal.ts, 690, 9)) +>date : Symbol(date, Decl(temporal.ts, 689, 9)) >Temporal.PlainDate.from : Symbol(Temporal.PlainDateConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.PlainDate : Symbol(Temporal.PlainDate, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -2481,19 +2472,19 @@ >console : Symbol(console, Decl(lib.dom.d.ts, --, --)) >log : Symbol(Console.log, Decl(lib.dom.d.ts, --, --)) >date.yearOfWeek : Symbol(Temporal.PlainDate.yearOfWeek, Decl(lib.esnext.temporal.d.ts, --, --)) ->date : Symbol(date, Decl(temporal.ts, 690, 9)) +>date : Symbol(date, Decl(temporal.ts, 689, 9)) >yearOfWeek : Symbol(Temporal.PlainDate.yearOfWeek, Decl(lib.esnext.temporal.d.ts, --, --)) >date.weekOfYear : Symbol(Temporal.PlainDate.weekOfYear, Decl(lib.esnext.temporal.d.ts, --, --)) ->date : Symbol(date, Decl(temporal.ts, 690, 9)) +>date : Symbol(date, Decl(temporal.ts, 689, 9)) >weekOfYear : Symbol(Temporal.PlainDate.weekOfYear, Decl(lib.esnext.temporal.d.ts, --, --)) >date.dayOfWeek : Symbol(Temporal.PlainDate.dayOfWeek, Decl(lib.esnext.temporal.d.ts, --, --)) ->date : Symbol(date, Decl(temporal.ts, 690, 9)) +>date : Symbol(date, Decl(temporal.ts, 689, 9)) >dayOfWeek : Symbol(Temporal.PlainDate.dayOfWeek, Decl(lib.esnext.temporal.d.ts, --, --)) } { const date = Temporal.PlainDate.from("2006-08-24"); ->date : Symbol(date, Decl(temporal.ts, 696, 9)) +>date : Symbol(date, Decl(temporal.ts, 695, 9)) >Temporal.PlainDate.from : Symbol(Temporal.PlainDateConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.PlainDate : Symbol(Temporal.PlainDate, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -2502,25 +2493,25 @@ date.daysInWeek; // => 7 >date.daysInWeek : Symbol(Temporal.PlainDate.daysInWeek, Decl(lib.esnext.temporal.d.ts, --, --)) ->date : Symbol(date, Decl(temporal.ts, 696, 9)) +>date : Symbol(date, Decl(temporal.ts, 695, 9)) >daysInWeek : Symbol(Temporal.PlainDate.daysInWeek, Decl(lib.esnext.temporal.d.ts, --, --)) } { // Attempt to write some mnemonic poetry const monthsByDays: Record = {}; ->monthsByDays : Symbol(monthsByDays, Decl(temporal.ts, 702, 9)) +>monthsByDays : Symbol(monthsByDays, Decl(temporal.ts, 701, 9)) >Record : Symbol(Record, Decl(lib.es5.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) >PlainDate : Symbol(Temporal.PlainDate, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) for (let month = 1; month <= 12; month++) { ->month : Symbol(month, Decl(temporal.ts, 703, 12)) ->month : Symbol(month, Decl(temporal.ts, 703, 12)) ->month : Symbol(month, Decl(temporal.ts, 703, 12)) +>month : Symbol(month, Decl(temporal.ts, 702, 12)) +>month : Symbol(month, Decl(temporal.ts, 702, 12)) +>month : Symbol(month, Decl(temporal.ts, 702, 12)) const date = Temporal.Now.plainDateISO().with({ month }); ->date : Symbol(date, Decl(temporal.ts, 704, 13)) +>date : Symbol(date, Decl(temporal.ts, 703, 13)) >Temporal.Now.plainDateISO().with : Symbol(Temporal.PlainDate.with, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.Now.plainDateISO : Symbol(Temporal.Now.plainDateISO, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.Now : Symbol(Temporal.Now, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -2528,65 +2519,65 @@ >Now : Symbol(Temporal.Now, Decl(lib.esnext.temporal.d.ts, --, --)) >plainDateISO : Symbol(Temporal.Now.plainDateISO, Decl(lib.esnext.temporal.d.ts, --, --)) >with : Symbol(Temporal.PlainDate.with, Decl(lib.esnext.temporal.d.ts, --, --)) ->month : Symbol(month, Decl(temporal.ts, 704, 55)) +>month : Symbol(month, Decl(temporal.ts, 703, 55)) monthsByDays[date.daysInMonth] = (monthsByDays[date.daysInMonth] || []).concat(date); ->monthsByDays : Symbol(monthsByDays, Decl(temporal.ts, 702, 9)) +>monthsByDays : Symbol(monthsByDays, Decl(temporal.ts, 701, 9)) >date.daysInMonth : Symbol(Temporal.PlainDate.daysInMonth, Decl(lib.esnext.temporal.d.ts, --, --)) ->date : Symbol(date, Decl(temporal.ts, 704, 13)) +>date : Symbol(date, Decl(temporal.ts, 703, 13)) >daysInMonth : Symbol(Temporal.PlainDate.daysInMonth, Decl(lib.esnext.temporal.d.ts, --, --)) >(monthsByDays[date.daysInMonth] || []).concat : Symbol(Array.concat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) ->monthsByDays : Symbol(monthsByDays, Decl(temporal.ts, 702, 9)) +>monthsByDays : Symbol(monthsByDays, Decl(temporal.ts, 701, 9)) >date.daysInMonth : Symbol(Temporal.PlainDate.daysInMonth, Decl(lib.esnext.temporal.d.ts, --, --)) ->date : Symbol(date, Decl(temporal.ts, 704, 13)) +>date : Symbol(date, Decl(temporal.ts, 703, 13)) >daysInMonth : Symbol(Temporal.PlainDate.daysInMonth, Decl(lib.esnext.temporal.d.ts, --, --)) >concat : Symbol(Array.concat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) ->date : Symbol(date, Decl(temporal.ts, 704, 13)) +>date : Symbol(date, Decl(temporal.ts, 703, 13)) } const strings = monthsByDays[30].map(date => date.toLocaleString("en", { month: "long" })); ->strings : Symbol(strings, Decl(temporal.ts, 708, 9)) +>strings : Symbol(strings, Decl(temporal.ts, 707, 9)) >monthsByDays[30].map : Symbol(Array.map, Decl(lib.es5.d.ts, --, --)) ->monthsByDays : Symbol(monthsByDays, Decl(temporal.ts, 702, 9)) +>monthsByDays : Symbol(monthsByDays, Decl(temporal.ts, 701, 9)) >map : Symbol(Array.map, Decl(lib.es5.d.ts, --, --)) ->date : Symbol(date, Decl(temporal.ts, 708, 41)) +>date : Symbol(date, Decl(temporal.ts, 707, 41)) >date.toLocaleString : Symbol(Temporal.PlainDate.toLocaleString, Decl(lib.esnext.temporal.d.ts, --, --)) ->date : Symbol(date, Decl(temporal.ts, 708, 41)) +>date : Symbol(date, Decl(temporal.ts, 707, 41)) >toLocaleString : Symbol(Temporal.PlainDate.toLocaleString, Decl(lib.esnext.temporal.d.ts, --, --)) ->month : Symbol(month, Decl(temporal.ts, 708, 76)) +>month : Symbol(month, Decl(temporal.ts, 707, 76)) // Shuffle to improve poem as determined empirically strings.unshift(strings.pop()!); >strings.unshift : Symbol(Array.unshift, Decl(lib.es5.d.ts, --, --)) ->strings : Symbol(strings, Decl(temporal.ts, 708, 9)) +>strings : Symbol(strings, Decl(temporal.ts, 707, 9)) >unshift : Symbol(Array.unshift, Decl(lib.es5.d.ts, --, --)) >strings.pop : Symbol(Array.pop, Decl(lib.es5.d.ts, --, --)) ->strings : Symbol(strings, Decl(temporal.ts, 708, 9)) +>strings : Symbol(strings, Decl(temporal.ts, 707, 9)) >pop : Symbol(Array.pop, Decl(lib.es5.d.ts, --, --)) const format = new Intl.ListFormat("en"); ->format : Symbol(format, Decl(temporal.ts, 711, 9)) +>format : Symbol(format, Decl(temporal.ts, 710, 9)) >Intl.ListFormat : Symbol(Intl.ListFormat, Decl(lib.es2021.intl.d.ts, --, --), Decl(lib.es2021.intl.d.ts, --, --)) >Intl : Symbol(Intl, Decl(lib.es5.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2020.intl.d.ts, --, --), Decl(lib.es2021.intl.d.ts, --, --), Decl(lib.es2025.intl.d.ts, --, --) ... and 1 more) >ListFormat : Symbol(Intl.ListFormat, Decl(lib.es2021.intl.d.ts, --, --), Decl(lib.es2021.intl.d.ts, --, --)) const poem = `Thirty days hath ${format.format(strings)}`; ->poem : Symbol(poem, Decl(temporal.ts, 712, 9)) +>poem : Symbol(poem, Decl(temporal.ts, 711, 9)) >format.format : Symbol(Intl.ListFormat.format, Decl(lib.es2021.intl.d.ts, --, --)) ->format : Symbol(format, Decl(temporal.ts, 711, 9)) +>format : Symbol(format, Decl(temporal.ts, 710, 9)) >format : Symbol(Intl.ListFormat.format, Decl(lib.es2021.intl.d.ts, --, --)) ->strings : Symbol(strings, Decl(temporal.ts, 708, 9)) +>strings : Symbol(strings, Decl(temporal.ts, 707, 9)) console.log(poem); >console.log : Symbol(Console.log, Decl(lib.dom.d.ts, --, --)) >console : Symbol(console, Decl(lib.dom.d.ts, --, --)) >log : Symbol(Console.log, Decl(lib.dom.d.ts, --, --)) ->poem : Symbol(poem, Decl(temporal.ts, 712, 9)) +>poem : Symbol(poem, Decl(temporal.ts, 711, 9)) } { const date = Temporal.Now.plainDateISO(); ->date : Symbol(date, Decl(temporal.ts, 718, 9)) +>date : Symbol(date, Decl(temporal.ts, 717, 9)) >Temporal.Now.plainDateISO : Symbol(Temporal.Now.plainDateISO, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.Now : Symbol(Temporal.Now, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -2594,26 +2585,26 @@ >plainDateISO : Symbol(Temporal.Now.plainDateISO, Decl(lib.esnext.temporal.d.ts, --, --)) const percent = date.dayOfYear / date.daysInYear; ->percent : Symbol(percent, Decl(temporal.ts, 719, 9)) +>percent : Symbol(percent, Decl(temporal.ts, 718, 9)) >date.dayOfYear : Symbol(Temporal.PlainDate.dayOfYear, Decl(lib.esnext.temporal.d.ts, --, --)) ->date : Symbol(date, Decl(temporal.ts, 718, 9)) +>date : Symbol(date, Decl(temporal.ts, 717, 9)) >dayOfYear : Symbol(Temporal.PlainDate.dayOfYear, Decl(lib.esnext.temporal.d.ts, --, --)) >date.daysInYear : Symbol(Temporal.PlainDate.daysInYear, Decl(lib.esnext.temporal.d.ts, --, --)) ->date : Symbol(date, Decl(temporal.ts, 718, 9)) +>date : Symbol(date, Decl(temporal.ts, 717, 9)) >daysInYear : Symbol(Temporal.PlainDate.daysInYear, Decl(lib.esnext.temporal.d.ts, --, --)) `The year is ${percent.toLocaleString("en", { style: "percent" })} over!`; >percent.toLocaleString : Symbol(Number.toLocaleString, Decl(lib.es5.d.ts, --, --)) ->percent : Symbol(percent, Decl(temporal.ts, 719, 9)) +>percent : Symbol(percent, Decl(temporal.ts, 718, 9)) >toLocaleString : Symbol(Number.toLocaleString, Decl(lib.es5.d.ts, --, --)) ->style : Symbol(style, Decl(temporal.ts, 720, 49)) +>style : Symbol(style, Decl(temporal.ts, 719, 49)) // example output: "The year is 10% over!" } { const date = Temporal.PlainDate.from("1900-01-01"); ->date : Symbol(date, Decl(temporal.ts, 725, 9)) +>date : Symbol(date, Decl(temporal.ts, 724, 9)) >Temporal.PlainDate.from : Symbol(Temporal.PlainDateConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.PlainDate : Symbol(Temporal.PlainDate, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -2622,14 +2613,14 @@ date.monthsInYear; // => 12 >date.monthsInYear : Symbol(Temporal.PlainDate.monthsInYear, Decl(lib.esnext.temporal.d.ts, --, --)) ->date : Symbol(date, Decl(temporal.ts, 725, 9)) +>date : Symbol(date, Decl(temporal.ts, 724, 9)) >monthsInYear : Symbol(Temporal.PlainDate.monthsInYear, Decl(lib.esnext.temporal.d.ts, --, --)) } { // Is this year a leap year? const date = Temporal.Now.plainDateISO(); ->date : Symbol(date, Decl(temporal.ts, 731, 9)) +>date : Symbol(date, Decl(temporal.ts, 730, 9)) >Temporal.Now.plainDateISO : Symbol(Temporal.Now.plainDateISO, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.Now : Symbol(Temporal.Now, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -2638,22 +2629,22 @@ date.inLeapYear; // example output: true >date.inLeapYear : Symbol(Temporal.PlainDate.inLeapYear, Decl(lib.esnext.temporal.d.ts, --, --)) ->date : Symbol(date, Decl(temporal.ts, 731, 9)) +>date : Symbol(date, Decl(temporal.ts, 730, 9)) >inLeapYear : Symbol(Temporal.PlainDate.inLeapYear, Decl(lib.esnext.temporal.d.ts, --, --)) // Is 2100 a leap year? (no, because it's divisible by 100 and not 400) date.with({ year: 2100 }).inLeapYear; // => false >date.with({ year: 2100 }).inLeapYear : Symbol(Temporal.PlainDate.inLeapYear, Decl(lib.esnext.temporal.d.ts, --, --)) >date.with : Symbol(Temporal.PlainDate.with, Decl(lib.esnext.temporal.d.ts, --, --)) ->date : Symbol(date, Decl(temporal.ts, 731, 9)) +>date : Symbol(date, Decl(temporal.ts, 730, 9)) >with : Symbol(Temporal.PlainDate.with, Decl(lib.esnext.temporal.d.ts, --, --)) ->year : Symbol(year, Decl(temporal.ts, 734, 15)) +>year : Symbol(year, Decl(temporal.ts, 733, 15)) >inLeapYear : Symbol(Temporal.PlainDate.inLeapYear, Decl(lib.esnext.temporal.d.ts, --, --)) } { const date = Temporal.PlainDate.from("2006-01-24"); ->date : Symbol(date, Decl(temporal.ts, 738, 9)) +>date : Symbol(date, Decl(temporal.ts, 737, 9)) >Temporal.PlainDate.from : Symbol(Temporal.PlainDateConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.PlainDate : Symbol(Temporal.PlainDate, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -2663,31 +2654,31 @@ // What's the first day of this month? date.with({ day: 1 }); // => 2006-01-01 >date.with : Symbol(Temporal.PlainDate.with, Decl(lib.esnext.temporal.d.ts, --, --)) ->date : Symbol(date, Decl(temporal.ts, 738, 9)) +>date : Symbol(date, Decl(temporal.ts, 737, 9)) >with : Symbol(Temporal.PlainDate.with, Decl(lib.esnext.temporal.d.ts, --, --)) ->day : Symbol(day, Decl(temporal.ts, 740, 15)) +>day : Symbol(day, Decl(temporal.ts, 739, 15)) // What's the last day of the next month? const nextMonthDate = date.add({ months: 1 }); ->nextMonthDate : Symbol(nextMonthDate, Decl(temporal.ts, 742, 9)) +>nextMonthDate : Symbol(nextMonthDate, Decl(temporal.ts, 741, 9)) >date.add : Symbol(Temporal.PlainDate.add, Decl(lib.esnext.temporal.d.ts, --, --)) ->date : Symbol(date, Decl(temporal.ts, 738, 9)) +>date : Symbol(date, Decl(temporal.ts, 737, 9)) >add : Symbol(Temporal.PlainDate.add, Decl(lib.esnext.temporal.d.ts, --, --)) ->months : Symbol(months, Decl(temporal.ts, 742, 36)) +>months : Symbol(months, Decl(temporal.ts, 741, 36)) nextMonthDate.with({ day: nextMonthDate.daysInMonth }); // => 2006-02-28 >nextMonthDate.with : Symbol(Temporal.PlainDate.with, Decl(lib.esnext.temporal.d.ts, --, --)) ->nextMonthDate : Symbol(nextMonthDate, Decl(temporal.ts, 742, 9)) +>nextMonthDate : Symbol(nextMonthDate, Decl(temporal.ts, 741, 9)) >with : Symbol(Temporal.PlainDate.with, Decl(lib.esnext.temporal.d.ts, --, --)) ->day : Symbol(day, Decl(temporal.ts, 743, 24)) +>day : Symbol(day, Decl(temporal.ts, 742, 24)) >nextMonthDate.daysInMonth : Symbol(Temporal.PlainDate.daysInMonth, Decl(lib.esnext.temporal.d.ts, --, --)) ->nextMonthDate : Symbol(nextMonthDate, Decl(temporal.ts, 742, 9)) +>nextMonthDate : Symbol(nextMonthDate, Decl(temporal.ts, 741, 9)) >daysInMonth : Symbol(Temporal.PlainDate.daysInMonth, Decl(lib.esnext.temporal.d.ts, --, --)) } { const date = Temporal.PlainDate.from("2006-08-24[u-ca=japanese]"); ->date : Symbol(date, Decl(temporal.ts, 747, 9)) +>date : Symbol(date, Decl(temporal.ts, 746, 9)) >Temporal.PlainDate.from : Symbol(Temporal.PlainDateConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.PlainDate : Symbol(Temporal.PlainDate, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -2696,18 +2687,18 @@ date.withCalendar("iso8601"); // => 2006-08-24 >date.withCalendar : Symbol(Temporal.PlainDate.withCalendar, Decl(lib.esnext.temporal.d.ts, --, --)) ->date : Symbol(date, Decl(temporal.ts, 747, 9)) +>date : Symbol(date, Decl(temporal.ts, 746, 9)) >withCalendar : Symbol(Temporal.PlainDate.withCalendar, Decl(lib.esnext.temporal.d.ts, --, --)) } { let date: Temporal.PlainDate; ->date : Symbol(date, Decl(temporal.ts, 752, 7)) +>date : Symbol(date, Decl(temporal.ts, 751, 7)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) >PlainDate : Symbol(Temporal.PlainDate, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) date = Temporal.PlainDate.from("2006-08-24"); ->date : Symbol(date, Decl(temporal.ts, 752, 7)) +>date : Symbol(date, Decl(temporal.ts, 751, 7)) >Temporal.PlainDate.from : Symbol(Temporal.PlainDateConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.PlainDate : Symbol(Temporal.PlainDate, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -2716,13 +2707,13 @@ date.add({ years: 20, months: 4 }); // => 2026-12-24 >date.add : Symbol(Temporal.PlainDate.add, Decl(lib.esnext.temporal.d.ts, --, --)) ->date : Symbol(date, Decl(temporal.ts, 752, 7)) +>date : Symbol(date, Decl(temporal.ts, 751, 7)) >add : Symbol(Temporal.PlainDate.add, Decl(lib.esnext.temporal.d.ts, --, --)) ->years : Symbol(years, Decl(temporal.ts, 755, 14)) ->months : Symbol(months, Decl(temporal.ts, 755, 25)) +>years : Symbol(years, Decl(temporal.ts, 754, 14)) +>months : Symbol(months, Decl(temporal.ts, 754, 25)) date = Temporal.PlainDate.from("2019-01-31"); ->date : Symbol(date, Decl(temporal.ts, 752, 7)) +>date : Symbol(date, Decl(temporal.ts, 751, 7)) >Temporal.PlainDate.from : Symbol(Temporal.PlainDateConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.PlainDate : Symbol(Temporal.PlainDate, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -2731,26 +2722,26 @@ date.add({ months: 1 }); // => 2019-02-28 >date.add : Symbol(Temporal.PlainDate.add, Decl(lib.esnext.temporal.d.ts, --, --)) ->date : Symbol(date, Decl(temporal.ts, 752, 7)) +>date : Symbol(date, Decl(temporal.ts, 751, 7)) >add : Symbol(Temporal.PlainDate.add, Decl(lib.esnext.temporal.d.ts, --, --)) ->months : Symbol(months, Decl(temporal.ts, 758, 14)) +>months : Symbol(months, Decl(temporal.ts, 757, 14)) date.add({ months: 1 }, { overflow: "reject" }); // => throws >date.add : Symbol(Temporal.PlainDate.add, Decl(lib.esnext.temporal.d.ts, --, --)) ->date : Symbol(date, Decl(temporal.ts, 752, 7)) +>date : Symbol(date, Decl(temporal.ts, 751, 7)) >add : Symbol(Temporal.PlainDate.add, Decl(lib.esnext.temporal.d.ts, --, --)) ->months : Symbol(months, Decl(temporal.ts, 759, 14)) ->overflow : Symbol(overflow, Decl(temporal.ts, 759, 29)) +>months : Symbol(months, Decl(temporal.ts, 758, 14)) +>overflow : Symbol(overflow, Decl(temporal.ts, 758, 29)) } { let date: Temporal.PlainDate; ->date : Symbol(date, Decl(temporal.ts, 763, 7)) +>date : Symbol(date, Decl(temporal.ts, 762, 7)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) >PlainDate : Symbol(Temporal.PlainDate, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) date = Temporal.PlainDate.from("2006-08-24"); ->date : Symbol(date, Decl(temporal.ts, 763, 7)) +>date : Symbol(date, Decl(temporal.ts, 762, 7)) >Temporal.PlainDate.from : Symbol(Temporal.PlainDateConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.PlainDate : Symbol(Temporal.PlainDate, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -2759,13 +2750,13 @@ date.subtract({ years: 20, months: 4 }); // => 1986-04-24 >date.subtract : Symbol(Temporal.PlainDate.subtract, Decl(lib.esnext.temporal.d.ts, --, --)) ->date : Symbol(date, Decl(temporal.ts, 763, 7)) +>date : Symbol(date, Decl(temporal.ts, 762, 7)) >subtract : Symbol(Temporal.PlainDate.subtract, Decl(lib.esnext.temporal.d.ts, --, --)) ->years : Symbol(years, Decl(temporal.ts, 766, 19)) ->months : Symbol(months, Decl(temporal.ts, 766, 30)) +>years : Symbol(years, Decl(temporal.ts, 765, 19)) +>months : Symbol(months, Decl(temporal.ts, 765, 30)) date = Temporal.PlainDate.from("2019-03-31"); ->date : Symbol(date, Decl(temporal.ts, 763, 7)) +>date : Symbol(date, Decl(temporal.ts, 762, 7)) >Temporal.PlainDate.from : Symbol(Temporal.PlainDateConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.PlainDate : Symbol(Temporal.PlainDate, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -2774,21 +2765,21 @@ date.subtract({ months: 1 }); // => 2019-02-28 >date.subtract : Symbol(Temporal.PlainDate.subtract, Decl(lib.esnext.temporal.d.ts, --, --)) ->date : Symbol(date, Decl(temporal.ts, 763, 7)) +>date : Symbol(date, Decl(temporal.ts, 762, 7)) >subtract : Symbol(Temporal.PlainDate.subtract, Decl(lib.esnext.temporal.d.ts, --, --)) ->months : Symbol(months, Decl(temporal.ts, 769, 19)) +>months : Symbol(months, Decl(temporal.ts, 768, 19)) date.subtract({ months: 1 }, { overflow: "reject" }); // => throws >date.subtract : Symbol(Temporal.PlainDate.subtract, Decl(lib.esnext.temporal.d.ts, --, --)) ->date : Symbol(date, Decl(temporal.ts, 763, 7)) +>date : Symbol(date, Decl(temporal.ts, 762, 7)) >subtract : Symbol(Temporal.PlainDate.subtract, Decl(lib.esnext.temporal.d.ts, --, --)) ->months : Symbol(months, Decl(temporal.ts, 770, 19)) ->overflow : Symbol(overflow, Decl(temporal.ts, 770, 34)) +>months : Symbol(months, Decl(temporal.ts, 769, 19)) +>overflow : Symbol(overflow, Decl(temporal.ts, 769, 34)) } { const earlier = Temporal.PlainDate.from("2006-08-24"); ->earlier : Symbol(earlier, Decl(temporal.ts, 774, 9)) +>earlier : Symbol(earlier, Decl(temporal.ts, 773, 9)) >Temporal.PlainDate.from : Symbol(Temporal.PlainDateConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.PlainDate : Symbol(Temporal.PlainDate, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -2796,7 +2787,7 @@ >from : Symbol(Temporal.PlainDateConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) const later = Temporal.PlainDate.from("2019-01-31"); ->later : Symbol(later, Decl(temporal.ts, 775, 9)) +>later : Symbol(later, Decl(temporal.ts, 774, 9)) >Temporal.PlainDate.from : Symbol(Temporal.PlainDateConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.PlainDate : Symbol(Temporal.PlainDate, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -2805,30 +2796,30 @@ earlier.until(later); // => P4543D >earlier.until : Symbol(Temporal.PlainDate.until, Decl(lib.esnext.temporal.d.ts, --, --)) ->earlier : Symbol(earlier, Decl(temporal.ts, 774, 9)) +>earlier : Symbol(earlier, Decl(temporal.ts, 773, 9)) >until : Symbol(Temporal.PlainDate.until, Decl(lib.esnext.temporal.d.ts, --, --)) ->later : Symbol(later, Decl(temporal.ts, 775, 9)) +>later : Symbol(later, Decl(temporal.ts, 774, 9)) earlier.until(later, { largestUnit: "year" }); // => P12Y5M7D >earlier.until : Symbol(Temporal.PlainDate.until, Decl(lib.esnext.temporal.d.ts, --, --)) ->earlier : Symbol(earlier, Decl(temporal.ts, 774, 9)) +>earlier : Symbol(earlier, Decl(temporal.ts, 773, 9)) >until : Symbol(Temporal.PlainDate.until, Decl(lib.esnext.temporal.d.ts, --, --)) ->later : Symbol(later, Decl(temporal.ts, 775, 9)) ->largestUnit : Symbol(largestUnit, Decl(temporal.ts, 777, 26)) +>later : Symbol(later, Decl(temporal.ts, 774, 9)) +>largestUnit : Symbol(largestUnit, Decl(temporal.ts, 776, 26)) later.until(earlier, { largestUnit: "year" }); // => -P12Y5M7D >later.until : Symbol(Temporal.PlainDate.until, Decl(lib.esnext.temporal.d.ts, --, --)) ->later : Symbol(later, Decl(temporal.ts, 775, 9)) +>later : Symbol(later, Decl(temporal.ts, 774, 9)) >until : Symbol(Temporal.PlainDate.until, Decl(lib.esnext.temporal.d.ts, --, --)) ->earlier : Symbol(earlier, Decl(temporal.ts, 774, 9)) ->largestUnit : Symbol(largestUnit, Decl(temporal.ts, 778, 26)) +>earlier : Symbol(earlier, Decl(temporal.ts, 773, 9)) +>largestUnit : Symbol(largestUnit, Decl(temporal.ts, 777, 26)) // If you really need to calculate the difference between two Dates in // hours, you can eliminate the ambiguity by explicitly choosing the // point in time from which you want to reckon the difference. For // example, using noon: const noon = Temporal.PlainTime.from("12:00"); ->noon : Symbol(noon, Decl(temporal.ts, 784, 9)) +>noon : Symbol(noon, Decl(temporal.ts, 783, 9)) >Temporal.PlainTime.from : Symbol(Temporal.PlainTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.PlainTime : Symbol(Temporal.PlainTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -2838,20 +2829,20 @@ earlier.toPlainDateTime(noon).until(later.toPlainDateTime(noon), { largestUnit: "hour" }); >earlier.toPlainDateTime(noon).until : Symbol(Temporal.PlainDateTime.until, Decl(lib.esnext.temporal.d.ts, --, --)) >earlier.toPlainDateTime : Symbol(Temporal.PlainDate.toPlainDateTime, Decl(lib.esnext.temporal.d.ts, --, --)) ->earlier : Symbol(earlier, Decl(temporal.ts, 774, 9)) +>earlier : Symbol(earlier, Decl(temporal.ts, 773, 9)) >toPlainDateTime : Symbol(Temporal.PlainDate.toPlainDateTime, Decl(lib.esnext.temporal.d.ts, --, --)) ->noon : Symbol(noon, Decl(temporal.ts, 784, 9)) +>noon : Symbol(noon, Decl(temporal.ts, 783, 9)) >until : Symbol(Temporal.PlainDateTime.until, Decl(lib.esnext.temporal.d.ts, --, --)) >later.toPlainDateTime : Symbol(Temporal.PlainDate.toPlainDateTime, Decl(lib.esnext.temporal.d.ts, --, --)) ->later : Symbol(later, Decl(temporal.ts, 775, 9)) +>later : Symbol(later, Decl(temporal.ts, 774, 9)) >toPlainDateTime : Symbol(Temporal.PlainDate.toPlainDateTime, Decl(lib.esnext.temporal.d.ts, --, --)) ->noon : Symbol(noon, Decl(temporal.ts, 784, 9)) ->largestUnit : Symbol(largestUnit, Decl(temporal.ts, 785, 70)) +>noon : Symbol(noon, Decl(temporal.ts, 783, 9)) +>largestUnit : Symbol(largestUnit, Decl(temporal.ts, 784, 70)) // => PT109032H const newyear = Temporal.PlainDate.from("2020-01-01"); ->newyear : Symbol(newyear, Decl(temporal.ts, 788, 9)) +>newyear : Symbol(newyear, Decl(temporal.ts, 787, 9)) >Temporal.PlainDate.from : Symbol(Temporal.PlainDateConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.PlainDate : Symbol(Temporal.PlainDate, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -2860,33 +2851,33 @@ newyear.until("2020-01-15", { smallestUnit: "month", roundingMode: "halfExpand" }); >newyear.until : Symbol(Temporal.PlainDate.until, Decl(lib.esnext.temporal.d.ts, --, --)) ->newyear : Symbol(newyear, Decl(temporal.ts, 788, 9)) +>newyear : Symbol(newyear, Decl(temporal.ts, 787, 9)) >until : Symbol(Temporal.PlainDate.until, Decl(lib.esnext.temporal.d.ts, --, --)) ->smallestUnit : Symbol(smallestUnit, Decl(temporal.ts, 789, 33)) ->roundingMode : Symbol(roundingMode, Decl(temporal.ts, 789, 56)) +>smallestUnit : Symbol(smallestUnit, Decl(temporal.ts, 788, 33)) +>roundingMode : Symbol(roundingMode, Decl(temporal.ts, 788, 56)) // => PT0S newyear.until("2020-01-16", { smallestUnit: "month", roundingMode: "halfExpand" }); >newyear.until : Symbol(Temporal.PlainDate.until, Decl(lib.esnext.temporal.d.ts, --, --)) ->newyear : Symbol(newyear, Decl(temporal.ts, 788, 9)) +>newyear : Symbol(newyear, Decl(temporal.ts, 787, 9)) >until : Symbol(Temporal.PlainDate.until, Decl(lib.esnext.temporal.d.ts, --, --)) ->smallestUnit : Symbol(smallestUnit, Decl(temporal.ts, 791, 33)) ->roundingMode : Symbol(roundingMode, Decl(temporal.ts, 791, 56)) +>smallestUnit : Symbol(smallestUnit, Decl(temporal.ts, 790, 33)) +>roundingMode : Symbol(roundingMode, Decl(temporal.ts, 790, 56)) // => PT0S (mid-month dates rounded down to match `Temporal.PlainDateTime` behavior) newyear.until("2020-01-17", { smallestUnit: "month", roundingMode: "halfExpand" }); >newyear.until : Symbol(Temporal.PlainDate.until, Decl(lib.esnext.temporal.d.ts, --, --)) ->newyear : Symbol(newyear, Decl(temporal.ts, 788, 9)) +>newyear : Symbol(newyear, Decl(temporal.ts, 787, 9)) >until : Symbol(Temporal.PlainDate.until, Decl(lib.esnext.temporal.d.ts, --, --)) ->smallestUnit : Symbol(smallestUnit, Decl(temporal.ts, 793, 33)) ->roundingMode : Symbol(roundingMode, Decl(temporal.ts, 793, 56)) +>smallestUnit : Symbol(smallestUnit, Decl(temporal.ts, 792, 33)) +>roundingMode : Symbol(roundingMode, Decl(temporal.ts, 792, 56)) // => PT1M } { const earlier = Temporal.PlainDate.from("2006-08-24"); ->earlier : Symbol(earlier, Decl(temporal.ts, 798, 9)) +>earlier : Symbol(earlier, Decl(temporal.ts, 797, 9)) >Temporal.PlainDate.from : Symbol(Temporal.PlainDateConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.PlainDate : Symbol(Temporal.PlainDate, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -2894,7 +2885,7 @@ >from : Symbol(Temporal.PlainDateConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) const later = Temporal.PlainDate.from("2019-01-31"); ->later : Symbol(later, Decl(temporal.ts, 799, 9)) +>later : Symbol(later, Decl(temporal.ts, 798, 9)) >Temporal.PlainDate.from : Symbol(Temporal.PlainDateConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.PlainDate : Symbol(Temporal.PlainDate, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -2903,14 +2894,14 @@ later.since(earlier); // => P4543D >later.since : Symbol(Temporal.PlainDate.since, Decl(lib.esnext.temporal.d.ts, --, --)) ->later : Symbol(later, Decl(temporal.ts, 799, 9)) +>later : Symbol(later, Decl(temporal.ts, 798, 9)) >since : Symbol(Temporal.PlainDate.since, Decl(lib.esnext.temporal.d.ts, --, --)) ->earlier : Symbol(earlier, Decl(temporal.ts, 798, 9)) +>earlier : Symbol(earlier, Decl(temporal.ts, 797, 9)) } { const date = Temporal.PlainDate.from("2006-08-24"); ->date : Symbol(date, Decl(temporal.ts, 804, 9)) +>date : Symbol(date, Decl(temporal.ts, 803, 9)) >Temporal.PlainDate.from : Symbol(Temporal.PlainDateConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.PlainDate : Symbol(Temporal.PlainDate, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -2918,7 +2909,7 @@ >from : Symbol(Temporal.PlainDateConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) const other = Temporal.PlainDate.from("2019-01-31"); ->other : Symbol(other, Decl(temporal.ts, 805, 9)) +>other : Symbol(other, Decl(temporal.ts, 804, 9)) >Temporal.PlainDate.from : Symbol(Temporal.PlainDateConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.PlainDate : Symbol(Temporal.PlainDate, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -2927,20 +2918,20 @@ date.equals(other); // => false >date.equals : Symbol(Temporal.PlainDate.equals, Decl(lib.esnext.temporal.d.ts, --, --)) ->date : Symbol(date, Decl(temporal.ts, 804, 9)) +>date : Symbol(date, Decl(temporal.ts, 803, 9)) >equals : Symbol(Temporal.PlainDate.equals, Decl(lib.esnext.temporal.d.ts, --, --)) ->other : Symbol(other, Decl(temporal.ts, 805, 9)) +>other : Symbol(other, Decl(temporal.ts, 804, 9)) date.equals(date); // => true >date.equals : Symbol(Temporal.PlainDate.equals, Decl(lib.esnext.temporal.d.ts, --, --)) ->date : Symbol(date, Decl(temporal.ts, 804, 9)) +>date : Symbol(date, Decl(temporal.ts, 803, 9)) >equals : Symbol(Temporal.PlainDate.equals, Decl(lib.esnext.temporal.d.ts, --, --)) ->date : Symbol(date, Decl(temporal.ts, 804, 9)) +>date : Symbol(date, Decl(temporal.ts, 803, 9)) } { const date = Temporal.PlainDate.from("2006-08-24"); ->date : Symbol(date, Decl(temporal.ts, 811, 9)) +>date : Symbol(date, Decl(temporal.ts, 810, 9)) >Temporal.PlainDate.from : Symbol(Temporal.PlainDateConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.PlainDate : Symbol(Temporal.PlainDate, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -2949,13 +2940,13 @@ date.toString(); // => '2006-08-24' >date.toString : Symbol(Temporal.PlainDate.toString, Decl(lib.esnext.temporal.d.ts, --, --)) ->date : Symbol(date, Decl(temporal.ts, 811, 9)) +>date : Symbol(date, Decl(temporal.ts, 810, 9)) >toString : Symbol(Temporal.PlainDate.toString, Decl(lib.esnext.temporal.d.ts, --, --)) } { const date = Temporal.PlainDate.from("2006-08-24"); ->date : Symbol(date, Decl(temporal.ts, 816, 9)) +>date : Symbol(date, Decl(temporal.ts, 815, 9)) >Temporal.PlainDate.from : Symbol(Temporal.PlainDateConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.PlainDate : Symbol(Temporal.PlainDate, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -2964,29 +2955,29 @@ date.toLocaleString(); // example output: 8/24/2006 >date.toLocaleString : Symbol(Temporal.PlainDate.toLocaleString, Decl(lib.esnext.temporal.d.ts, --, --)) ->date : Symbol(date, Decl(temporal.ts, 816, 9)) +>date : Symbol(date, Decl(temporal.ts, 815, 9)) >toLocaleString : Symbol(Temporal.PlainDate.toLocaleString, Decl(lib.esnext.temporal.d.ts, --, --)) date.toLocaleString("de-DE"); // example output: '24.8.2006' >date.toLocaleString : Symbol(Temporal.PlainDate.toLocaleString, Decl(lib.esnext.temporal.d.ts, --, --)) ->date : Symbol(date, Decl(temporal.ts, 816, 9)) +>date : Symbol(date, Decl(temporal.ts, 815, 9)) >toLocaleString : Symbol(Temporal.PlainDate.toLocaleString, Decl(lib.esnext.temporal.d.ts, --, --)) date.toLocaleString("de-DE", { weekday: "long" }); // => 'Donnerstag' >date.toLocaleString : Symbol(Temporal.PlainDate.toLocaleString, Decl(lib.esnext.temporal.d.ts, --, --)) ->date : Symbol(date, Decl(temporal.ts, 816, 9)) +>date : Symbol(date, Decl(temporal.ts, 815, 9)) >toLocaleString : Symbol(Temporal.PlainDate.toLocaleString, Decl(lib.esnext.temporal.d.ts, --, --)) ->weekday : Symbol(weekday, Decl(temporal.ts, 819, 34)) +>weekday : Symbol(weekday, Decl(temporal.ts, 818, 34)) date.toLocaleString("en-US-u-nu-fullwide"); // => '8/24/2006' >date.toLocaleString : Symbol(Temporal.PlainDate.toLocaleString, Decl(lib.esnext.temporal.d.ts, --, --)) ->date : Symbol(date, Decl(temporal.ts, 816, 9)) +>date : Symbol(date, Decl(temporal.ts, 815, 9)) >toLocaleString : Symbol(Temporal.PlainDate.toLocaleString, Decl(lib.esnext.temporal.d.ts, --, --)) } { const plainDate = Temporal.PlainDate.from("2006-08-24"); ->plainDate : Symbol(plainDate, Decl(temporal.ts, 824, 9)) +>plainDate : Symbol(plainDate, Decl(temporal.ts, 823, 9)) >Temporal.PlainDate.from : Symbol(Temporal.PlainDateConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.PlainDate : Symbol(Temporal.PlainDate, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -2994,7 +2985,7 @@ >from : Symbol(Temporal.PlainDateConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) const plainTime = Temporal.PlainTime.from("15:23:30.003"); ->plainTime : Symbol(plainTime, Decl(temporal.ts, 825, 9)) +>plainTime : Symbol(plainTime, Decl(temporal.ts, 824, 9)) >Temporal.PlainTime.from : Symbol(Temporal.PlainTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.PlainTime : Symbol(Temporal.PlainTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -3003,24 +2994,24 @@ plainDate.toZonedDateTime({ timeZone: "America/Los_Angeles", plainTime }); >plainDate.toZonedDateTime : Symbol(Temporal.PlainDate.toZonedDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) ->plainDate : Symbol(plainDate, Decl(temporal.ts, 824, 9)) +>plainDate : Symbol(plainDate, Decl(temporal.ts, 823, 9)) >toZonedDateTime : Symbol(Temporal.PlainDate.toZonedDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) ->timeZone : Symbol(timeZone, Decl(temporal.ts, 826, 31)) ->plainTime : Symbol(plainTime, Decl(temporal.ts, 826, 64)) +>timeZone : Symbol(timeZone, Decl(temporal.ts, 825, 31)) +>plainTime : Symbol(plainTime, Decl(temporal.ts, 825, 64)) // => 2006-08-24T15:23:30.003-07:00[America/Los_Angeles] plainDate.toZonedDateTime({ timeZone: "America/Los_Angeles" }); >plainDate.toZonedDateTime : Symbol(Temporal.PlainDate.toZonedDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) ->plainDate : Symbol(plainDate, Decl(temporal.ts, 824, 9)) +>plainDate : Symbol(plainDate, Decl(temporal.ts, 823, 9)) >toZonedDateTime : Symbol(Temporal.PlainDate.toZonedDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) ->timeZone : Symbol(timeZone, Decl(temporal.ts, 828, 31)) +>timeZone : Symbol(timeZone, Decl(temporal.ts, 827, 31)) // => 2006-08-24T00:00:00-07:00[America/Los_Angeles] } { const date = Temporal.PlainDate.from("2006-08-24"); ->date : Symbol(date, Decl(temporal.ts, 833, 9)) +>date : Symbol(date, Decl(temporal.ts, 832, 9)) >Temporal.PlainDate.from : Symbol(Temporal.PlainDateConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.PlainDate : Symbol(Temporal.PlainDate, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -3028,7 +3019,7 @@ >from : Symbol(Temporal.PlainDateConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) const time = Temporal.PlainTime.from("15:23:30.003"); ->time : Symbol(time, Decl(temporal.ts, 834, 9)) +>time : Symbol(time, Decl(temporal.ts, 833, 9)) >Temporal.PlainTime.from : Symbol(Temporal.PlainTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.PlainTime : Symbol(Temporal.PlainTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -3037,19 +3028,19 @@ date.toPlainDateTime(time); // => 2006-08-24T15:23:30.003 >date.toPlainDateTime : Symbol(Temporal.PlainDate.toPlainDateTime, Decl(lib.esnext.temporal.d.ts, --, --)) ->date : Symbol(date, Decl(temporal.ts, 833, 9)) +>date : Symbol(date, Decl(temporal.ts, 832, 9)) >toPlainDateTime : Symbol(Temporal.PlainDate.toPlainDateTime, Decl(lib.esnext.temporal.d.ts, --, --)) ->time : Symbol(time, Decl(temporal.ts, 834, 9)) +>time : Symbol(time, Decl(temporal.ts, 833, 9)) date.toPlainDateTime(); // => 2006-08-24T00:00:00 >date.toPlainDateTime : Symbol(Temporal.PlainDate.toPlainDateTime, Decl(lib.esnext.temporal.d.ts, --, --)) ->date : Symbol(date, Decl(temporal.ts, 833, 9)) +>date : Symbol(date, Decl(temporal.ts, 832, 9)) >toPlainDateTime : Symbol(Temporal.PlainDate.toPlainDateTime, Decl(lib.esnext.temporal.d.ts, --, --)) } { const date = Temporal.PlainDate.from("2006-08-24"); ->date : Symbol(date, Decl(temporal.ts, 840, 9)) +>date : Symbol(date, Decl(temporal.ts, 839, 9)) >Temporal.PlainDate.from : Symbol(Temporal.PlainDateConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.PlainDate : Symbol(Temporal.PlainDate, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -3058,19 +3049,19 @@ date.toPlainYearMonth(); // => 2006-08 >date.toPlainYearMonth : Symbol(Temporal.PlainDate.toPlainYearMonth, Decl(lib.esnext.temporal.d.ts, --, --)) ->date : Symbol(date, Decl(temporal.ts, 840, 9)) +>date : Symbol(date, Decl(temporal.ts, 839, 9)) >toPlainYearMonth : Symbol(Temporal.PlainDate.toPlainYearMonth, Decl(lib.esnext.temporal.d.ts, --, --)) date.toPlainMonthDay(); // => 08-24 >date.toPlainMonthDay : Symbol(Temporal.PlainDate.toPlainMonthDay, Decl(lib.esnext.temporal.d.ts, --, --)) ->date : Symbol(date, Decl(temporal.ts, 840, 9)) +>date : Symbol(date, Decl(temporal.ts, 839, 9)) >toPlainMonthDay : Symbol(Temporal.PlainDate.toPlainMonthDay, Decl(lib.esnext.temporal.d.ts, --, --)) } { // Leet hour const time = new Temporal.PlainTime(13, 37); // => 13:37:00 ->time : Symbol(time, Decl(temporal.ts, 847, 9)) +>time : Symbol(time, Decl(temporal.ts, 846, 9)) >Temporal.PlainTime : Symbol(Temporal.PlainTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) >PlainTime : Symbol(Temporal.PlainTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) @@ -3078,12 +3069,12 @@ { let time: Temporal.PlainTime; ->time : Symbol(time, Decl(temporal.ts, 851, 7)) +>time : Symbol(time, Decl(temporal.ts, 850, 7)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) >PlainTime : Symbol(Temporal.PlainTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) time = Temporal.PlainTime.from("03:24:30"); // => 03:24:30 ->time : Symbol(time, Decl(temporal.ts, 851, 7)) +>time : Symbol(time, Decl(temporal.ts, 850, 7)) >Temporal.PlainTime.from : Symbol(Temporal.PlainTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.PlainTime : Symbol(Temporal.PlainTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -3091,7 +3082,7 @@ >from : Symbol(Temporal.PlainTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) time = Temporal.PlainTime.from("032430"); // => 03:24:30 ->time : Symbol(time, Decl(temporal.ts, 851, 7)) +>time : Symbol(time, Decl(temporal.ts, 850, 7)) >Temporal.PlainTime.from : Symbol(Temporal.PlainTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.PlainTime : Symbol(Temporal.PlainTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -3099,7 +3090,7 @@ >from : Symbol(Temporal.PlainTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) time = Temporal.PlainTime.from("1995-12-07T03:24:30"); // => 03:24:30 ->time : Symbol(time, Decl(temporal.ts, 851, 7)) +>time : Symbol(time, Decl(temporal.ts, 850, 7)) >Temporal.PlainTime.from : Symbol(Temporal.PlainTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.PlainTime : Symbol(Temporal.PlainTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -3107,7 +3098,7 @@ >from : Symbol(Temporal.PlainTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) time = Temporal.PlainTime.from("1995-12-07T03:24:30+01:00[Europe/Brussels]"); ->time : Symbol(time, Decl(temporal.ts, 851, 7)) +>time : Symbol(time, Decl(temporal.ts, 850, 7)) >Temporal.PlainTime.from : Symbol(Temporal.PlainTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.PlainTime : Symbol(Temporal.PlainTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -3117,16 +3108,16 @@ // => 03:24:30 // (same as above; time zone is ignored) time === Temporal.PlainTime.from(time); // => false ->time : Symbol(time, Decl(temporal.ts, 851, 7)) +>time : Symbol(time, Decl(temporal.ts, 850, 7)) >Temporal.PlainTime.from : Symbol(Temporal.PlainTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.PlainTime : Symbol(Temporal.PlainTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) >PlainTime : Symbol(Temporal.PlainTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >from : Symbol(Temporal.PlainTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) ->time : Symbol(time, Decl(temporal.ts, 851, 7)) +>time : Symbol(time, Decl(temporal.ts, 850, 7)) time = Temporal.PlainTime.from({ ->time : Symbol(time, Decl(temporal.ts, 851, 7)) +>time : Symbol(time, Decl(temporal.ts, 850, 7)) >Temporal.PlainTime.from : Symbol(Temporal.PlainTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.PlainTime : Symbol(Temporal.PlainTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -3134,37 +3125,37 @@ >from : Symbol(Temporal.PlainTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) hour: 19, ->hour : Symbol(hour, Decl(temporal.ts, 861, 36)) +>hour : Symbol(hour, Decl(temporal.ts, 860, 36)) minute: 39, ->minute : Symbol(minute, Decl(temporal.ts, 862, 17)) +>minute : Symbol(minute, Decl(temporal.ts, 861, 17)) second: 9, ->second : Symbol(second, Decl(temporal.ts, 863, 19)) +>second : Symbol(second, Decl(temporal.ts, 862, 19)) millisecond: 68, ->millisecond : Symbol(millisecond, Decl(temporal.ts, 864, 18)) +>millisecond : Symbol(millisecond, Decl(temporal.ts, 863, 18)) microsecond: 346, ->microsecond : Symbol(microsecond, Decl(temporal.ts, 865, 24)) +>microsecond : Symbol(microsecond, Decl(temporal.ts, 864, 24)) nanosecond: 205, ->nanosecond : Symbol(nanosecond, Decl(temporal.ts, 866, 25)) +>nanosecond : Symbol(nanosecond, Decl(temporal.ts, 865, 25)) }); // => 19:39:09.068346205 time = Temporal.PlainTime.from({ hour: 19, minute: 39, second: 9 }); // => 19:39:09 ->time : Symbol(time, Decl(temporal.ts, 851, 7)) +>time : Symbol(time, Decl(temporal.ts, 850, 7)) >Temporal.PlainTime.from : Symbol(Temporal.PlainTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.PlainTime : Symbol(Temporal.PlainTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) >PlainTime : Symbol(Temporal.PlainTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >from : Symbol(Temporal.PlainTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) ->hour : Symbol(hour, Decl(temporal.ts, 869, 36)) ->minute : Symbol(minute, Decl(temporal.ts, 869, 46)) ->second : Symbol(second, Decl(temporal.ts, 869, 58)) +>hour : Symbol(hour, Decl(temporal.ts, 868, 36)) +>minute : Symbol(minute, Decl(temporal.ts, 868, 46)) +>second : Symbol(second, Decl(temporal.ts, 868, 58)) time = Temporal.PlainTime.from(Temporal.PlainDateTime.from("2020-02-15T19:39:09")); ->time : Symbol(time, Decl(temporal.ts, 851, 7)) +>time : Symbol(time, Decl(temporal.ts, 850, 7)) >Temporal.PlainTime.from : Symbol(Temporal.PlainTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.PlainTime : Symbol(Temporal.PlainTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -3181,58 +3172,58 @@ // Different overflow modes time = Temporal.PlainTime.from({ hour: 15, minute: 60 }, { overflow: "constrain" }); ->time : Symbol(time, Decl(temporal.ts, 851, 7)) +>time : Symbol(time, Decl(temporal.ts, 850, 7)) >Temporal.PlainTime.from : Symbol(Temporal.PlainTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.PlainTime : Symbol(Temporal.PlainTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) >PlainTime : Symbol(Temporal.PlainTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >from : Symbol(Temporal.PlainTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) ->hour : Symbol(hour, Decl(temporal.ts, 875, 36)) ->minute : Symbol(minute, Decl(temporal.ts, 875, 46)) ->overflow : Symbol(overflow, Decl(temporal.ts, 875, 62)) +>hour : Symbol(hour, Decl(temporal.ts, 874, 36)) +>minute : Symbol(minute, Decl(temporal.ts, 874, 46)) +>overflow : Symbol(overflow, Decl(temporal.ts, 874, 62)) // => 15:59:00 time = Temporal.PlainTime.from({ hour: 15, minute: -1 }, { overflow: "constrain" }); ->time : Symbol(time, Decl(temporal.ts, 851, 7)) +>time : Symbol(time, Decl(temporal.ts, 850, 7)) >Temporal.PlainTime.from : Symbol(Temporal.PlainTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.PlainTime : Symbol(Temporal.PlainTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) >PlainTime : Symbol(Temporal.PlainTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >from : Symbol(Temporal.PlainTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) ->hour : Symbol(hour, Decl(temporal.ts, 877, 36)) ->minute : Symbol(minute, Decl(temporal.ts, 877, 46)) ->overflow : Symbol(overflow, Decl(temporal.ts, 877, 62)) +>hour : Symbol(hour, Decl(temporal.ts, 876, 36)) +>minute : Symbol(minute, Decl(temporal.ts, 876, 46)) +>overflow : Symbol(overflow, Decl(temporal.ts, 876, 62)) // => 15:00:00 time = Temporal.PlainTime.from({ hour: 15, minute: 60 }, { overflow: "reject" }); ->time : Symbol(time, Decl(temporal.ts, 851, 7)) +>time : Symbol(time, Decl(temporal.ts, 850, 7)) >Temporal.PlainTime.from : Symbol(Temporal.PlainTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.PlainTime : Symbol(Temporal.PlainTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) >PlainTime : Symbol(Temporal.PlainTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >from : Symbol(Temporal.PlainTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) ->hour : Symbol(hour, Decl(temporal.ts, 879, 36)) ->minute : Symbol(minute, Decl(temporal.ts, 879, 46)) ->overflow : Symbol(overflow, Decl(temporal.ts, 879, 62)) +>hour : Symbol(hour, Decl(temporal.ts, 878, 36)) +>minute : Symbol(minute, Decl(temporal.ts, 878, 46)) +>overflow : Symbol(overflow, Decl(temporal.ts, 878, 62)) // => throws time = Temporal.PlainTime.from({ hour: 15, minute: -1 }, { overflow: "reject" }); ->time : Symbol(time, Decl(temporal.ts, 851, 7)) +>time : Symbol(time, Decl(temporal.ts, 850, 7)) >Temporal.PlainTime.from : Symbol(Temporal.PlainTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.PlainTime : Symbol(Temporal.PlainTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) >PlainTime : Symbol(Temporal.PlainTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >from : Symbol(Temporal.PlainTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) ->hour : Symbol(hour, Decl(temporal.ts, 881, 36)) ->minute : Symbol(minute, Decl(temporal.ts, 881, 46)) ->overflow : Symbol(overflow, Decl(temporal.ts, 881, 62)) +>hour : Symbol(hour, Decl(temporal.ts, 880, 36)) +>minute : Symbol(minute, Decl(temporal.ts, 880, 46)) +>overflow : Symbol(overflow, Decl(temporal.ts, 880, 62)) // => throws } { const one = Temporal.PlainTime.from("03:24"); ->one : Symbol(one, Decl(temporal.ts, 886, 9)) +>one : Symbol(one, Decl(temporal.ts, 885, 9)) >Temporal.PlainTime.from : Symbol(Temporal.PlainTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.PlainTime : Symbol(Temporal.PlainTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -3240,7 +3231,7 @@ >from : Symbol(Temporal.PlainTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) const two = Temporal.PlainTime.from("01:24"); ->two : Symbol(two, Decl(temporal.ts, 887, 9)) +>two : Symbol(two, Decl(temporal.ts, 886, 9)) >Temporal.PlainTime.from : Symbol(Temporal.PlainTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.PlainTime : Symbol(Temporal.PlainTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -3248,7 +3239,7 @@ >from : Symbol(Temporal.PlainTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) const three = Temporal.PlainTime.from("01:24:05"); ->three : Symbol(three, Decl(temporal.ts, 888, 9)) +>three : Symbol(three, Decl(temporal.ts, 887, 9)) >Temporal.PlainTime.from : Symbol(Temporal.PlainTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.PlainTime : Symbol(Temporal.PlainTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -3256,11 +3247,11 @@ >from : Symbol(Temporal.PlainTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) const sorted = [one, two, three].sort(Temporal.PlainTime.compare); ->sorted : Symbol(sorted, Decl(temporal.ts, 889, 9)) +>sorted : Symbol(sorted, Decl(temporal.ts, 888, 9)) >[one, two, three].sort : Symbol(Array.sort, Decl(lib.es5.d.ts, --, --)) ->one : Symbol(one, Decl(temporal.ts, 886, 9)) ->two : Symbol(two, Decl(temporal.ts, 887, 9)) ->three : Symbol(three, Decl(temporal.ts, 888, 9)) +>one : Symbol(one, Decl(temporal.ts, 885, 9)) +>two : Symbol(two, Decl(temporal.ts, 886, 9)) +>three : Symbol(three, Decl(temporal.ts, 887, 9)) >sort : Symbol(Array.sort, Decl(lib.es5.d.ts, --, --)) >Temporal.PlainTime.compare : Symbol(Temporal.PlainTimeConstructor.compare, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.PlainTime : Symbol(Temporal.PlainTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) @@ -3270,14 +3261,14 @@ sorted.join(" "); // => '01:24:00 01:24:05 03:24:00' >sorted.join : Symbol(Array.join, Decl(lib.es5.d.ts, --, --)) ->sorted : Symbol(sorted, Decl(temporal.ts, 889, 9)) +>sorted : Symbol(sorted, Decl(temporal.ts, 888, 9)) >join : Symbol(Array.join, Decl(lib.es5.d.ts, --, --)) } { // Backward transitions will repeat clock times const zdtDst = Temporal.ZonedDateTime.from("2020-11-01T01:45-07:00[America/Los_Angeles]"); ->zdtDst : Symbol(zdtDst, Decl(temporal.ts, 895, 9)) +>zdtDst : Symbol(zdtDst, Decl(temporal.ts, 894, 9)) >Temporal.ZonedDateTime.from : Symbol(Temporal.ZonedDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.ZonedDateTime : Symbol(Temporal.ZonedDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -3285,7 +3276,7 @@ >from : Symbol(Temporal.ZonedDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) const zdtStandard = Temporal.ZonedDateTime.from("2020-11-01T01:30-08:00[America/Los_Angeles]"); ->zdtStandard : Symbol(zdtStandard, Decl(temporal.ts, 896, 9)) +>zdtStandard : Symbol(zdtStandard, Decl(temporal.ts, 895, 9)) >Temporal.ZonedDateTime.from : Symbol(Temporal.ZonedDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.ZonedDateTime : Symbol(Temporal.ZonedDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -3299,8 +3290,8 @@ >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) >ZonedDateTime : Symbol(Temporal.ZonedDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >compare : Symbol(Temporal.ZonedDateTimeConstructor.compare, Decl(lib.esnext.temporal.d.ts, --, --)) ->zdtDst : Symbol(zdtDst, Decl(temporal.ts, 895, 9)) ->zdtStandard : Symbol(zdtStandard, Decl(temporal.ts, 896, 9)) +>zdtDst : Symbol(zdtDst, Decl(temporal.ts, 894, 9)) +>zdtStandard : Symbol(zdtStandard, Decl(temporal.ts, 895, 9)) // 1:45 is later than 1:30 when looking at a wall clock Temporal.PlainTime.compare(zdtDst, zdtStandard); // => 1 @@ -3309,12 +3300,12 @@ >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) >PlainTime : Symbol(Temporal.PlainTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >compare : Symbol(Temporal.PlainTimeConstructor.compare, Decl(lib.esnext.temporal.d.ts, --, --)) ->zdtDst : Symbol(zdtDst, Decl(temporal.ts, 895, 9)) ->zdtStandard : Symbol(zdtStandard, Decl(temporal.ts, 896, 9)) +>zdtDst : Symbol(zdtDst, Decl(temporal.ts, 894, 9)) +>zdtStandard : Symbol(zdtStandard, Decl(temporal.ts, 895, 9)) // Forward transitions will skip clock times. Skipped times will be disambiguated. const zdtBase = Temporal.ZonedDateTime.from("2020-03-08[America/Los_Angeles]"); ->zdtBase : Symbol(zdtBase, Decl(temporal.ts, 903, 9)) +>zdtBase : Symbol(zdtBase, Decl(temporal.ts, 902, 9)) >Temporal.ZonedDateTime.from : Symbol(Temporal.ZonedDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.ZonedDateTime : Symbol(Temporal.ZonedDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -3322,7 +3313,7 @@ >from : Symbol(Temporal.ZonedDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) const timeSkipped = Temporal.PlainTime.from("02:30"); ->timeSkipped : Symbol(timeSkipped, Decl(temporal.ts, 904, 9)) +>timeSkipped : Symbol(timeSkipped, Decl(temporal.ts, 903, 9)) >Temporal.PlainTime.from : Symbol(Temporal.PlainTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.PlainTime : Symbol(Temporal.PlainTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -3330,7 +3321,7 @@ >from : Symbol(Temporal.PlainTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) const timeValid = Temporal.PlainTime.from("03:30"); ->timeValid : Symbol(timeValid, Decl(temporal.ts, 905, 9)) +>timeValid : Symbol(timeValid, Decl(temporal.ts, 904, 9)) >Temporal.PlainTime.from : Symbol(Temporal.PlainTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.PlainTime : Symbol(Temporal.PlainTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -3338,18 +3329,18 @@ >from : Symbol(Temporal.PlainTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) const zdtSkipped = zdtBase.withPlainTime(timeSkipped); ->zdtSkipped : Symbol(zdtSkipped, Decl(temporal.ts, 906, 9)) +>zdtSkipped : Symbol(zdtSkipped, Decl(temporal.ts, 905, 9)) >zdtBase.withPlainTime : Symbol(Temporal.ZonedDateTime.withPlainTime, Decl(lib.esnext.temporal.d.ts, --, --)) ->zdtBase : Symbol(zdtBase, Decl(temporal.ts, 903, 9)) +>zdtBase : Symbol(zdtBase, Decl(temporal.ts, 902, 9)) >withPlainTime : Symbol(Temporal.ZonedDateTime.withPlainTime, Decl(lib.esnext.temporal.d.ts, --, --)) ->timeSkipped : Symbol(timeSkipped, Decl(temporal.ts, 904, 9)) +>timeSkipped : Symbol(timeSkipped, Decl(temporal.ts, 903, 9)) const zdtValid = zdtBase.withPlainTime(timeValid); ->zdtValid : Symbol(zdtValid, Decl(temporal.ts, 907, 9)) +>zdtValid : Symbol(zdtValid, Decl(temporal.ts, 906, 9)) >zdtBase.withPlainTime : Symbol(Temporal.ZonedDateTime.withPlainTime, Decl(lib.esnext.temporal.d.ts, --, --)) ->zdtBase : Symbol(zdtBase, Decl(temporal.ts, 903, 9)) +>zdtBase : Symbol(zdtBase, Decl(temporal.ts, 902, 9)) >withPlainTime : Symbol(Temporal.ZonedDateTime.withPlainTime, Decl(lib.esnext.temporal.d.ts, --, --)) ->timeValid : Symbol(timeValid, Decl(temporal.ts, 905, 9)) +>timeValid : Symbol(timeValid, Decl(temporal.ts, 904, 9)) // The skipped time 2:30AM is disambiguated to 3:30AM, so the instants are equal Temporal.ZonedDateTime.compare(zdtSkipped, zdtValid); // => 0 @@ -3358,8 +3349,8 @@ >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) >ZonedDateTime : Symbol(Temporal.ZonedDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >compare : Symbol(Temporal.ZonedDateTimeConstructor.compare, Decl(lib.esnext.temporal.d.ts, --, --)) ->zdtSkipped : Symbol(zdtSkipped, Decl(temporal.ts, 906, 9)) ->zdtValid : Symbol(zdtValid, Decl(temporal.ts, 907, 9)) +>zdtSkipped : Symbol(zdtSkipped, Decl(temporal.ts, 905, 9)) +>zdtValid : Symbol(zdtValid, Decl(temporal.ts, 906, 9)) // 2:30 is earlier than 3:30 on a wall clock Temporal.PlainTime.compare(timeSkipped, timeValid); // => -1 @@ -3368,13 +3359,13 @@ >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) >PlainTime : Symbol(Temporal.PlainTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >compare : Symbol(Temporal.PlainTimeConstructor.compare, Decl(lib.esnext.temporal.d.ts, --, --)) ->timeSkipped : Symbol(timeSkipped, Decl(temporal.ts, 904, 9)) ->timeValid : Symbol(timeValid, Decl(temporal.ts, 905, 9)) +>timeSkipped : Symbol(timeSkipped, Decl(temporal.ts, 903, 9)) +>timeValid : Symbol(timeValid, Decl(temporal.ts, 904, 9)) } { const time = Temporal.PlainTime.from("19:39:09.068346205"); ->time : Symbol(time, Decl(temporal.ts, 915, 9)) +>time : Symbol(time, Decl(temporal.ts, 914, 9)) >Temporal.PlainTime.from : Symbol(Temporal.PlainTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.PlainTime : Symbol(Temporal.PlainTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -3383,38 +3374,38 @@ time.hour; // => 19 >time.hour : Symbol(Temporal.PlainTime.hour, Decl(lib.esnext.temporal.d.ts, --, --)) ->time : Symbol(time, Decl(temporal.ts, 915, 9)) +>time : Symbol(time, Decl(temporal.ts, 914, 9)) >hour : Symbol(Temporal.PlainTime.hour, Decl(lib.esnext.temporal.d.ts, --, --)) time.minute; // => 39 >time.minute : Symbol(Temporal.PlainTime.minute, Decl(lib.esnext.temporal.d.ts, --, --)) ->time : Symbol(time, Decl(temporal.ts, 915, 9)) +>time : Symbol(time, Decl(temporal.ts, 914, 9)) >minute : Symbol(Temporal.PlainTime.minute, Decl(lib.esnext.temporal.d.ts, --, --)) time.second; // => 9 >time.second : Symbol(Temporal.PlainTime.second, Decl(lib.esnext.temporal.d.ts, --, --)) ->time : Symbol(time, Decl(temporal.ts, 915, 9)) +>time : Symbol(time, Decl(temporal.ts, 914, 9)) >second : Symbol(Temporal.PlainTime.second, Decl(lib.esnext.temporal.d.ts, --, --)) time.millisecond; // => 68 >time.millisecond : Symbol(Temporal.PlainTime.millisecond, Decl(lib.esnext.temporal.d.ts, --, --)) ->time : Symbol(time, Decl(temporal.ts, 915, 9)) +>time : Symbol(time, Decl(temporal.ts, 914, 9)) >millisecond : Symbol(Temporal.PlainTime.millisecond, Decl(lib.esnext.temporal.d.ts, --, --)) time.microsecond; // => 346 >time.microsecond : Symbol(Temporal.PlainTime.microsecond, Decl(lib.esnext.temporal.d.ts, --, --)) ->time : Symbol(time, Decl(temporal.ts, 915, 9)) +>time : Symbol(time, Decl(temporal.ts, 914, 9)) >microsecond : Symbol(Temporal.PlainTime.microsecond, Decl(lib.esnext.temporal.d.ts, --, --)) time.nanosecond; // => 205 >time.nanosecond : Symbol(Temporal.PlainTime.nanosecond, Decl(lib.esnext.temporal.d.ts, --, --)) ->time : Symbol(time, Decl(temporal.ts, 915, 9)) +>time : Symbol(time, Decl(temporal.ts, 914, 9)) >nanosecond : Symbol(Temporal.PlainTime.nanosecond, Decl(lib.esnext.temporal.d.ts, --, --)) } { const time = Temporal.PlainTime.from("19:39:09.068346205"); ->time : Symbol(time, Decl(temporal.ts, 925, 9)) +>time : Symbol(time, Decl(temporal.ts, 924, 9)) >Temporal.PlainTime.from : Symbol(Temporal.PlainTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.PlainTime : Symbol(Temporal.PlainTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -3425,32 +3416,32 @@ time.add({ hours: 1 }).with({ >time.add({ hours: 1 }).with : Symbol(Temporal.PlainTime.with, Decl(lib.esnext.temporal.d.ts, --, --)) >time.add : Symbol(Temporal.PlainTime.add, Decl(lib.esnext.temporal.d.ts, --, --)) ->time : Symbol(time, Decl(temporal.ts, 925, 9)) +>time : Symbol(time, Decl(temporal.ts, 924, 9)) >add : Symbol(Temporal.PlainTime.add, Decl(lib.esnext.temporal.d.ts, --, --)) ->hours : Symbol(hours, Decl(temporal.ts, 927, 14)) +>hours : Symbol(hours, Decl(temporal.ts, 926, 14)) >with : Symbol(Temporal.PlainTime.with, Decl(lib.esnext.temporal.d.ts, --, --)) minute: 0, ->minute : Symbol(minute, Decl(temporal.ts, 927, 33)) +>minute : Symbol(minute, Decl(temporal.ts, 926, 33)) second: 0, ->second : Symbol(second, Decl(temporal.ts, 928, 18)) +>second : Symbol(second, Decl(temporal.ts, 927, 18)) millisecond: 0, ->millisecond : Symbol(millisecond, Decl(temporal.ts, 929, 18)) +>millisecond : Symbol(millisecond, Decl(temporal.ts, 928, 18)) microsecond: 0, ->microsecond : Symbol(microsecond, Decl(temporal.ts, 930, 23)) +>microsecond : Symbol(microsecond, Decl(temporal.ts, 929, 23)) nanosecond: 0, ->nanosecond : Symbol(nanosecond, Decl(temporal.ts, 931, 23)) +>nanosecond : Symbol(nanosecond, Decl(temporal.ts, 930, 23)) }); // => 20:00:00 } { const time = Temporal.PlainTime.from("19:39:09.068346205"); ->time : Symbol(time, Decl(temporal.ts, 937, 9)) +>time : Symbol(time, Decl(temporal.ts, 936, 9)) >Temporal.PlainTime.from : Symbol(Temporal.PlainTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.PlainTime : Symbol(Temporal.PlainTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -3459,15 +3450,15 @@ time.add({ minutes: 5, nanoseconds: 800 }); // => 19:44:09.068347005 >time.add : Symbol(Temporal.PlainTime.add, Decl(lib.esnext.temporal.d.ts, --, --)) ->time : Symbol(time, Decl(temporal.ts, 937, 9)) +>time : Symbol(time, Decl(temporal.ts, 936, 9)) >add : Symbol(Temporal.PlainTime.add, Decl(lib.esnext.temporal.d.ts, --, --)) ->minutes : Symbol(minutes, Decl(temporal.ts, 938, 14)) ->nanoseconds : Symbol(nanoseconds, Decl(temporal.ts, 938, 26)) +>minutes : Symbol(minutes, Decl(temporal.ts, 937, 14)) +>nanoseconds : Symbol(nanoseconds, Decl(temporal.ts, 937, 26)) } { const time = Temporal.PlainTime.from("19:39:09.068346205"); ->time : Symbol(time, Decl(temporal.ts, 942, 9)) +>time : Symbol(time, Decl(temporal.ts, 941, 9)) >Temporal.PlainTime.from : Symbol(Temporal.PlainTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.PlainTime : Symbol(Temporal.PlainTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -3476,15 +3467,15 @@ time.subtract({ minutes: 5, nanoseconds: 800 }); // => 19:34:09.068345405 >time.subtract : Symbol(Temporal.PlainTime.subtract, Decl(lib.esnext.temporal.d.ts, --, --)) ->time : Symbol(time, Decl(temporal.ts, 942, 9)) +>time : Symbol(time, Decl(temporal.ts, 941, 9)) >subtract : Symbol(Temporal.PlainTime.subtract, Decl(lib.esnext.temporal.d.ts, --, --)) ->minutes : Symbol(minutes, Decl(temporal.ts, 943, 19)) ->nanoseconds : Symbol(nanoseconds, Decl(temporal.ts, 943, 31)) +>minutes : Symbol(minutes, Decl(temporal.ts, 942, 19)) +>nanoseconds : Symbol(nanoseconds, Decl(temporal.ts, 942, 31)) } { const time = Temporal.PlainTime.from("20:13:20.971398099"); ->time : Symbol(time, Decl(temporal.ts, 947, 9)) +>time : Symbol(time, Decl(temporal.ts, 946, 9)) >Temporal.PlainTime.from : Symbol(Temporal.PlainTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.PlainTime : Symbol(Temporal.PlainTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -3493,7 +3484,7 @@ time.until(Temporal.PlainTime.from("22:39:09.068346205")); // => PT2H25M48.096948106S >time.until : Symbol(Temporal.PlainTime.until, Decl(lib.esnext.temporal.d.ts, --, --)) ->time : Symbol(time, Decl(temporal.ts, 947, 9)) +>time : Symbol(time, Decl(temporal.ts, 946, 9)) >until : Symbol(Temporal.PlainTime.until, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.PlainTime.from : Symbol(Temporal.PlainTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.PlainTime : Symbol(Temporal.PlainTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) @@ -3503,7 +3494,7 @@ time.until(Temporal.PlainTime.from("19:39:09.068346205")); // => -PT34M11.903051894S >time.until : Symbol(Temporal.PlainTime.until, Decl(lib.esnext.temporal.d.ts, --, --)) ->time : Symbol(time, Decl(temporal.ts, 947, 9)) +>time : Symbol(time, Decl(temporal.ts, 946, 9)) >until : Symbol(Temporal.PlainTime.until, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.PlainTime.from : Symbol(Temporal.PlainTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.PlainTime : Symbol(Temporal.PlainTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) @@ -3514,21 +3505,21 @@ // Rounding, for example if you don't care about sub-seconds time.until(Temporal.PlainTime.from("22:39:09.068346205"), { smallestUnit: "second" }); >time.until : Symbol(Temporal.PlainTime.until, Decl(lib.esnext.temporal.d.ts, --, --)) ->time : Symbol(time, Decl(temporal.ts, 947, 9)) +>time : Symbol(time, Decl(temporal.ts, 946, 9)) >until : Symbol(Temporal.PlainTime.until, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.PlainTime.from : Symbol(Temporal.PlainTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.PlainTime : Symbol(Temporal.PlainTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) >PlainTime : Symbol(Temporal.PlainTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >from : Symbol(Temporal.PlainTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) ->smallestUnit : Symbol(smallestUnit, Decl(temporal.ts, 952, 63)) +>smallestUnit : Symbol(smallestUnit, Decl(temporal.ts, 951, 63)) // => PT2H25M48S } { const time = Temporal.PlainTime.from("20:13:20.971398099"); ->time : Symbol(time, Decl(temporal.ts, 957, 9)) +>time : Symbol(time, Decl(temporal.ts, 956, 9)) >Temporal.PlainTime.from : Symbol(Temporal.PlainTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.PlainTime : Symbol(Temporal.PlainTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -3537,7 +3528,7 @@ time.since(Temporal.PlainTime.from("19:39:09.068346205")); // => PT34M11.903051894S >time.since : Symbol(Temporal.PlainTime.since, Decl(lib.esnext.temporal.d.ts, --, --)) ->time : Symbol(time, Decl(temporal.ts, 957, 9)) +>time : Symbol(time, Decl(temporal.ts, 956, 9)) >since : Symbol(Temporal.PlainTime.since, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.PlainTime.from : Symbol(Temporal.PlainTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.PlainTime : Symbol(Temporal.PlainTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) @@ -3547,7 +3538,7 @@ time.since(Temporal.PlainTime.from("22:39:09.068346205")); // => -PT2H25M48.096948106S >time.since : Symbol(Temporal.PlainTime.since, Decl(lib.esnext.temporal.d.ts, --, --)) ->time : Symbol(time, Decl(temporal.ts, 957, 9)) +>time : Symbol(time, Decl(temporal.ts, 956, 9)) >since : Symbol(Temporal.PlainTime.since, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.PlainTime.from : Symbol(Temporal.PlainTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.PlainTime : Symbol(Temporal.PlainTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) @@ -3558,7 +3549,7 @@ { const time = Temporal.PlainTime.from("19:39:09.068346205"); ->time : Symbol(time, Decl(temporal.ts, 963, 9)) +>time : Symbol(time, Decl(temporal.ts, 962, 9)) >Temporal.PlainTime.from : Symbol(Temporal.PlainTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.PlainTime : Symbol(Temporal.PlainTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -3568,34 +3559,34 @@ // Round to a particular unit time.round({ smallestUnit: "hour" }); // => 20:00:00 >time.round : Symbol(Temporal.PlainTime.round, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) ->time : Symbol(time, Decl(temporal.ts, 963, 9)) +>time : Symbol(time, Decl(temporal.ts, 962, 9)) >round : Symbol(Temporal.PlainTime.round, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) ->smallestUnit : Symbol(smallestUnit, Decl(temporal.ts, 966, 16)) +>smallestUnit : Symbol(smallestUnit, Decl(temporal.ts, 965, 16)) // Round to an increment of a unit, e.g. half an hour: time.round({ roundingIncrement: 30, smallestUnit: "minute" }); >time.round : Symbol(Temporal.PlainTime.round, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) ->time : Symbol(time, Decl(temporal.ts, 963, 9)) +>time : Symbol(time, Decl(temporal.ts, 962, 9)) >round : Symbol(Temporal.PlainTime.round, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) ->roundingIncrement : Symbol(roundingIncrement, Decl(temporal.ts, 968, 16)) ->smallestUnit : Symbol(smallestUnit, Decl(temporal.ts, 968, 39)) +>roundingIncrement : Symbol(roundingIncrement, Decl(temporal.ts, 967, 16)) +>smallestUnit : Symbol(smallestUnit, Decl(temporal.ts, 967, 39)) // => 19:30:00 // Round to the same increment but round up instead: time.round({ roundingIncrement: 30, smallestUnit: "minute", roundingMode: "ceil" }); >time.round : Symbol(Temporal.PlainTime.round, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) ->time : Symbol(time, Decl(temporal.ts, 963, 9)) +>time : Symbol(time, Decl(temporal.ts, 962, 9)) >round : Symbol(Temporal.PlainTime.round, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) ->roundingIncrement : Symbol(roundingIncrement, Decl(temporal.ts, 971, 16)) ->smallestUnit : Symbol(smallestUnit, Decl(temporal.ts, 971, 39)) ->roundingMode : Symbol(roundingMode, Decl(temporal.ts, 971, 63)) +>roundingIncrement : Symbol(roundingIncrement, Decl(temporal.ts, 970, 16)) +>smallestUnit : Symbol(smallestUnit, Decl(temporal.ts, 970, 39)) +>roundingMode : Symbol(roundingMode, Decl(temporal.ts, 970, 63)) // => 20:00:00 } { const time = Temporal.PlainTime.from("19:39:09.068346205"); ->time : Symbol(time, Decl(temporal.ts, 976, 9)) +>time : Symbol(time, Decl(temporal.ts, 975, 9)) >Temporal.PlainTime.from : Symbol(Temporal.PlainTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.PlainTime : Symbol(Temporal.PlainTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -3603,7 +3594,7 @@ >from : Symbol(Temporal.PlainTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) const other = Temporal.PlainTime.from("20:13:20.971398099"); ->other : Symbol(other, Decl(temporal.ts, 977, 9)) +>other : Symbol(other, Decl(temporal.ts, 976, 9)) >Temporal.PlainTime.from : Symbol(Temporal.PlainTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.PlainTime : Symbol(Temporal.PlainTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -3612,20 +3603,20 @@ time.equals(other); // => false >time.equals : Symbol(Temporal.PlainTime.equals, Decl(lib.esnext.temporal.d.ts, --, --)) ->time : Symbol(time, Decl(temporal.ts, 976, 9)) +>time : Symbol(time, Decl(temporal.ts, 975, 9)) >equals : Symbol(Temporal.PlainTime.equals, Decl(lib.esnext.temporal.d.ts, --, --)) ->other : Symbol(other, Decl(temporal.ts, 977, 9)) +>other : Symbol(other, Decl(temporal.ts, 976, 9)) time.equals(time); // => true >time.equals : Symbol(Temporal.PlainTime.equals, Decl(lib.esnext.temporal.d.ts, --, --)) ->time : Symbol(time, Decl(temporal.ts, 976, 9)) +>time : Symbol(time, Decl(temporal.ts, 975, 9)) >equals : Symbol(Temporal.PlainTime.equals, Decl(lib.esnext.temporal.d.ts, --, --)) ->time : Symbol(time, Decl(temporal.ts, 976, 9)) +>time : Symbol(time, Decl(temporal.ts, 975, 9)) } { const time = Temporal.PlainTime.from("19:39:09.068346205"); ->time : Symbol(time, Decl(temporal.ts, 983, 9)) +>time : Symbol(time, Decl(temporal.ts, 982, 9)) >Temporal.PlainTime.from : Symbol(Temporal.PlainTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.PlainTime : Symbol(Temporal.PlainTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -3634,40 +3625,40 @@ time.toString(); // => '19:39:09.068346205' >time.toString : Symbol(Temporal.PlainTime.toString, Decl(lib.esnext.temporal.d.ts, --, --)) ->time : Symbol(time, Decl(temporal.ts, 983, 9)) +>time : Symbol(time, Decl(temporal.ts, 982, 9)) >toString : Symbol(Temporal.PlainTime.toString, Decl(lib.esnext.temporal.d.ts, --, --)) time.toString({ smallestUnit: "minute" }); // => '19:39' >time.toString : Symbol(Temporal.PlainTime.toString, Decl(lib.esnext.temporal.d.ts, --, --)) ->time : Symbol(time, Decl(temporal.ts, 983, 9)) +>time : Symbol(time, Decl(temporal.ts, 982, 9)) >toString : Symbol(Temporal.PlainTime.toString, Decl(lib.esnext.temporal.d.ts, --, --)) ->smallestUnit : Symbol(smallestUnit, Decl(temporal.ts, 986, 19)) +>smallestUnit : Symbol(smallestUnit, Decl(temporal.ts, 985, 19)) time.toString({ fractionalSecondDigits: 0 }); // => '19:39:09' >time.toString : Symbol(Temporal.PlainTime.toString, Decl(lib.esnext.temporal.d.ts, --, --)) ->time : Symbol(time, Decl(temporal.ts, 983, 9)) +>time : Symbol(time, Decl(temporal.ts, 982, 9)) >toString : Symbol(Temporal.PlainTime.toString, Decl(lib.esnext.temporal.d.ts, --, --)) ->fractionalSecondDigits : Symbol(fractionalSecondDigits, Decl(temporal.ts, 987, 19)) +>fractionalSecondDigits : Symbol(fractionalSecondDigits, Decl(temporal.ts, 986, 19)) time.toString({ fractionalSecondDigits: 4 }); // => '19:39:09.0683' >time.toString : Symbol(Temporal.PlainTime.toString, Decl(lib.esnext.temporal.d.ts, --, --)) ->time : Symbol(time, Decl(temporal.ts, 983, 9)) +>time : Symbol(time, Decl(temporal.ts, 982, 9)) >toString : Symbol(Temporal.PlainTime.toString, Decl(lib.esnext.temporal.d.ts, --, --)) ->fractionalSecondDigits : Symbol(fractionalSecondDigits, Decl(temporal.ts, 988, 19)) +>fractionalSecondDigits : Symbol(fractionalSecondDigits, Decl(temporal.ts, 987, 19)) time.toString({ fractionalSecondDigits: 5, roundingMode: "halfExpand" }); >time.toString : Symbol(Temporal.PlainTime.toString, Decl(lib.esnext.temporal.d.ts, --, --)) ->time : Symbol(time, Decl(temporal.ts, 983, 9)) +>time : Symbol(time, Decl(temporal.ts, 982, 9)) >toString : Symbol(Temporal.PlainTime.toString, Decl(lib.esnext.temporal.d.ts, --, --)) ->fractionalSecondDigits : Symbol(fractionalSecondDigits, Decl(temporal.ts, 989, 19)) ->roundingMode : Symbol(roundingMode, Decl(temporal.ts, 989, 46)) +>fractionalSecondDigits : Symbol(fractionalSecondDigits, Decl(temporal.ts, 988, 19)) +>roundingMode : Symbol(roundingMode, Decl(temporal.ts, 988, 46)) // => '19:39:09.06835' } { const time = Temporal.PlainTime.from("19:39:09.068346205"); ->time : Symbol(time, Decl(temporal.ts, 994, 9)) +>time : Symbol(time, Decl(temporal.ts, 993, 9)) >Temporal.PlainTime.from : Symbol(Temporal.PlainTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.PlainTime : Symbol(Temporal.PlainTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -3676,30 +3667,30 @@ time.toLocaleString(); // example output: '7:39:09 PM' >time.toLocaleString : Symbol(Temporal.PlainTime.toLocaleString, Decl(lib.esnext.temporal.d.ts, --, --)) ->time : Symbol(time, Decl(temporal.ts, 994, 9)) +>time : Symbol(time, Decl(temporal.ts, 993, 9)) >toLocaleString : Symbol(Temporal.PlainTime.toLocaleString, Decl(lib.esnext.temporal.d.ts, --, --)) time.toLocaleString("de-DE"); // example output: '19:39:09' >time.toLocaleString : Symbol(Temporal.PlainTime.toLocaleString, Decl(lib.esnext.temporal.d.ts, --, --)) ->time : Symbol(time, Decl(temporal.ts, 994, 9)) +>time : Symbol(time, Decl(temporal.ts, 993, 9)) >toLocaleString : Symbol(Temporal.PlainTime.toLocaleString, Decl(lib.esnext.temporal.d.ts, --, --)) time.toLocaleString("de-DE", { timeZone: "Europe/Berlin" }); // => '19:39:09' >time.toLocaleString : Symbol(Temporal.PlainTime.toLocaleString, Decl(lib.esnext.temporal.d.ts, --, --)) ->time : Symbol(time, Decl(temporal.ts, 994, 9)) +>time : Symbol(time, Decl(temporal.ts, 993, 9)) >toLocaleString : Symbol(Temporal.PlainTime.toLocaleString, Decl(lib.esnext.temporal.d.ts, --, --)) ->timeZone : Symbol(timeZone, Decl(temporal.ts, 997, 34)) +>timeZone : Symbol(timeZone, Decl(temporal.ts, 996, 34)) time.toLocaleString("en-US-u-nu-fullwide-hc-h24"); // => '19:39:09' >time.toLocaleString : Symbol(Temporal.PlainTime.toLocaleString, Decl(lib.esnext.temporal.d.ts, --, --)) ->time : Symbol(time, Decl(temporal.ts, 994, 9)) +>time : Symbol(time, Decl(temporal.ts, 993, 9)) >toLocaleString : Symbol(Temporal.PlainTime.toLocaleString, Decl(lib.esnext.temporal.d.ts, --, --)) } { // Leet hour on pi day in 2020 const datetime = new Temporal.PlainDateTime(2020, 3, 14, 13, 37); // => 2020-03-14T13:37:00 ->datetime : Symbol(datetime, Decl(temporal.ts, 1003, 9)) +>datetime : Symbol(datetime, Decl(temporal.ts, 1002, 9)) >Temporal.PlainDateTime : Symbol(Temporal.PlainDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) >PlainDateTime : Symbol(Temporal.PlainDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) @@ -3707,12 +3698,12 @@ { let dt: Temporal.PlainDateTime; ->dt : Symbol(dt, Decl(temporal.ts, 1007, 7)) +>dt : Symbol(dt, Decl(temporal.ts, 1006, 7)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) >PlainDateTime : Symbol(Temporal.PlainDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) dt = Temporal.PlainDateTime.from("1995-12-07T03:24:30"); ->dt : Symbol(dt, Decl(temporal.ts, 1007, 7)) +>dt : Symbol(dt, Decl(temporal.ts, 1006, 7)) >Temporal.PlainDateTime.from : Symbol(Temporal.PlainDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.PlainDateTime : Symbol(Temporal.PlainDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -3720,7 +3711,7 @@ >from : Symbol(Temporal.PlainDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) dt = Temporal.PlainDateTime.from("19951207T032430"); ->dt : Symbol(dt, Decl(temporal.ts, 1007, 7)) +>dt : Symbol(dt, Decl(temporal.ts, 1006, 7)) >Temporal.PlainDateTime.from : Symbol(Temporal.PlainDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.PlainDateTime : Symbol(Temporal.PlainDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -3728,7 +3719,7 @@ >from : Symbol(Temporal.PlainDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) dt = Temporal.PlainDateTime.from("1995-12-07T03:24:30+01:00[Europe/Brussels]"); ->dt : Symbol(dt, Decl(temporal.ts, 1007, 7)) +>dt : Symbol(dt, Decl(temporal.ts, 1006, 7)) >Temporal.PlainDateTime.from : Symbol(Temporal.PlainDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.PlainDateTime : Symbol(Temporal.PlainDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -3738,16 +3729,16 @@ // => 1995-12-07T03:24:30 // same as above; time zone is ignored dt === Temporal.PlainDateTime.from(dt); // => false ->dt : Symbol(dt, Decl(temporal.ts, 1007, 7)) +>dt : Symbol(dt, Decl(temporal.ts, 1006, 7)) >Temporal.PlainDateTime.from : Symbol(Temporal.PlainDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.PlainDateTime : Symbol(Temporal.PlainDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) >PlainDateTime : Symbol(Temporal.PlainDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >from : Symbol(Temporal.PlainDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) ->dt : Symbol(dt, Decl(temporal.ts, 1007, 7)) +>dt : Symbol(dt, Decl(temporal.ts, 1006, 7)) dt = Temporal.PlainDateTime.from({ ->dt : Symbol(dt, Decl(temporal.ts, 1007, 7)) +>dt : Symbol(dt, Decl(temporal.ts, 1006, 7)) >Temporal.PlainDateTime.from : Symbol(Temporal.PlainDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.PlainDateTime : Symbol(Temporal.PlainDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -3755,46 +3746,46 @@ >from : Symbol(Temporal.PlainDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) year: 1995, ->year : Symbol(year, Decl(temporal.ts, 1016, 38)) +>year : Symbol(year, Decl(temporal.ts, 1015, 38)) month: 12, ->month : Symbol(month, Decl(temporal.ts, 1017, 19)) +>month : Symbol(month, Decl(temporal.ts, 1016, 19)) day: 7, ->day : Symbol(day, Decl(temporal.ts, 1018, 18)) +>day : Symbol(day, Decl(temporal.ts, 1017, 18)) hour: 3, ->hour : Symbol(hour, Decl(temporal.ts, 1019, 15)) +>hour : Symbol(hour, Decl(temporal.ts, 1018, 15)) minute: 24, ->minute : Symbol(minute, Decl(temporal.ts, 1020, 16)) +>minute : Symbol(minute, Decl(temporal.ts, 1019, 16)) second: 30, ->second : Symbol(second, Decl(temporal.ts, 1021, 19)) +>second : Symbol(second, Decl(temporal.ts, 1020, 19)) millisecond: 0, ->millisecond : Symbol(millisecond, Decl(temporal.ts, 1022, 19)) +>millisecond : Symbol(millisecond, Decl(temporal.ts, 1021, 19)) microsecond: 3, ->microsecond : Symbol(microsecond, Decl(temporal.ts, 1023, 23)) +>microsecond : Symbol(microsecond, Decl(temporal.ts, 1022, 23)) nanosecond: 500, ->nanosecond : Symbol(nanosecond, Decl(temporal.ts, 1024, 23)) +>nanosecond : Symbol(nanosecond, Decl(temporal.ts, 1023, 23)) }); // => 1995-12-07T03:24:30.0000035 dt = Temporal.PlainDateTime.from({ year: 1995, month: 12, day: 7 }); // => 1995-12-07T00:00:00 ->dt : Symbol(dt, Decl(temporal.ts, 1007, 7)) +>dt : Symbol(dt, Decl(temporal.ts, 1006, 7)) >Temporal.PlainDateTime.from : Symbol(Temporal.PlainDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.PlainDateTime : Symbol(Temporal.PlainDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) >PlainDateTime : Symbol(Temporal.PlainDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >from : Symbol(Temporal.PlainDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) ->year : Symbol(year, Decl(temporal.ts, 1027, 38)) ->month : Symbol(month, Decl(temporal.ts, 1027, 50)) ->day : Symbol(day, Decl(temporal.ts, 1027, 61)) +>year : Symbol(year, Decl(temporal.ts, 1026, 38)) +>month : Symbol(month, Decl(temporal.ts, 1026, 50)) +>day : Symbol(day, Decl(temporal.ts, 1026, 61)) dt = Temporal.PlainDateTime.from(Temporal.PlainDate.from("1995-12-07T03:24:30")); ->dt : Symbol(dt, Decl(temporal.ts, 1007, 7)) +>dt : Symbol(dt, Decl(temporal.ts, 1006, 7)) >Temporal.PlainDateTime.from : Symbol(Temporal.PlainDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.PlainDateTime : Symbol(Temporal.PlainDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -3810,136 +3801,136 @@ // same as above; Temporal.PlainDate has year, month, and day properties dt = Temporal.PlainDateTime.from({ year: 5756, month: 3, day: 14, hour: 3, minute: 24, second: 30, calendar: "hebrew" }); ->dt : Symbol(dt, Decl(temporal.ts, 1007, 7)) +>dt : Symbol(dt, Decl(temporal.ts, 1006, 7)) >Temporal.PlainDateTime.from : Symbol(Temporal.PlainDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.PlainDateTime : Symbol(Temporal.PlainDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) >PlainDateTime : Symbol(Temporal.PlainDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >from : Symbol(Temporal.PlainDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) ->year : Symbol(year, Decl(temporal.ts, 1032, 38)) ->month : Symbol(month, Decl(temporal.ts, 1032, 50)) ->day : Symbol(day, Decl(temporal.ts, 1032, 60)) ->hour : Symbol(hour, Decl(temporal.ts, 1032, 69)) ->minute : Symbol(minute, Decl(temporal.ts, 1032, 78)) ->second : Symbol(second, Decl(temporal.ts, 1032, 90)) ->calendar : Symbol(calendar, Decl(temporal.ts, 1032, 102)) +>year : Symbol(year, Decl(temporal.ts, 1031, 38)) +>month : Symbol(month, Decl(temporal.ts, 1031, 50)) +>day : Symbol(day, Decl(temporal.ts, 1031, 60)) +>hour : Symbol(hour, Decl(temporal.ts, 1031, 69)) +>minute : Symbol(minute, Decl(temporal.ts, 1031, 78)) +>second : Symbol(second, Decl(temporal.ts, 1031, 90)) +>calendar : Symbol(calendar, Decl(temporal.ts, 1031, 102)) // => 1995-12-07T03:24:30[u-ca=hebrew] // Different overflow modes dt = Temporal.PlainDateTime.from({ year: 2001, month: 13, day: 1 }, { overflow: "constrain" }); ->dt : Symbol(dt, Decl(temporal.ts, 1007, 7)) +>dt : Symbol(dt, Decl(temporal.ts, 1006, 7)) >Temporal.PlainDateTime.from : Symbol(Temporal.PlainDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.PlainDateTime : Symbol(Temporal.PlainDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) >PlainDateTime : Symbol(Temporal.PlainDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >from : Symbol(Temporal.PlainDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) ->year : Symbol(year, Decl(temporal.ts, 1036, 38)) ->month : Symbol(month, Decl(temporal.ts, 1036, 50)) ->day : Symbol(day, Decl(temporal.ts, 1036, 61)) ->overflow : Symbol(overflow, Decl(temporal.ts, 1036, 73)) +>year : Symbol(year, Decl(temporal.ts, 1035, 38)) +>month : Symbol(month, Decl(temporal.ts, 1035, 50)) +>day : Symbol(day, Decl(temporal.ts, 1035, 61)) +>overflow : Symbol(overflow, Decl(temporal.ts, 1035, 73)) // => 2001-12-01T00:00:00 dt = Temporal.PlainDateTime.from({ year: 2001, month: 1, day: 32 }, { overflow: "constrain" }); ->dt : Symbol(dt, Decl(temporal.ts, 1007, 7)) +>dt : Symbol(dt, Decl(temporal.ts, 1006, 7)) >Temporal.PlainDateTime.from : Symbol(Temporal.PlainDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.PlainDateTime : Symbol(Temporal.PlainDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) >PlainDateTime : Symbol(Temporal.PlainDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >from : Symbol(Temporal.PlainDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) ->year : Symbol(year, Decl(temporal.ts, 1038, 38)) ->month : Symbol(month, Decl(temporal.ts, 1038, 50)) ->day : Symbol(day, Decl(temporal.ts, 1038, 60)) ->overflow : Symbol(overflow, Decl(temporal.ts, 1038, 73)) +>year : Symbol(year, Decl(temporal.ts, 1037, 38)) +>month : Symbol(month, Decl(temporal.ts, 1037, 50)) +>day : Symbol(day, Decl(temporal.ts, 1037, 60)) +>overflow : Symbol(overflow, Decl(temporal.ts, 1037, 73)) // => 2001-01-31T00:00:00 dt = Temporal.PlainDateTime.from({ year: 2001, month: 1, day: 1, hour: 25 }, { overflow: "constrain" }); ->dt : Symbol(dt, Decl(temporal.ts, 1007, 7)) +>dt : Symbol(dt, Decl(temporal.ts, 1006, 7)) >Temporal.PlainDateTime.from : Symbol(Temporal.PlainDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.PlainDateTime : Symbol(Temporal.PlainDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) >PlainDateTime : Symbol(Temporal.PlainDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >from : Symbol(Temporal.PlainDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) ->year : Symbol(year, Decl(temporal.ts, 1040, 38)) ->month : Symbol(month, Decl(temporal.ts, 1040, 50)) ->day : Symbol(day, Decl(temporal.ts, 1040, 60)) ->hour : Symbol(hour, Decl(temporal.ts, 1040, 68)) ->overflow : Symbol(overflow, Decl(temporal.ts, 1040, 82)) +>year : Symbol(year, Decl(temporal.ts, 1039, 38)) +>month : Symbol(month, Decl(temporal.ts, 1039, 50)) +>day : Symbol(day, Decl(temporal.ts, 1039, 60)) +>hour : Symbol(hour, Decl(temporal.ts, 1039, 68)) +>overflow : Symbol(overflow, Decl(temporal.ts, 1039, 82)) // => 2001-01-01T23:00:00 dt = Temporal.PlainDateTime.from({ year: 2001, month: 1, day: 1, minute: 60 }, { overflow: "constrain" }); ->dt : Symbol(dt, Decl(temporal.ts, 1007, 7)) +>dt : Symbol(dt, Decl(temporal.ts, 1006, 7)) >Temporal.PlainDateTime.from : Symbol(Temporal.PlainDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.PlainDateTime : Symbol(Temporal.PlainDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) >PlainDateTime : Symbol(Temporal.PlainDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >from : Symbol(Temporal.PlainDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) ->year : Symbol(year, Decl(temporal.ts, 1042, 38)) ->month : Symbol(month, Decl(temporal.ts, 1042, 50)) ->day : Symbol(day, Decl(temporal.ts, 1042, 60)) ->minute : Symbol(minute, Decl(temporal.ts, 1042, 68)) ->overflow : Symbol(overflow, Decl(temporal.ts, 1042, 84)) +>year : Symbol(year, Decl(temporal.ts, 1041, 38)) +>month : Symbol(month, Decl(temporal.ts, 1041, 50)) +>day : Symbol(day, Decl(temporal.ts, 1041, 60)) +>minute : Symbol(minute, Decl(temporal.ts, 1041, 68)) +>overflow : Symbol(overflow, Decl(temporal.ts, 1041, 84)) // => 2001-01-01T00:59:00 dt = Temporal.PlainDateTime.from({ year: 2001, month: 13, day: 1 }, { overflow: "reject" }); ->dt : Symbol(dt, Decl(temporal.ts, 1007, 7)) +>dt : Symbol(dt, Decl(temporal.ts, 1006, 7)) >Temporal.PlainDateTime.from : Symbol(Temporal.PlainDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.PlainDateTime : Symbol(Temporal.PlainDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) >PlainDateTime : Symbol(Temporal.PlainDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >from : Symbol(Temporal.PlainDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) ->year : Symbol(year, Decl(temporal.ts, 1044, 38)) ->month : Symbol(month, Decl(temporal.ts, 1044, 50)) ->day : Symbol(day, Decl(temporal.ts, 1044, 61)) ->overflow : Symbol(overflow, Decl(temporal.ts, 1044, 73)) +>year : Symbol(year, Decl(temporal.ts, 1043, 38)) +>month : Symbol(month, Decl(temporal.ts, 1043, 50)) +>day : Symbol(day, Decl(temporal.ts, 1043, 61)) +>overflow : Symbol(overflow, Decl(temporal.ts, 1043, 73)) // => throws dt = Temporal.PlainDateTime.from({ year: 2001, month: 1, day: 32 }, { overflow: "reject" }); ->dt : Symbol(dt, Decl(temporal.ts, 1007, 7)) +>dt : Symbol(dt, Decl(temporal.ts, 1006, 7)) >Temporal.PlainDateTime.from : Symbol(Temporal.PlainDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.PlainDateTime : Symbol(Temporal.PlainDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) >PlainDateTime : Symbol(Temporal.PlainDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >from : Symbol(Temporal.PlainDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) ->year : Symbol(year, Decl(temporal.ts, 1046, 38)) ->month : Symbol(month, Decl(temporal.ts, 1046, 50)) ->day : Symbol(day, Decl(temporal.ts, 1046, 60)) ->overflow : Symbol(overflow, Decl(temporal.ts, 1046, 73)) +>year : Symbol(year, Decl(temporal.ts, 1045, 38)) +>month : Symbol(month, Decl(temporal.ts, 1045, 50)) +>day : Symbol(day, Decl(temporal.ts, 1045, 60)) +>overflow : Symbol(overflow, Decl(temporal.ts, 1045, 73)) // => throws dt = Temporal.PlainDateTime.from({ year: 2001, month: 1, day: 1, hour: 25 }, { overflow: "reject" }); ->dt : Symbol(dt, Decl(temporal.ts, 1007, 7)) +>dt : Symbol(dt, Decl(temporal.ts, 1006, 7)) >Temporal.PlainDateTime.from : Symbol(Temporal.PlainDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.PlainDateTime : Symbol(Temporal.PlainDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) >PlainDateTime : Symbol(Temporal.PlainDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >from : Symbol(Temporal.PlainDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) ->year : Symbol(year, Decl(temporal.ts, 1048, 38)) ->month : Symbol(month, Decl(temporal.ts, 1048, 50)) ->day : Symbol(day, Decl(temporal.ts, 1048, 60)) ->hour : Symbol(hour, Decl(temporal.ts, 1048, 68)) ->overflow : Symbol(overflow, Decl(temporal.ts, 1048, 82)) +>year : Symbol(year, Decl(temporal.ts, 1047, 38)) +>month : Symbol(month, Decl(temporal.ts, 1047, 50)) +>day : Symbol(day, Decl(temporal.ts, 1047, 60)) +>hour : Symbol(hour, Decl(temporal.ts, 1047, 68)) +>overflow : Symbol(overflow, Decl(temporal.ts, 1047, 82)) // => throws dt = Temporal.PlainDateTime.from({ year: 2001, month: 1, day: 1, minute: 60 }, { overflow: "reject" }); ->dt : Symbol(dt, Decl(temporal.ts, 1007, 7)) +>dt : Symbol(dt, Decl(temporal.ts, 1006, 7)) >Temporal.PlainDateTime.from : Symbol(Temporal.PlainDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.PlainDateTime : Symbol(Temporal.PlainDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) >PlainDateTime : Symbol(Temporal.PlainDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >from : Symbol(Temporal.PlainDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) ->year : Symbol(year, Decl(temporal.ts, 1050, 38)) ->month : Symbol(month, Decl(temporal.ts, 1050, 50)) ->day : Symbol(day, Decl(temporal.ts, 1050, 60)) ->minute : Symbol(minute, Decl(temporal.ts, 1050, 68)) ->overflow : Symbol(overflow, Decl(temporal.ts, 1050, 84)) +>year : Symbol(year, Decl(temporal.ts, 1049, 38)) +>month : Symbol(month, Decl(temporal.ts, 1049, 50)) +>day : Symbol(day, Decl(temporal.ts, 1049, 60)) +>minute : Symbol(minute, Decl(temporal.ts, 1049, 68)) +>overflow : Symbol(overflow, Decl(temporal.ts, 1049, 84)) // => throws } { const one = Temporal.PlainDateTime.from("1995-12-07T03:24"); ->one : Symbol(one, Decl(temporal.ts, 1055, 9)) +>one : Symbol(one, Decl(temporal.ts, 1054, 9)) >Temporal.PlainDateTime.from : Symbol(Temporal.PlainDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.PlainDateTime : Symbol(Temporal.PlainDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -3947,7 +3938,7 @@ >from : Symbol(Temporal.PlainDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) const two = Temporal.PlainDateTime.from("1995-12-07T01:24"); ->two : Symbol(two, Decl(temporal.ts, 1056, 9)) +>two : Symbol(two, Decl(temporal.ts, 1055, 9)) >Temporal.PlainDateTime.from : Symbol(Temporal.PlainDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.PlainDateTime : Symbol(Temporal.PlainDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -3955,7 +3946,7 @@ >from : Symbol(Temporal.PlainDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) const three = Temporal.PlainDateTime.from("2015-12-07T01:24"); ->three : Symbol(three, Decl(temporal.ts, 1057, 9)) +>three : Symbol(three, Decl(temporal.ts, 1056, 9)) >Temporal.PlainDateTime.from : Symbol(Temporal.PlainDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.PlainDateTime : Symbol(Temporal.PlainDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -3963,11 +3954,11 @@ >from : Symbol(Temporal.PlainDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) const sorted = [one, two, three].sort(Temporal.PlainDateTime.compare); ->sorted : Symbol(sorted, Decl(temporal.ts, 1058, 9)) +>sorted : Symbol(sorted, Decl(temporal.ts, 1057, 9)) >[one, two, three].sort : Symbol(Array.sort, Decl(lib.es5.d.ts, --, --)) ->one : Symbol(one, Decl(temporal.ts, 1055, 9)) ->two : Symbol(two, Decl(temporal.ts, 1056, 9)) ->three : Symbol(three, Decl(temporal.ts, 1057, 9)) +>one : Symbol(one, Decl(temporal.ts, 1054, 9)) +>two : Symbol(two, Decl(temporal.ts, 1055, 9)) +>three : Symbol(three, Decl(temporal.ts, 1056, 9)) >sort : Symbol(Array.sort, Decl(lib.es5.d.ts, --, --)) >Temporal.PlainDateTime.compare : Symbol(Temporal.PlainDateTimeConstructor.compare, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.PlainDateTime : Symbol(Temporal.PlainDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) @@ -3977,7 +3968,7 @@ sorted.join(" "); >sorted.join : Symbol(Array.join, Decl(lib.es5.d.ts, --, --)) ->sorted : Symbol(sorted, Decl(temporal.ts, 1058, 9)) +>sorted : Symbol(sorted, Decl(temporal.ts, 1057, 9)) >join : Symbol(Array.join, Decl(lib.es5.d.ts, --, --)) // => '1995-12-07T01:24:00 1995-12-07T03:24:00 2015-12-07T01:24:00' @@ -3985,12 +3976,12 @@ { let dt: Temporal.PlainDateTime; ->dt : Symbol(dt, Decl(temporal.ts, 1064, 7)) +>dt : Symbol(dt, Decl(temporal.ts, 1063, 7)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) >PlainDateTime : Symbol(Temporal.PlainDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) dt = Temporal.PlainDateTime.from("1995-12-07T03:24:30.000003500"); ->dt : Symbol(dt, Decl(temporal.ts, 1064, 7)) +>dt : Symbol(dt, Decl(temporal.ts, 1063, 7)) >Temporal.PlainDateTime.from : Symbol(Temporal.PlainDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.PlainDateTime : Symbol(Temporal.PlainDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -3999,56 +3990,56 @@ dt.year; // => 1995 >dt.year : Symbol(Temporal.PlainDateTime.year, Decl(lib.esnext.temporal.d.ts, --, --)) ->dt : Symbol(dt, Decl(temporal.ts, 1064, 7)) +>dt : Symbol(dt, Decl(temporal.ts, 1063, 7)) >year : Symbol(Temporal.PlainDateTime.year, Decl(lib.esnext.temporal.d.ts, --, --)) dt.month; // => 12 >dt.month : Symbol(Temporal.PlainDateTime.month, Decl(lib.esnext.temporal.d.ts, --, --)) ->dt : Symbol(dt, Decl(temporal.ts, 1064, 7)) +>dt : Symbol(dt, Decl(temporal.ts, 1063, 7)) >month : Symbol(Temporal.PlainDateTime.month, Decl(lib.esnext.temporal.d.ts, --, --)) dt.monthCode; // => 'M12' >dt.monthCode : Symbol(Temporal.PlainDateTime.monthCode, Decl(lib.esnext.temporal.d.ts, --, --)) ->dt : Symbol(dt, Decl(temporal.ts, 1064, 7)) +>dt : Symbol(dt, Decl(temporal.ts, 1063, 7)) >monthCode : Symbol(Temporal.PlainDateTime.monthCode, Decl(lib.esnext.temporal.d.ts, --, --)) dt.day; // => 7 >dt.day : Symbol(Temporal.PlainDateTime.day, Decl(lib.esnext.temporal.d.ts, --, --)) ->dt : Symbol(dt, Decl(temporal.ts, 1064, 7)) +>dt : Symbol(dt, Decl(temporal.ts, 1063, 7)) >day : Symbol(Temporal.PlainDateTime.day, Decl(lib.esnext.temporal.d.ts, --, --)) dt.hour; // => 3 >dt.hour : Symbol(Temporal.PlainDateTime.hour, Decl(lib.esnext.temporal.d.ts, --, --)) ->dt : Symbol(dt, Decl(temporal.ts, 1064, 7)) +>dt : Symbol(dt, Decl(temporal.ts, 1063, 7)) >hour : Symbol(Temporal.PlainDateTime.hour, Decl(lib.esnext.temporal.d.ts, --, --)) dt.minute; // => 24 >dt.minute : Symbol(Temporal.PlainDateTime.minute, Decl(lib.esnext.temporal.d.ts, --, --)) ->dt : Symbol(dt, Decl(temporal.ts, 1064, 7)) +>dt : Symbol(dt, Decl(temporal.ts, 1063, 7)) >minute : Symbol(Temporal.PlainDateTime.minute, Decl(lib.esnext.temporal.d.ts, --, --)) dt.second; // => 30 >dt.second : Symbol(Temporal.PlainDateTime.second, Decl(lib.esnext.temporal.d.ts, --, --)) ->dt : Symbol(dt, Decl(temporal.ts, 1064, 7)) +>dt : Symbol(dt, Decl(temporal.ts, 1063, 7)) >second : Symbol(Temporal.PlainDateTime.second, Decl(lib.esnext.temporal.d.ts, --, --)) dt.millisecond; // => 0 >dt.millisecond : Symbol(Temporal.PlainDateTime.millisecond, Decl(lib.esnext.temporal.d.ts, --, --)) ->dt : Symbol(dt, Decl(temporal.ts, 1064, 7)) +>dt : Symbol(dt, Decl(temporal.ts, 1063, 7)) >millisecond : Symbol(Temporal.PlainDateTime.millisecond, Decl(lib.esnext.temporal.d.ts, --, --)) dt.microsecond; // => 3 >dt.microsecond : Symbol(Temporal.PlainDateTime.microsecond, Decl(lib.esnext.temporal.d.ts, --, --)) ->dt : Symbol(dt, Decl(temporal.ts, 1064, 7)) +>dt : Symbol(dt, Decl(temporal.ts, 1063, 7)) >microsecond : Symbol(Temporal.PlainDateTime.microsecond, Decl(lib.esnext.temporal.d.ts, --, --)) dt.nanosecond; // => 500 >dt.nanosecond : Symbol(Temporal.PlainDateTime.nanosecond, Decl(lib.esnext.temporal.d.ts, --, --)) ->dt : Symbol(dt, Decl(temporal.ts, 1064, 7)) +>dt : Symbol(dt, Decl(temporal.ts, 1063, 7)) >nanosecond : Symbol(Temporal.PlainDateTime.nanosecond, Decl(lib.esnext.temporal.d.ts, --, --)) dt = Temporal.PlainDateTime.from("2019-02-23T03:24:30.000003500[u-ca=hebrew]"); ->dt : Symbol(dt, Decl(temporal.ts, 1064, 7)) +>dt : Symbol(dt, Decl(temporal.ts, 1063, 7)) >Temporal.PlainDateTime.from : Symbol(Temporal.PlainDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.PlainDateTime : Symbol(Temporal.PlainDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -4057,58 +4048,58 @@ dt.year; // => 5779 >dt.year : Symbol(Temporal.PlainDateTime.year, Decl(lib.esnext.temporal.d.ts, --, --)) ->dt : Symbol(dt, Decl(temporal.ts, 1064, 7)) +>dt : Symbol(dt, Decl(temporal.ts, 1063, 7)) >year : Symbol(Temporal.PlainDateTime.year, Decl(lib.esnext.temporal.d.ts, --, --)) dt.month; // => 6 >dt.month : Symbol(Temporal.PlainDateTime.month, Decl(lib.esnext.temporal.d.ts, --, --)) ->dt : Symbol(dt, Decl(temporal.ts, 1064, 7)) +>dt : Symbol(dt, Decl(temporal.ts, 1063, 7)) >month : Symbol(Temporal.PlainDateTime.month, Decl(lib.esnext.temporal.d.ts, --, --)) dt.monthCode; // => 'M05L' >dt.monthCode : Symbol(Temporal.PlainDateTime.monthCode, Decl(lib.esnext.temporal.d.ts, --, --)) ->dt : Symbol(dt, Decl(temporal.ts, 1064, 7)) +>dt : Symbol(dt, Decl(temporal.ts, 1063, 7)) >monthCode : Symbol(Temporal.PlainDateTime.monthCode, Decl(lib.esnext.temporal.d.ts, --, --)) dt.day; // => 18 >dt.day : Symbol(Temporal.PlainDateTime.day, Decl(lib.esnext.temporal.d.ts, --, --)) ->dt : Symbol(dt, Decl(temporal.ts, 1064, 7)) +>dt : Symbol(dt, Decl(temporal.ts, 1063, 7)) >day : Symbol(Temporal.PlainDateTime.day, Decl(lib.esnext.temporal.d.ts, --, --)) dt.hour; // => 3 >dt.hour : Symbol(Temporal.PlainDateTime.hour, Decl(lib.esnext.temporal.d.ts, --, --)) ->dt : Symbol(dt, Decl(temporal.ts, 1064, 7)) +>dt : Symbol(dt, Decl(temporal.ts, 1063, 7)) >hour : Symbol(Temporal.PlainDateTime.hour, Decl(lib.esnext.temporal.d.ts, --, --)) dt.minute; // => 24 >dt.minute : Symbol(Temporal.PlainDateTime.minute, Decl(lib.esnext.temporal.d.ts, --, --)) ->dt : Symbol(dt, Decl(temporal.ts, 1064, 7)) +>dt : Symbol(dt, Decl(temporal.ts, 1063, 7)) >minute : Symbol(Temporal.PlainDateTime.minute, Decl(lib.esnext.temporal.d.ts, --, --)) dt.second; // => 30 >dt.second : Symbol(Temporal.PlainDateTime.second, Decl(lib.esnext.temporal.d.ts, --, --)) ->dt : Symbol(dt, Decl(temporal.ts, 1064, 7)) +>dt : Symbol(dt, Decl(temporal.ts, 1063, 7)) >second : Symbol(Temporal.PlainDateTime.second, Decl(lib.esnext.temporal.d.ts, --, --)) dt.millisecond; // => 0 >dt.millisecond : Symbol(Temporal.PlainDateTime.millisecond, Decl(lib.esnext.temporal.d.ts, --, --)) ->dt : Symbol(dt, Decl(temporal.ts, 1064, 7)) +>dt : Symbol(dt, Decl(temporal.ts, 1063, 7)) >millisecond : Symbol(Temporal.PlainDateTime.millisecond, Decl(lib.esnext.temporal.d.ts, --, --)) dt.microsecond; // => 3 >dt.microsecond : Symbol(Temporal.PlainDateTime.microsecond, Decl(lib.esnext.temporal.d.ts, --, --)) ->dt : Symbol(dt, Decl(temporal.ts, 1064, 7)) +>dt : Symbol(dt, Decl(temporal.ts, 1063, 7)) >microsecond : Symbol(Temporal.PlainDateTime.microsecond, Decl(lib.esnext.temporal.d.ts, --, --)) dt.nanosecond; // => 500 >dt.nanosecond : Symbol(Temporal.PlainDateTime.nanosecond, Decl(lib.esnext.temporal.d.ts, --, --)) ->dt : Symbol(dt, Decl(temporal.ts, 1064, 7)) +>dt : Symbol(dt, Decl(temporal.ts, 1063, 7)) >nanosecond : Symbol(Temporal.PlainDateTime.nanosecond, Decl(lib.esnext.temporal.d.ts, --, --)) } { const date = Temporal.PlainDateTime.from("-000015-01-01T12:30[u-ca=gregory]"); ->date : Symbol(date, Decl(temporal.ts, 1092, 9)) +>date : Symbol(date, Decl(temporal.ts, 1091, 9)) >Temporal.PlainDateTime.from : Symbol(Temporal.PlainDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.PlainDateTime : Symbol(Temporal.PlainDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -4117,19 +4108,19 @@ date.era; >date.era : Symbol(Temporal.PlainDateTime.era, Decl(lib.esnext.temporal.d.ts, --, --)) ->date : Symbol(date, Decl(temporal.ts, 1092, 9)) +>date : Symbol(date, Decl(temporal.ts, 1091, 9)) >era : Symbol(Temporal.PlainDateTime.era, Decl(lib.esnext.temporal.d.ts, --, --)) // => 'bce' date.eraYear; >date.eraYear : Symbol(Temporal.PlainDateTime.eraYear, Decl(lib.esnext.temporal.d.ts, --, --)) ->date : Symbol(date, Decl(temporal.ts, 1092, 9)) +>date : Symbol(date, Decl(temporal.ts, 1091, 9)) >eraYear : Symbol(Temporal.PlainDateTime.eraYear, Decl(lib.esnext.temporal.d.ts, --, --)) // => 16 date.year; >date.year : Symbol(Temporal.PlainDateTime.year, Decl(lib.esnext.temporal.d.ts, --, --)) ->date : Symbol(date, Decl(temporal.ts, 1092, 9)) +>date : Symbol(date, Decl(temporal.ts, 1091, 9)) >year : Symbol(Temporal.PlainDateTime.year, Decl(lib.esnext.temporal.d.ts, --, --)) // => -15 @@ -4137,7 +4128,7 @@ { const dt = Temporal.PlainDateTime.from("1995-12-07T03:24:30.000003500"); ->dt : Symbol(dt, Decl(temporal.ts, 1102, 9)) +>dt : Symbol(dt, Decl(temporal.ts, 1101, 9)) >Temporal.PlainDateTime.from : Symbol(Temporal.PlainDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.PlainDateTime : Symbol(Temporal.PlainDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -4146,13 +4137,13 @@ ["MON", "TUE", "WED", "THU", "FRI", "SAT", "SUN"][dt.dayOfWeek - 1]; // => 'THU' >dt.dayOfWeek : Symbol(Temporal.PlainDateTime.dayOfWeek, Decl(lib.esnext.temporal.d.ts, --, --)) ->dt : Symbol(dt, Decl(temporal.ts, 1102, 9)) +>dt : Symbol(dt, Decl(temporal.ts, 1101, 9)) >dayOfWeek : Symbol(Temporal.PlainDateTime.dayOfWeek, Decl(lib.esnext.temporal.d.ts, --, --)) } { const dt = Temporal.PlainDateTime.from("1995-12-07T03:24:30.000003500"); ->dt : Symbol(dt, Decl(temporal.ts, 1107, 9)) +>dt : Symbol(dt, Decl(temporal.ts, 1106, 9)) >Temporal.PlainDateTime.from : Symbol(Temporal.PlainDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.PlainDateTime : Symbol(Temporal.PlainDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -4165,16 +4156,16 @@ >console : Symbol(console, Decl(lib.dom.d.ts, --, --)) >log : Symbol(Console.log, Decl(lib.dom.d.ts, --, --)) >dt.year : Symbol(Temporal.PlainDateTime.year, Decl(lib.esnext.temporal.d.ts, --, --)) ->dt : Symbol(dt, Decl(temporal.ts, 1107, 9)) +>dt : Symbol(dt, Decl(temporal.ts, 1106, 9)) >year : Symbol(Temporal.PlainDateTime.year, Decl(lib.esnext.temporal.d.ts, --, --)) >dt.dayOfYear : Symbol(Temporal.PlainDateTime.dayOfYear, Decl(lib.esnext.temporal.d.ts, --, --)) ->dt : Symbol(dt, Decl(temporal.ts, 1107, 9)) +>dt : Symbol(dt, Decl(temporal.ts, 1106, 9)) >dayOfYear : Symbol(Temporal.PlainDateTime.dayOfYear, Decl(lib.esnext.temporal.d.ts, --, --)) } { const dt = Temporal.PlainDateTime.from("2022-01-01T03:24:30.000003500"); ->dt : Symbol(dt, Decl(temporal.ts, 1113, 9)) +>dt : Symbol(dt, Decl(temporal.ts, 1112, 9)) >Temporal.PlainDateTime.from : Symbol(Temporal.PlainDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.PlainDateTime : Symbol(Temporal.PlainDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -4187,19 +4178,19 @@ >console : Symbol(console, Decl(lib.dom.d.ts, --, --)) >log : Symbol(Console.log, Decl(lib.dom.d.ts, --, --)) >dt.yearOfWeek : Symbol(Temporal.PlainDateTime.yearOfWeek, Decl(lib.esnext.temporal.d.ts, --, --)) ->dt : Symbol(dt, Decl(temporal.ts, 1113, 9)) +>dt : Symbol(dt, Decl(temporal.ts, 1112, 9)) >yearOfWeek : Symbol(Temporal.PlainDateTime.yearOfWeek, Decl(lib.esnext.temporal.d.ts, --, --)) >dt.weekOfYear : Symbol(Temporal.PlainDateTime.weekOfYear, Decl(lib.esnext.temporal.d.ts, --, --)) ->dt : Symbol(dt, Decl(temporal.ts, 1113, 9)) +>dt : Symbol(dt, Decl(temporal.ts, 1112, 9)) >weekOfYear : Symbol(Temporal.PlainDateTime.weekOfYear, Decl(lib.esnext.temporal.d.ts, --, --)) >dt.dayOfWeek : Symbol(Temporal.PlainDateTime.dayOfWeek, Decl(lib.esnext.temporal.d.ts, --, --)) ->dt : Symbol(dt, Decl(temporal.ts, 1113, 9)) +>dt : Symbol(dt, Decl(temporal.ts, 1112, 9)) >dayOfWeek : Symbol(Temporal.PlainDateTime.dayOfWeek, Decl(lib.esnext.temporal.d.ts, --, --)) } { const dt = Temporal.PlainDateTime.from("1995-12-07T03:24:30.000003500"); ->dt : Symbol(dt, Decl(temporal.ts, 1119, 9)) +>dt : Symbol(dt, Decl(temporal.ts, 1118, 9)) >Temporal.PlainDateTime.from : Symbol(Temporal.PlainDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.PlainDateTime : Symbol(Temporal.PlainDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -4208,25 +4199,25 @@ dt.daysInWeek; // => 7 >dt.daysInWeek : Symbol(Temporal.PlainDateTime.daysInWeek, Decl(lib.esnext.temporal.d.ts, --, --)) ->dt : Symbol(dt, Decl(temporal.ts, 1119, 9)) +>dt : Symbol(dt, Decl(temporal.ts, 1118, 9)) >daysInWeek : Symbol(Temporal.PlainDateTime.daysInWeek, Decl(lib.esnext.temporal.d.ts, --, --)) } { // Attempt to write some mnemonic poetry const monthsByDays: Record = {}; ->monthsByDays : Symbol(monthsByDays, Decl(temporal.ts, 1125, 9)) +>monthsByDays : Symbol(monthsByDays, Decl(temporal.ts, 1124, 9)) >Record : Symbol(Record, Decl(lib.es5.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) >PlainDateTime : Symbol(Temporal.PlainDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) for (let month = 1; month <= 12; month++) { ->month : Symbol(month, Decl(temporal.ts, 1126, 12)) ->month : Symbol(month, Decl(temporal.ts, 1126, 12)) ->month : Symbol(month, Decl(temporal.ts, 1126, 12)) +>month : Symbol(month, Decl(temporal.ts, 1125, 12)) +>month : Symbol(month, Decl(temporal.ts, 1125, 12)) +>month : Symbol(month, Decl(temporal.ts, 1125, 12)) const dt = Temporal.Now.plainDateTimeISO().with({ month }); ->dt : Symbol(dt, Decl(temporal.ts, 1127, 13)) +>dt : Symbol(dt, Decl(temporal.ts, 1126, 13)) >Temporal.Now.plainDateTimeISO().with : Symbol(Temporal.PlainDateTime.with, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.Now.plainDateTimeISO : Symbol(Temporal.Now.plainDateTimeISO, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.Now : Symbol(Temporal.Now, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -4234,65 +4225,65 @@ >Now : Symbol(Temporal.Now, Decl(lib.esnext.temporal.d.ts, --, --)) >plainDateTimeISO : Symbol(Temporal.Now.plainDateTimeISO, Decl(lib.esnext.temporal.d.ts, --, --)) >with : Symbol(Temporal.PlainDateTime.with, Decl(lib.esnext.temporal.d.ts, --, --)) ->month : Symbol(month, Decl(temporal.ts, 1127, 57)) +>month : Symbol(month, Decl(temporal.ts, 1126, 57)) monthsByDays[dt.daysInMonth] = (monthsByDays[dt.daysInMonth] || []).concat(dt); ->monthsByDays : Symbol(monthsByDays, Decl(temporal.ts, 1125, 9)) +>monthsByDays : Symbol(monthsByDays, Decl(temporal.ts, 1124, 9)) >dt.daysInMonth : Symbol(Temporal.PlainDateTime.daysInMonth, Decl(lib.esnext.temporal.d.ts, --, --)) ->dt : Symbol(dt, Decl(temporal.ts, 1127, 13)) +>dt : Symbol(dt, Decl(temporal.ts, 1126, 13)) >daysInMonth : Symbol(Temporal.PlainDateTime.daysInMonth, Decl(lib.esnext.temporal.d.ts, --, --)) >(monthsByDays[dt.daysInMonth] || []).concat : Symbol(Array.concat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) ->monthsByDays : Symbol(monthsByDays, Decl(temporal.ts, 1125, 9)) +>monthsByDays : Symbol(monthsByDays, Decl(temporal.ts, 1124, 9)) >dt.daysInMonth : Symbol(Temporal.PlainDateTime.daysInMonth, Decl(lib.esnext.temporal.d.ts, --, --)) ->dt : Symbol(dt, Decl(temporal.ts, 1127, 13)) +>dt : Symbol(dt, Decl(temporal.ts, 1126, 13)) >daysInMonth : Symbol(Temporal.PlainDateTime.daysInMonth, Decl(lib.esnext.temporal.d.ts, --, --)) >concat : Symbol(Array.concat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) ->dt : Symbol(dt, Decl(temporal.ts, 1127, 13)) +>dt : Symbol(dt, Decl(temporal.ts, 1126, 13)) } const strings = monthsByDays[30].map(dt => dt.toLocaleString("en", { month: "long" })); ->strings : Symbol(strings, Decl(temporal.ts, 1131, 9)) +>strings : Symbol(strings, Decl(temporal.ts, 1130, 9)) >monthsByDays[30].map : Symbol(Array.map, Decl(lib.es5.d.ts, --, --)) ->monthsByDays : Symbol(monthsByDays, Decl(temporal.ts, 1125, 9)) +>monthsByDays : Symbol(monthsByDays, Decl(temporal.ts, 1124, 9)) >map : Symbol(Array.map, Decl(lib.es5.d.ts, --, --)) ->dt : Symbol(dt, Decl(temporal.ts, 1131, 41)) +>dt : Symbol(dt, Decl(temporal.ts, 1130, 41)) >dt.toLocaleString : Symbol(Temporal.PlainDateTime.toLocaleString, Decl(lib.esnext.temporal.d.ts, --, --)) ->dt : Symbol(dt, Decl(temporal.ts, 1131, 41)) +>dt : Symbol(dt, Decl(temporal.ts, 1130, 41)) >toLocaleString : Symbol(Temporal.PlainDateTime.toLocaleString, Decl(lib.esnext.temporal.d.ts, --, --)) ->month : Symbol(month, Decl(temporal.ts, 1131, 72)) +>month : Symbol(month, Decl(temporal.ts, 1130, 72)) // Shuffle to improve poem as determined empirically strings.unshift(strings.pop()!); >strings.unshift : Symbol(Array.unshift, Decl(lib.es5.d.ts, --, --)) ->strings : Symbol(strings, Decl(temporal.ts, 1131, 9)) +>strings : Symbol(strings, Decl(temporal.ts, 1130, 9)) >unshift : Symbol(Array.unshift, Decl(lib.es5.d.ts, --, --)) >strings.pop : Symbol(Array.pop, Decl(lib.es5.d.ts, --, --)) ->strings : Symbol(strings, Decl(temporal.ts, 1131, 9)) +>strings : Symbol(strings, Decl(temporal.ts, 1130, 9)) >pop : Symbol(Array.pop, Decl(lib.es5.d.ts, --, --)) const format = new Intl.ListFormat("en"); ->format : Symbol(format, Decl(temporal.ts, 1134, 9)) +>format : Symbol(format, Decl(temporal.ts, 1133, 9)) >Intl.ListFormat : Symbol(Intl.ListFormat, Decl(lib.es2021.intl.d.ts, --, --), Decl(lib.es2021.intl.d.ts, --, --)) >Intl : Symbol(Intl, Decl(lib.es5.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2020.intl.d.ts, --, --), Decl(lib.es2021.intl.d.ts, --, --), Decl(lib.es2025.intl.d.ts, --, --) ... and 1 more) >ListFormat : Symbol(Intl.ListFormat, Decl(lib.es2021.intl.d.ts, --, --), Decl(lib.es2021.intl.d.ts, --, --)) const poem = `Thirty days hath ${format.format(strings)}`; ->poem : Symbol(poem, Decl(temporal.ts, 1135, 9)) +>poem : Symbol(poem, Decl(temporal.ts, 1134, 9)) >format.format : Symbol(Intl.ListFormat.format, Decl(lib.es2021.intl.d.ts, --, --)) ->format : Symbol(format, Decl(temporal.ts, 1134, 9)) +>format : Symbol(format, Decl(temporal.ts, 1133, 9)) >format : Symbol(Intl.ListFormat.format, Decl(lib.es2021.intl.d.ts, --, --)) ->strings : Symbol(strings, Decl(temporal.ts, 1131, 9)) +>strings : Symbol(strings, Decl(temporal.ts, 1130, 9)) console.log(poem); >console.log : Symbol(Console.log, Decl(lib.dom.d.ts, --, --)) >console : Symbol(console, Decl(lib.dom.d.ts, --, --)) >log : Symbol(Console.log, Decl(lib.dom.d.ts, --, --)) ->poem : Symbol(poem, Decl(temporal.ts, 1135, 9)) +>poem : Symbol(poem, Decl(temporal.ts, 1134, 9)) } { const dt = Temporal.Now.plainDateTimeISO(); ->dt : Symbol(dt, Decl(temporal.ts, 1141, 9)) +>dt : Symbol(dt, Decl(temporal.ts, 1140, 9)) >Temporal.Now.plainDateTimeISO : Symbol(Temporal.Now.plainDateTimeISO, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.Now : Symbol(Temporal.Now, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -4300,26 +4291,26 @@ >plainDateTimeISO : Symbol(Temporal.Now.plainDateTimeISO, Decl(lib.esnext.temporal.d.ts, --, --)) const percent = dt.dayOfYear / dt.daysInYear; ->percent : Symbol(percent, Decl(temporal.ts, 1142, 9)) +>percent : Symbol(percent, Decl(temporal.ts, 1141, 9)) >dt.dayOfYear : Symbol(Temporal.PlainDateTime.dayOfYear, Decl(lib.esnext.temporal.d.ts, --, --)) ->dt : Symbol(dt, Decl(temporal.ts, 1141, 9)) +>dt : Symbol(dt, Decl(temporal.ts, 1140, 9)) >dayOfYear : Symbol(Temporal.PlainDateTime.dayOfYear, Decl(lib.esnext.temporal.d.ts, --, --)) >dt.daysInYear : Symbol(Temporal.PlainDateTime.daysInYear, Decl(lib.esnext.temporal.d.ts, --, --)) ->dt : Symbol(dt, Decl(temporal.ts, 1141, 9)) +>dt : Symbol(dt, Decl(temporal.ts, 1140, 9)) >daysInYear : Symbol(Temporal.PlainDateTime.daysInYear, Decl(lib.esnext.temporal.d.ts, --, --)) `The year is ${percent.toLocaleString("en", { style: "percent" })} over!`; >percent.toLocaleString : Symbol(Number.toLocaleString, Decl(lib.es5.d.ts, --, --)) ->percent : Symbol(percent, Decl(temporal.ts, 1142, 9)) +>percent : Symbol(percent, Decl(temporal.ts, 1141, 9)) >toLocaleString : Symbol(Number.toLocaleString, Decl(lib.es5.d.ts, --, --)) ->style : Symbol(style, Decl(temporal.ts, 1143, 49)) +>style : Symbol(style, Decl(temporal.ts, 1142, 49)) // example output: "The year is 10% over!" } { const dt = Temporal.PlainDate.from("1900-01-01T12:00"); ->dt : Symbol(dt, Decl(temporal.ts, 1148, 9)) +>dt : Symbol(dt, Decl(temporal.ts, 1147, 9)) >Temporal.PlainDate.from : Symbol(Temporal.PlainDateConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.PlainDate : Symbol(Temporal.PlainDate, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -4328,14 +4319,14 @@ dt.monthsInYear; // => 12 >dt.monthsInYear : Symbol(Temporal.PlainDate.monthsInYear, Decl(lib.esnext.temporal.d.ts, --, --)) ->dt : Symbol(dt, Decl(temporal.ts, 1148, 9)) +>dt : Symbol(dt, Decl(temporal.ts, 1147, 9)) >monthsInYear : Symbol(Temporal.PlainDate.monthsInYear, Decl(lib.esnext.temporal.d.ts, --, --)) } { // Is this year a leap year? const dt = Temporal.Now.plainDateTimeISO(); ->dt : Symbol(dt, Decl(temporal.ts, 1154, 9)) +>dt : Symbol(dt, Decl(temporal.ts, 1153, 9)) >Temporal.Now.plainDateTimeISO : Symbol(Temporal.Now.plainDateTimeISO, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.Now : Symbol(Temporal.Now, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -4344,22 +4335,22 @@ dt.inLeapYear; // example output: true >dt.inLeapYear : Symbol(Temporal.PlainDateTime.inLeapYear, Decl(lib.esnext.temporal.d.ts, --, --)) ->dt : Symbol(dt, Decl(temporal.ts, 1154, 9)) +>dt : Symbol(dt, Decl(temporal.ts, 1153, 9)) >inLeapYear : Symbol(Temporal.PlainDateTime.inLeapYear, Decl(lib.esnext.temporal.d.ts, --, --)) // Is 2100 a leap year? (no, because it's divisible by 100 and not 400) dt.with({ year: 2100 }).inLeapYear; // => false >dt.with({ year: 2100 }).inLeapYear : Symbol(Temporal.PlainDateTime.inLeapYear, Decl(lib.esnext.temporal.d.ts, --, --)) >dt.with : Symbol(Temporal.PlainDateTime.with, Decl(lib.esnext.temporal.d.ts, --, --)) ->dt : Symbol(dt, Decl(temporal.ts, 1154, 9)) +>dt : Symbol(dt, Decl(temporal.ts, 1153, 9)) >with : Symbol(Temporal.PlainDateTime.with, Decl(lib.esnext.temporal.d.ts, --, --)) ->year : Symbol(year, Decl(temporal.ts, 1157, 13)) +>year : Symbol(year, Decl(temporal.ts, 1156, 13)) >inLeapYear : Symbol(Temporal.PlainDateTime.inLeapYear, Decl(lib.esnext.temporal.d.ts, --, --)) } { const dt = Temporal.PlainDateTime.from("1995-12-07T03:24:30.000003500"); ->dt : Symbol(dt, Decl(temporal.ts, 1161, 9)) +>dt : Symbol(dt, Decl(temporal.ts, 1160, 9)) >Temporal.PlainDateTime.from : Symbol(Temporal.PlainDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.PlainDateTime : Symbol(Temporal.PlainDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -4368,15 +4359,15 @@ dt.with({ year: 2015, second: 31 }); // => 2015-12-07T03:24:31.0000035 >dt.with : Symbol(Temporal.PlainDateTime.with, Decl(lib.esnext.temporal.d.ts, --, --)) ->dt : Symbol(dt, Decl(temporal.ts, 1161, 9)) +>dt : Symbol(dt, Decl(temporal.ts, 1160, 9)) >with : Symbol(Temporal.PlainDateTime.with, Decl(lib.esnext.temporal.d.ts, --, --)) ->year : Symbol(year, Decl(temporal.ts, 1162, 13)) ->second : Symbol(second, Decl(temporal.ts, 1162, 25)) +>year : Symbol(year, Decl(temporal.ts, 1161, 13)) +>second : Symbol(second, Decl(temporal.ts, 1161, 25)) } { const dt = Temporal.PlainDateTime.from("2015-12-07T03:24:30.000003500"); ->dt : Symbol(dt, Decl(temporal.ts, 1166, 9)) +>dt : Symbol(dt, Decl(temporal.ts, 1165, 9)) >Temporal.PlainDateTime.from : Symbol(Temporal.PlainDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.PlainDateTime : Symbol(Temporal.PlainDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -4385,12 +4376,12 @@ dt.withPlainTime({ hour: 10 }); // => 2015-12-07T10:00:00 >dt.withPlainTime : Symbol(Temporal.PlainDateTime.withPlainTime, Decl(lib.esnext.temporal.d.ts, --, --)) ->dt : Symbol(dt, Decl(temporal.ts, 1166, 9)) +>dt : Symbol(dt, Decl(temporal.ts, 1165, 9)) >withPlainTime : Symbol(Temporal.PlainDateTime.withPlainTime, Decl(lib.esnext.temporal.d.ts, --, --)) ->hour : Symbol(hour, Decl(temporal.ts, 1167, 22)) +>hour : Symbol(hour, Decl(temporal.ts, 1166, 22)) const time = Temporal.PlainTime.from("11:22"); ->time : Symbol(time, Decl(temporal.ts, 1168, 9)) +>time : Symbol(time, Decl(temporal.ts, 1167, 9)) >Temporal.PlainTime.from : Symbol(Temporal.PlainTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.PlainTime : Symbol(Temporal.PlainTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -4399,29 +4390,29 @@ dt.withPlainTime(time); // => 2015-12-07T11:22:00 >dt.withPlainTime : Symbol(Temporal.PlainDateTime.withPlainTime, Decl(lib.esnext.temporal.d.ts, --, --)) ->dt : Symbol(dt, Decl(temporal.ts, 1166, 9)) +>dt : Symbol(dt, Decl(temporal.ts, 1165, 9)) >withPlainTime : Symbol(Temporal.PlainDateTime.withPlainTime, Decl(lib.esnext.temporal.d.ts, --, --)) ->time : Symbol(time, Decl(temporal.ts, 1168, 9)) +>time : Symbol(time, Decl(temporal.ts, 1167, 9)) dt.withPlainTime("12:34"); // => 2015-12-07T12:34:00 >dt.withPlainTime : Symbol(Temporal.PlainDateTime.withPlainTime, Decl(lib.esnext.temporal.d.ts, --, --)) ->dt : Symbol(dt, Decl(temporal.ts, 1166, 9)) +>dt : Symbol(dt, Decl(temporal.ts, 1165, 9)) >withPlainTime : Symbol(Temporal.PlainDateTime.withPlainTime, Decl(lib.esnext.temporal.d.ts, --, --)) // easier for chaining dt.add({ days: 2, hours: 22 }).withPlainTime("00:00"); // => 2015-12-10T00:00:00 >dt.add({ days: 2, hours: 22 }).withPlainTime : Symbol(Temporal.PlainDateTime.withPlainTime, Decl(lib.esnext.temporal.d.ts, --, --)) >dt.add : Symbol(Temporal.PlainDateTime.add, Decl(lib.esnext.temporal.d.ts, --, --)) ->dt : Symbol(dt, Decl(temporal.ts, 1166, 9)) +>dt : Symbol(dt, Decl(temporal.ts, 1165, 9)) >add : Symbol(Temporal.PlainDateTime.add, Decl(lib.esnext.temporal.d.ts, --, --)) ->days : Symbol(days, Decl(temporal.ts, 1173, 12)) ->hours : Symbol(hours, Decl(temporal.ts, 1173, 21)) +>days : Symbol(days, Decl(temporal.ts, 1172, 12)) +>hours : Symbol(hours, Decl(temporal.ts, 1172, 21)) >withPlainTime : Symbol(Temporal.PlainDateTime.withPlainTime, Decl(lib.esnext.temporal.d.ts, --, --)) } { const dt = Temporal.PlainDateTime.from("1995-12-07T03:24:30.000003500[u-ca=japanese]"); ->dt : Symbol(dt, Decl(temporal.ts, 1177, 9)) +>dt : Symbol(dt, Decl(temporal.ts, 1176, 9)) >Temporal.PlainDateTime.from : Symbol(Temporal.PlainDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.PlainDateTime : Symbol(Temporal.PlainDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -4430,18 +4421,18 @@ dt.withCalendar("iso8601"); // => 1995-12-07T03:24:30.0000035 >dt.withCalendar : Symbol(Temporal.PlainDateTime.withCalendar, Decl(lib.esnext.temporal.d.ts, --, --)) ->dt : Symbol(dt, Decl(temporal.ts, 1177, 9)) +>dt : Symbol(dt, Decl(temporal.ts, 1176, 9)) >withCalendar : Symbol(Temporal.PlainDateTime.withCalendar, Decl(lib.esnext.temporal.d.ts, --, --)) } { let dt: Temporal.PlainDateTime; ->dt : Symbol(dt, Decl(temporal.ts, 1182, 7)) +>dt : Symbol(dt, Decl(temporal.ts, 1181, 7)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) >PlainDateTime : Symbol(Temporal.PlainDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) dt = Temporal.PlainDateTime.from("1995-12-07T03:24:30.000003500"); ->dt : Symbol(dt, Decl(temporal.ts, 1182, 7)) +>dt : Symbol(dt, Decl(temporal.ts, 1181, 7)) >Temporal.PlainDateTime.from : Symbol(Temporal.PlainDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.PlainDateTime : Symbol(Temporal.PlainDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -4450,14 +4441,14 @@ dt.add({ years: 20, months: 4, nanoseconds: 500 }); // => 2016-04-07T03:24:30.000004 >dt.add : Symbol(Temporal.PlainDateTime.add, Decl(lib.esnext.temporal.d.ts, --, --)) ->dt : Symbol(dt, Decl(temporal.ts, 1182, 7)) +>dt : Symbol(dt, Decl(temporal.ts, 1181, 7)) >add : Symbol(Temporal.PlainDateTime.add, Decl(lib.esnext.temporal.d.ts, --, --)) ->years : Symbol(years, Decl(temporal.ts, 1185, 12)) ->months : Symbol(months, Decl(temporal.ts, 1185, 23)) ->nanoseconds : Symbol(nanoseconds, Decl(temporal.ts, 1185, 34)) +>years : Symbol(years, Decl(temporal.ts, 1184, 12)) +>months : Symbol(months, Decl(temporal.ts, 1184, 23)) +>nanoseconds : Symbol(nanoseconds, Decl(temporal.ts, 1184, 34)) dt = Temporal.PlainDateTime.from("2019-01-31T15:30"); ->dt : Symbol(dt, Decl(temporal.ts, 1182, 7)) +>dt : Symbol(dt, Decl(temporal.ts, 1181, 7)) >Temporal.PlainDateTime.from : Symbol(Temporal.PlainDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.PlainDateTime : Symbol(Temporal.PlainDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -4466,26 +4457,26 @@ dt.add({ months: 1 }); // => 2019-02-28T15:30:00 >dt.add : Symbol(Temporal.PlainDateTime.add, Decl(lib.esnext.temporal.d.ts, --, --)) ->dt : Symbol(dt, Decl(temporal.ts, 1182, 7)) +>dt : Symbol(dt, Decl(temporal.ts, 1181, 7)) >add : Symbol(Temporal.PlainDateTime.add, Decl(lib.esnext.temporal.d.ts, --, --)) ->months : Symbol(months, Decl(temporal.ts, 1188, 12)) +>months : Symbol(months, Decl(temporal.ts, 1187, 12)) dt.add({ months: 1 }, { overflow: "reject" }); // => throws >dt.add : Symbol(Temporal.PlainDateTime.add, Decl(lib.esnext.temporal.d.ts, --, --)) ->dt : Symbol(dt, Decl(temporal.ts, 1182, 7)) +>dt : Symbol(dt, Decl(temporal.ts, 1181, 7)) >add : Symbol(Temporal.PlainDateTime.add, Decl(lib.esnext.temporal.d.ts, --, --)) ->months : Symbol(months, Decl(temporal.ts, 1189, 12)) ->overflow : Symbol(overflow, Decl(temporal.ts, 1189, 27)) +>months : Symbol(months, Decl(temporal.ts, 1188, 12)) +>overflow : Symbol(overflow, Decl(temporal.ts, 1188, 27)) } { let dt: Temporal.PlainDateTime; ->dt : Symbol(dt, Decl(temporal.ts, 1193, 7)) +>dt : Symbol(dt, Decl(temporal.ts, 1192, 7)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) >PlainDateTime : Symbol(Temporal.PlainDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) dt = Temporal.PlainDateTime.from("1995-12-07T03:24:30.000003500"); ->dt : Symbol(dt, Decl(temporal.ts, 1193, 7)) +>dt : Symbol(dt, Decl(temporal.ts, 1192, 7)) >Temporal.PlainDateTime.from : Symbol(Temporal.PlainDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.PlainDateTime : Symbol(Temporal.PlainDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -4494,14 +4485,14 @@ dt.subtract({ years: 20, months: 4, nanoseconds: 500 }); // => 1975-08-07T03:24:30.000003 >dt.subtract : Symbol(Temporal.PlainDateTime.subtract, Decl(lib.esnext.temporal.d.ts, --, --)) ->dt : Symbol(dt, Decl(temporal.ts, 1193, 7)) +>dt : Symbol(dt, Decl(temporal.ts, 1192, 7)) >subtract : Symbol(Temporal.PlainDateTime.subtract, Decl(lib.esnext.temporal.d.ts, --, --)) ->years : Symbol(years, Decl(temporal.ts, 1196, 17)) ->months : Symbol(months, Decl(temporal.ts, 1196, 28)) ->nanoseconds : Symbol(nanoseconds, Decl(temporal.ts, 1196, 39)) +>years : Symbol(years, Decl(temporal.ts, 1195, 17)) +>months : Symbol(months, Decl(temporal.ts, 1195, 28)) +>nanoseconds : Symbol(nanoseconds, Decl(temporal.ts, 1195, 39)) dt = Temporal.PlainDateTime.from("2019-03-31T15:30"); ->dt : Symbol(dt, Decl(temporal.ts, 1193, 7)) +>dt : Symbol(dt, Decl(temporal.ts, 1192, 7)) >Temporal.PlainDateTime.from : Symbol(Temporal.PlainDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.PlainDateTime : Symbol(Temporal.PlainDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -4510,21 +4501,21 @@ dt.subtract({ months: 1 }); // => 2019-02-28T15:30:00 >dt.subtract : Symbol(Temporal.PlainDateTime.subtract, Decl(lib.esnext.temporal.d.ts, --, --)) ->dt : Symbol(dt, Decl(temporal.ts, 1193, 7)) +>dt : Symbol(dt, Decl(temporal.ts, 1192, 7)) >subtract : Symbol(Temporal.PlainDateTime.subtract, Decl(lib.esnext.temporal.d.ts, --, --)) ->months : Symbol(months, Decl(temporal.ts, 1199, 17)) +>months : Symbol(months, Decl(temporal.ts, 1198, 17)) dt.subtract({ months: 1 }, { overflow: "reject" }); // => throws >dt.subtract : Symbol(Temporal.PlainDateTime.subtract, Decl(lib.esnext.temporal.d.ts, --, --)) ->dt : Symbol(dt, Decl(temporal.ts, 1193, 7)) +>dt : Symbol(dt, Decl(temporal.ts, 1192, 7)) >subtract : Symbol(Temporal.PlainDateTime.subtract, Decl(lib.esnext.temporal.d.ts, --, --)) ->months : Symbol(months, Decl(temporal.ts, 1200, 17)) ->overflow : Symbol(overflow, Decl(temporal.ts, 1200, 32)) +>months : Symbol(months, Decl(temporal.ts, 1199, 17)) +>overflow : Symbol(overflow, Decl(temporal.ts, 1199, 32)) } { const dt1 = Temporal.PlainDateTime.from("1995-12-07T03:24:30.000003500"); ->dt1 : Symbol(dt1, Decl(temporal.ts, 1204, 9)) +>dt1 : Symbol(dt1, Decl(temporal.ts, 1203, 9)) >Temporal.PlainDateTime.from : Symbol(Temporal.PlainDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.PlainDateTime : Symbol(Temporal.PlainDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -4532,7 +4523,7 @@ >from : Symbol(Temporal.PlainDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) const dt2 = Temporal.PlainDateTime.from("2019-01-31T15:30"); ->dt2 : Symbol(dt2, Decl(temporal.ts, 1205, 9)) +>dt2 : Symbol(dt2, Decl(temporal.ts, 1204, 9)) >Temporal.PlainDateTime.from : Symbol(Temporal.PlainDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.PlainDateTime : Symbol(Temporal.PlainDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -4541,33 +4532,33 @@ dt1.until(dt2); >dt1.until : Symbol(Temporal.PlainDateTime.until, Decl(lib.esnext.temporal.d.ts, --, --)) ->dt1 : Symbol(dt1, Decl(temporal.ts, 1204, 9)) +>dt1 : Symbol(dt1, Decl(temporal.ts, 1203, 9)) >until : Symbol(Temporal.PlainDateTime.until, Decl(lib.esnext.temporal.d.ts, --, --)) ->dt2 : Symbol(dt2, Decl(temporal.ts, 1205, 9)) +>dt2 : Symbol(dt2, Decl(temporal.ts, 1204, 9)) // => P8456DT12H5M29.9999965S dt1.until(dt2, { largestUnit: "year" }); >dt1.until : Symbol(Temporal.PlainDateTime.until, Decl(lib.esnext.temporal.d.ts, --, --)) ->dt1 : Symbol(dt1, Decl(temporal.ts, 1204, 9)) +>dt1 : Symbol(dt1, Decl(temporal.ts, 1203, 9)) >until : Symbol(Temporal.PlainDateTime.until, Decl(lib.esnext.temporal.d.ts, --, --)) ->dt2 : Symbol(dt2, Decl(temporal.ts, 1205, 9)) ->largestUnit : Symbol(largestUnit, Decl(temporal.ts, 1208, 20)) +>dt2 : Symbol(dt2, Decl(temporal.ts, 1204, 9)) +>largestUnit : Symbol(largestUnit, Decl(temporal.ts, 1207, 20)) // => P23Y1M24DT12H5M29.9999965S dt2.until(dt1, { largestUnit: "year" }); >dt2.until : Symbol(Temporal.PlainDateTime.until, Decl(lib.esnext.temporal.d.ts, --, --)) ->dt2 : Symbol(dt2, Decl(temporal.ts, 1205, 9)) +>dt2 : Symbol(dt2, Decl(temporal.ts, 1204, 9)) >until : Symbol(Temporal.PlainDateTime.until, Decl(lib.esnext.temporal.d.ts, --, --)) ->dt1 : Symbol(dt1, Decl(temporal.ts, 1204, 9)) ->largestUnit : Symbol(largestUnit, Decl(temporal.ts, 1210, 20)) +>dt1 : Symbol(dt1, Decl(temporal.ts, 1203, 9)) +>largestUnit : Symbol(largestUnit, Decl(temporal.ts, 1209, 20)) // => -P23Y1M24DT12H5M29.9999965S dt1.until(dt2, { largestUnit: "nanosecond" }); >dt1.until : Symbol(Temporal.PlainDateTime.until, Decl(lib.esnext.temporal.d.ts, --, --)) ->dt1 : Symbol(dt1, Decl(temporal.ts, 1204, 9)) +>dt1 : Symbol(dt1, Decl(temporal.ts, 1203, 9)) >until : Symbol(Temporal.PlainDateTime.until, Decl(lib.esnext.temporal.d.ts, --, --)) ->dt2 : Symbol(dt2, Decl(temporal.ts, 1205, 9)) ->largestUnit : Symbol(largestUnit, Decl(temporal.ts, 1212, 20)) +>dt2 : Symbol(dt2, Decl(temporal.ts, 1204, 9)) +>largestUnit : Symbol(largestUnit, Decl(temporal.ts, 1211, 20)) // => PT730641929.999996544S // (precision lost) @@ -4575,66 +4566,66 @@ // Rounding, for example if you don't care about sub-seconds dt1.until(dt2, { smallestUnit: "second" }); >dt1.until : Symbol(Temporal.PlainDateTime.until, Decl(lib.esnext.temporal.d.ts, --, --)) ->dt1 : Symbol(dt1, Decl(temporal.ts, 1204, 9)) +>dt1 : Symbol(dt1, Decl(temporal.ts, 1203, 9)) >until : Symbol(Temporal.PlainDateTime.until, Decl(lib.esnext.temporal.d.ts, --, --)) ->dt2 : Symbol(dt2, Decl(temporal.ts, 1205, 9)) ->smallestUnit : Symbol(smallestUnit, Decl(temporal.ts, 1217, 20)) +>dt2 : Symbol(dt2, Decl(temporal.ts, 1204, 9)) +>smallestUnit : Symbol(smallestUnit, Decl(temporal.ts, 1216, 20)) // => P8456DT12H5M29S // Months and years can be different lengths const [jan1, feb1, mar1] = [1, 2, 3].map(month => Temporal.PlainDateTime.from({ year: 2020, month, day: 1 })); ->jan1 : Symbol(jan1, Decl(temporal.ts, 1221, 11)) ->feb1 : Symbol(feb1, Decl(temporal.ts, 1221, 16)) ->mar1 : Symbol(mar1, Decl(temporal.ts, 1221, 22)) +>jan1 : Symbol(jan1, Decl(temporal.ts, 1220, 11)) +>feb1 : Symbol(feb1, Decl(temporal.ts, 1220, 16)) +>mar1 : Symbol(mar1, Decl(temporal.ts, 1220, 22)) >[1, 2, 3].map : Symbol(Array.map, Decl(lib.es5.d.ts, --, --)) >map : Symbol(Array.map, Decl(lib.es5.d.ts, --, --)) ->month : Symbol(month, Decl(temporal.ts, 1221, 45)) +>month : Symbol(month, Decl(temporal.ts, 1220, 45)) >Temporal.PlainDateTime.from : Symbol(Temporal.PlainDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.PlainDateTime : Symbol(Temporal.PlainDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) >PlainDateTime : Symbol(Temporal.PlainDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >from : Symbol(Temporal.PlainDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) ->year : Symbol(year, Decl(temporal.ts, 1221, 83)) ->month : Symbol(month, Decl(temporal.ts, 1221, 95)) ->day : Symbol(day, Decl(temporal.ts, 1221, 102)) +>year : Symbol(year, Decl(temporal.ts, 1220, 83)) +>month : Symbol(month, Decl(temporal.ts, 1220, 95)) +>day : Symbol(day, Decl(temporal.ts, 1220, 102)) jan1.until(feb1); // => P31D >jan1.until : Symbol(Temporal.PlainDateTime.until, Decl(lib.esnext.temporal.d.ts, --, --)) ->jan1 : Symbol(jan1, Decl(temporal.ts, 1221, 11)) +>jan1 : Symbol(jan1, Decl(temporal.ts, 1220, 11)) >until : Symbol(Temporal.PlainDateTime.until, Decl(lib.esnext.temporal.d.ts, --, --)) ->feb1 : Symbol(feb1, Decl(temporal.ts, 1221, 16)) +>feb1 : Symbol(feb1, Decl(temporal.ts, 1220, 16)) jan1.until(feb1, { largestUnit: "month" }); // => P1M >jan1.until : Symbol(Temporal.PlainDateTime.until, Decl(lib.esnext.temporal.d.ts, --, --)) ->jan1 : Symbol(jan1, Decl(temporal.ts, 1221, 11)) +>jan1 : Symbol(jan1, Decl(temporal.ts, 1220, 11)) >until : Symbol(Temporal.PlainDateTime.until, Decl(lib.esnext.temporal.d.ts, --, --)) ->feb1 : Symbol(feb1, Decl(temporal.ts, 1221, 16)) ->largestUnit : Symbol(largestUnit, Decl(temporal.ts, 1223, 22)) +>feb1 : Symbol(feb1, Decl(temporal.ts, 1220, 16)) +>largestUnit : Symbol(largestUnit, Decl(temporal.ts, 1222, 22)) feb1.until(mar1); // => P29D >feb1.until : Symbol(Temporal.PlainDateTime.until, Decl(lib.esnext.temporal.d.ts, --, --)) ->feb1 : Symbol(feb1, Decl(temporal.ts, 1221, 16)) +>feb1 : Symbol(feb1, Decl(temporal.ts, 1220, 16)) >until : Symbol(Temporal.PlainDateTime.until, Decl(lib.esnext.temporal.d.ts, --, --)) ->mar1 : Symbol(mar1, Decl(temporal.ts, 1221, 22)) +>mar1 : Symbol(mar1, Decl(temporal.ts, 1220, 22)) feb1.until(mar1, { largestUnit: "month" }); // => P1M >feb1.until : Symbol(Temporal.PlainDateTime.until, Decl(lib.esnext.temporal.d.ts, --, --)) ->feb1 : Symbol(feb1, Decl(temporal.ts, 1221, 16)) +>feb1 : Symbol(feb1, Decl(temporal.ts, 1220, 16)) >until : Symbol(Temporal.PlainDateTime.until, Decl(lib.esnext.temporal.d.ts, --, --)) ->mar1 : Symbol(mar1, Decl(temporal.ts, 1221, 22)) ->largestUnit : Symbol(largestUnit, Decl(temporal.ts, 1225, 22)) +>mar1 : Symbol(mar1, Decl(temporal.ts, 1220, 22)) +>largestUnit : Symbol(largestUnit, Decl(temporal.ts, 1224, 22)) jan1.until(mar1); // => P60D >jan1.until : Symbol(Temporal.PlainDateTime.until, Decl(lib.esnext.temporal.d.ts, --, --)) ->jan1 : Symbol(jan1, Decl(temporal.ts, 1221, 11)) +>jan1 : Symbol(jan1, Decl(temporal.ts, 1220, 11)) >until : Symbol(Temporal.PlainDateTime.until, Decl(lib.esnext.temporal.d.ts, --, --)) ->mar1 : Symbol(mar1, Decl(temporal.ts, 1221, 22)) +>mar1 : Symbol(mar1, Decl(temporal.ts, 1220, 22)) } { const dt1 = Temporal.PlainDateTime.from("1995-12-07T03:24:30.000003500"); ->dt1 : Symbol(dt1, Decl(temporal.ts, 1230, 9)) +>dt1 : Symbol(dt1, Decl(temporal.ts, 1229, 9)) >Temporal.PlainDateTime.from : Symbol(Temporal.PlainDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.PlainDateTime : Symbol(Temporal.PlainDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -4642,7 +4633,7 @@ >from : Symbol(Temporal.PlainDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) const dt2 = Temporal.PlainDateTime.from("2019-01-31T15:30"); ->dt2 : Symbol(dt2, Decl(temporal.ts, 1231, 9)) +>dt2 : Symbol(dt2, Decl(temporal.ts, 1230, 9)) >Temporal.PlainDateTime.from : Symbol(Temporal.PlainDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.PlainDateTime : Symbol(Temporal.PlainDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -4651,14 +4642,14 @@ dt2.since(dt1); // => P8456DT12H5M29.9999965S >dt2.since : Symbol(Temporal.PlainDateTime.since, Decl(lib.esnext.temporal.d.ts, --, --)) ->dt2 : Symbol(dt2, Decl(temporal.ts, 1231, 9)) +>dt2 : Symbol(dt2, Decl(temporal.ts, 1230, 9)) >since : Symbol(Temporal.PlainDateTime.since, Decl(lib.esnext.temporal.d.ts, --, --)) ->dt1 : Symbol(dt1, Decl(temporal.ts, 1230, 9)) +>dt1 : Symbol(dt1, Decl(temporal.ts, 1229, 9)) } { const dt = Temporal.PlainDateTime.from("1995-12-07T03:24:30.000003500"); ->dt : Symbol(dt, Decl(temporal.ts, 1236, 9)) +>dt : Symbol(dt, Decl(temporal.ts, 1235, 9)) >Temporal.PlainDateTime.from : Symbol(Temporal.PlainDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.PlainDateTime : Symbol(Temporal.PlainDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -4668,34 +4659,34 @@ // Round to a particular unit dt.round({ smallestUnit: "hour" }); // => 1995-12-07T03:00:00 >dt.round : Symbol(Temporal.PlainDateTime.round, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) ->dt : Symbol(dt, Decl(temporal.ts, 1236, 9)) +>dt : Symbol(dt, Decl(temporal.ts, 1235, 9)) >round : Symbol(Temporal.PlainDateTime.round, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) ->smallestUnit : Symbol(smallestUnit, Decl(temporal.ts, 1239, 14)) +>smallestUnit : Symbol(smallestUnit, Decl(temporal.ts, 1238, 14)) // Round to an increment of a unit, e.g. half an hour: dt.round({ roundingIncrement: 30, smallestUnit: "minute" }); >dt.round : Symbol(Temporal.PlainDateTime.round, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) ->dt : Symbol(dt, Decl(temporal.ts, 1236, 9)) +>dt : Symbol(dt, Decl(temporal.ts, 1235, 9)) >round : Symbol(Temporal.PlainDateTime.round, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) ->roundingIncrement : Symbol(roundingIncrement, Decl(temporal.ts, 1241, 14)) ->smallestUnit : Symbol(smallestUnit, Decl(temporal.ts, 1241, 37)) +>roundingIncrement : Symbol(roundingIncrement, Decl(temporal.ts, 1240, 14)) +>smallestUnit : Symbol(smallestUnit, Decl(temporal.ts, 1240, 37)) // => 1995-12-07T03:30:00 // Round to the same increment but round down instead: dt.round({ roundingIncrement: 30, smallestUnit: "minute", roundingMode: "floor" }); >dt.round : Symbol(Temporal.PlainDateTime.round, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) ->dt : Symbol(dt, Decl(temporal.ts, 1236, 9)) +>dt : Symbol(dt, Decl(temporal.ts, 1235, 9)) >round : Symbol(Temporal.PlainDateTime.round, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) ->roundingIncrement : Symbol(roundingIncrement, Decl(temporal.ts, 1244, 14)) ->smallestUnit : Symbol(smallestUnit, Decl(temporal.ts, 1244, 37)) ->roundingMode : Symbol(roundingMode, Decl(temporal.ts, 1244, 61)) +>roundingIncrement : Symbol(roundingIncrement, Decl(temporal.ts, 1243, 14)) +>smallestUnit : Symbol(smallestUnit, Decl(temporal.ts, 1243, 37)) +>roundingMode : Symbol(roundingMode, Decl(temporal.ts, 1243, 61)) // => 1995-12-07T03:00:00 } { const dt1 = Temporal.PlainDateTime.from("1995-12-07T03:24:30.000003500"); ->dt1 : Symbol(dt1, Decl(temporal.ts, 1249, 9)) +>dt1 : Symbol(dt1, Decl(temporal.ts, 1248, 9)) >Temporal.PlainDateTime.from : Symbol(Temporal.PlainDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.PlainDateTime : Symbol(Temporal.PlainDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -4703,7 +4694,7 @@ >from : Symbol(Temporal.PlainDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) const dt2 = Temporal.PlainDateTime.from("2019-01-31T15:30"); ->dt2 : Symbol(dt2, Decl(temporal.ts, 1250, 9)) +>dt2 : Symbol(dt2, Decl(temporal.ts, 1249, 9)) >Temporal.PlainDateTime.from : Symbol(Temporal.PlainDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.PlainDateTime : Symbol(Temporal.PlainDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -4712,20 +4703,20 @@ dt1.equals(dt2); // => false >dt1.equals : Symbol(Temporal.PlainDateTime.equals, Decl(lib.esnext.temporal.d.ts, --, --)) ->dt1 : Symbol(dt1, Decl(temporal.ts, 1249, 9)) +>dt1 : Symbol(dt1, Decl(temporal.ts, 1248, 9)) >equals : Symbol(Temporal.PlainDateTime.equals, Decl(lib.esnext.temporal.d.ts, --, --)) ->dt2 : Symbol(dt2, Decl(temporal.ts, 1250, 9)) +>dt2 : Symbol(dt2, Decl(temporal.ts, 1249, 9)) dt1.equals(dt1); // => true >dt1.equals : Symbol(Temporal.PlainDateTime.equals, Decl(lib.esnext.temporal.d.ts, --, --)) ->dt1 : Symbol(dt1, Decl(temporal.ts, 1249, 9)) +>dt1 : Symbol(dt1, Decl(temporal.ts, 1248, 9)) >equals : Symbol(Temporal.PlainDateTime.equals, Decl(lib.esnext.temporal.d.ts, --, --)) ->dt1 : Symbol(dt1, Decl(temporal.ts, 1249, 9)) +>dt1 : Symbol(dt1, Decl(temporal.ts, 1248, 9)) } { const dt = Temporal.PlainDateTime.from({ ->dt : Symbol(dt, Decl(temporal.ts, 1256, 9)) +>dt : Symbol(dt, Decl(temporal.ts, 1255, 9)) >Temporal.PlainDateTime.from : Symbol(Temporal.PlainDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.PlainDateTime : Symbol(Temporal.PlainDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -4733,69 +4724,69 @@ >from : Symbol(Temporal.PlainDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) year: 1999, ->year : Symbol(year, Decl(temporal.ts, 1256, 44)) +>year : Symbol(year, Decl(temporal.ts, 1255, 44)) month: 12, ->month : Symbol(month, Decl(temporal.ts, 1257, 19)) +>month : Symbol(month, Decl(temporal.ts, 1256, 19)) day: 31, ->day : Symbol(day, Decl(temporal.ts, 1258, 18)) +>day : Symbol(day, Decl(temporal.ts, 1257, 18)) hour: 23, ->hour : Symbol(hour, Decl(temporal.ts, 1259, 16)) +>hour : Symbol(hour, Decl(temporal.ts, 1258, 16)) minute: 59, ->minute : Symbol(minute, Decl(temporal.ts, 1260, 17)) +>minute : Symbol(minute, Decl(temporal.ts, 1259, 17)) second: 59, ->second : Symbol(second, Decl(temporal.ts, 1261, 19)) +>second : Symbol(second, Decl(temporal.ts, 1260, 19)) millisecond: 999, ->millisecond : Symbol(millisecond, Decl(temporal.ts, 1262, 19)) +>millisecond : Symbol(millisecond, Decl(temporal.ts, 1261, 19)) microsecond: 999, ->microsecond : Symbol(microsecond, Decl(temporal.ts, 1263, 25)) +>microsecond : Symbol(microsecond, Decl(temporal.ts, 1262, 25)) nanosecond: 999, ->nanosecond : Symbol(nanosecond, Decl(temporal.ts, 1264, 25)) +>nanosecond : Symbol(nanosecond, Decl(temporal.ts, 1263, 25)) }); dt.toString(); // => '1999-12-31T23:59:59.999999999' >dt.toString : Symbol(Temporal.PlainDateTime.toString, Decl(lib.esnext.temporal.d.ts, --, --)) ->dt : Symbol(dt, Decl(temporal.ts, 1256, 9)) +>dt : Symbol(dt, Decl(temporal.ts, 1255, 9)) >toString : Symbol(Temporal.PlainDateTime.toString, Decl(lib.esnext.temporal.d.ts, --, --)) dt.toString({ smallestUnit: "minute" }); // => '1999-12-31T23:59' >dt.toString : Symbol(Temporal.PlainDateTime.toString, Decl(lib.esnext.temporal.d.ts, --, --)) ->dt : Symbol(dt, Decl(temporal.ts, 1256, 9)) +>dt : Symbol(dt, Decl(temporal.ts, 1255, 9)) >toString : Symbol(Temporal.PlainDateTime.toString, Decl(lib.esnext.temporal.d.ts, --, --)) ->smallestUnit : Symbol(smallestUnit, Decl(temporal.ts, 1269, 17)) +>smallestUnit : Symbol(smallestUnit, Decl(temporal.ts, 1268, 17)) dt.toString({ fractionalSecondDigits: 0 }); // => '1999-12-31T23:59:59' >dt.toString : Symbol(Temporal.PlainDateTime.toString, Decl(lib.esnext.temporal.d.ts, --, --)) ->dt : Symbol(dt, Decl(temporal.ts, 1256, 9)) +>dt : Symbol(dt, Decl(temporal.ts, 1255, 9)) >toString : Symbol(Temporal.PlainDateTime.toString, Decl(lib.esnext.temporal.d.ts, --, --)) ->fractionalSecondDigits : Symbol(fractionalSecondDigits, Decl(temporal.ts, 1270, 17)) +>fractionalSecondDigits : Symbol(fractionalSecondDigits, Decl(temporal.ts, 1269, 17)) dt.toString({ fractionalSecondDigits: 4 }); // => '1999-12-31T23:59:59.9999' >dt.toString : Symbol(Temporal.PlainDateTime.toString, Decl(lib.esnext.temporal.d.ts, --, --)) ->dt : Symbol(dt, Decl(temporal.ts, 1256, 9)) +>dt : Symbol(dt, Decl(temporal.ts, 1255, 9)) >toString : Symbol(Temporal.PlainDateTime.toString, Decl(lib.esnext.temporal.d.ts, --, --)) ->fractionalSecondDigits : Symbol(fractionalSecondDigits, Decl(temporal.ts, 1271, 17)) +>fractionalSecondDigits : Symbol(fractionalSecondDigits, Decl(temporal.ts, 1270, 17)) dt.toString({ fractionalSecondDigits: 8, roundingMode: "halfExpand" }); >dt.toString : Symbol(Temporal.PlainDateTime.toString, Decl(lib.esnext.temporal.d.ts, --, --)) ->dt : Symbol(dt, Decl(temporal.ts, 1256, 9)) +>dt : Symbol(dt, Decl(temporal.ts, 1255, 9)) >toString : Symbol(Temporal.PlainDateTime.toString, Decl(lib.esnext.temporal.d.ts, --, --)) ->fractionalSecondDigits : Symbol(fractionalSecondDigits, Decl(temporal.ts, 1272, 17)) ->roundingMode : Symbol(roundingMode, Decl(temporal.ts, 1272, 44)) +>fractionalSecondDigits : Symbol(fractionalSecondDigits, Decl(temporal.ts, 1271, 17)) +>roundingMode : Symbol(roundingMode, Decl(temporal.ts, 1271, 44)) // => '2000-01-01T00:00:00.00000000' } { const dt = Temporal.PlainDateTime.from("1995-12-07T03:24:30.000003500"); ->dt : Symbol(dt, Decl(temporal.ts, 1277, 9)) +>dt : Symbol(dt, Decl(temporal.ts, 1276, 9)) >Temporal.PlainDateTime.from : Symbol(Temporal.PlainDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.PlainDateTime : Symbol(Temporal.PlainDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -4804,30 +4795,30 @@ dt.toLocaleString(); // example output: 1995-12-07, 3:24:30 a.m. >dt.toLocaleString : Symbol(Temporal.PlainDateTime.toLocaleString, Decl(lib.esnext.temporal.d.ts, --, --)) ->dt : Symbol(dt, Decl(temporal.ts, 1277, 9)) +>dt : Symbol(dt, Decl(temporal.ts, 1276, 9)) >toLocaleString : Symbol(Temporal.PlainDateTime.toLocaleString, Decl(lib.esnext.temporal.d.ts, --, --)) dt.toLocaleString("de-DE"); // example output: 7.12.1995, 03:24:30 >dt.toLocaleString : Symbol(Temporal.PlainDateTime.toLocaleString, Decl(lib.esnext.temporal.d.ts, --, --)) ->dt : Symbol(dt, Decl(temporal.ts, 1277, 9)) +>dt : Symbol(dt, Decl(temporal.ts, 1276, 9)) >toLocaleString : Symbol(Temporal.PlainDateTime.toLocaleString, Decl(lib.esnext.temporal.d.ts, --, --)) dt.toLocaleString("de-DE", { timeZone: "Europe/Berlin", weekday: "long" }); // => 'Donnerstag' >dt.toLocaleString : Symbol(Temporal.PlainDateTime.toLocaleString, Decl(lib.esnext.temporal.d.ts, --, --)) ->dt : Symbol(dt, Decl(temporal.ts, 1277, 9)) +>dt : Symbol(dt, Decl(temporal.ts, 1276, 9)) >toLocaleString : Symbol(Temporal.PlainDateTime.toLocaleString, Decl(lib.esnext.temporal.d.ts, --, --)) ->timeZone : Symbol(timeZone, Decl(temporal.ts, 1280, 32)) ->weekday : Symbol(weekday, Decl(temporal.ts, 1280, 59)) +>timeZone : Symbol(timeZone, Decl(temporal.ts, 1279, 32)) +>weekday : Symbol(weekday, Decl(temporal.ts, 1279, 59)) dt.toLocaleString("en-US-u-nu-fullwide-hc-h12"); // => '12/7/1995, 3:24:30 AM' >dt.toLocaleString : Symbol(Temporal.PlainDateTime.toLocaleString, Decl(lib.esnext.temporal.d.ts, --, --)) ->dt : Symbol(dt, Decl(temporal.ts, 1277, 9)) +>dt : Symbol(dt, Decl(temporal.ts, 1276, 9)) >toLocaleString : Symbol(Temporal.PlainDateTime.toLocaleString, Decl(lib.esnext.temporal.d.ts, --, --)) } { const dt = Temporal.PlainDateTime.from("1995-12-07T03:24:30.000003500"); ->dt : Symbol(dt, Decl(temporal.ts, 1285, 9)) +>dt : Symbol(dt, Decl(temporal.ts, 1284, 9)) >Temporal.PlainDateTime.from : Symbol(Temporal.PlainDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.PlainDateTime : Symbol(Temporal.PlainDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -4836,25 +4827,25 @@ dt.toPlainDate(); // => 1995-12-07 >dt.toPlainDate : Symbol(Temporal.PlainDateTime.toPlainDate, Decl(lib.esnext.temporal.d.ts, --, --)) ->dt : Symbol(dt, Decl(temporal.ts, 1285, 9)) +>dt : Symbol(dt, Decl(temporal.ts, 1284, 9)) >toPlainDate : Symbol(Temporal.PlainDateTime.toPlainDate, Decl(lib.esnext.temporal.d.ts, --, --)) dt.toPlainTime(); // => 03:24:30.0000035 >dt.toPlainTime : Symbol(Temporal.PlainDateTime.toPlainTime, Decl(lib.esnext.temporal.d.ts, --, --)) ->dt : Symbol(dt, Decl(temporal.ts, 1285, 9)) +>dt : Symbol(dt, Decl(temporal.ts, 1284, 9)) >toPlainTime : Symbol(Temporal.PlainDateTime.toPlainTime, Decl(lib.esnext.temporal.d.ts, --, --)) dt.toPlainDate().toPlainYearMonth(); // => 1995-12 >dt.toPlainDate().toPlainYearMonth : Symbol(Temporal.PlainDate.toPlainYearMonth, Decl(lib.esnext.temporal.d.ts, --, --)) >dt.toPlainDate : Symbol(Temporal.PlainDateTime.toPlainDate, Decl(lib.esnext.temporal.d.ts, --, --)) ->dt : Symbol(dt, Decl(temporal.ts, 1285, 9)) +>dt : Symbol(dt, Decl(temporal.ts, 1284, 9)) >toPlainDate : Symbol(Temporal.PlainDateTime.toPlainDate, Decl(lib.esnext.temporal.d.ts, --, --)) >toPlainYearMonth : Symbol(Temporal.PlainDate.toPlainYearMonth, Decl(lib.esnext.temporal.d.ts, --, --)) dt.toPlainDate().toPlainMonthDay(); // => 12-07 >dt.toPlainDate().toPlainMonthDay : Symbol(Temporal.PlainDate.toPlainMonthDay, Decl(lib.esnext.temporal.d.ts, --, --)) >dt.toPlainDate : Symbol(Temporal.PlainDateTime.toPlainDate, Decl(lib.esnext.temporal.d.ts, --, --)) ->dt : Symbol(dt, Decl(temporal.ts, 1285, 9)) +>dt : Symbol(dt, Decl(temporal.ts, 1284, 9)) >toPlainDate : Symbol(Temporal.PlainDateTime.toPlainDate, Decl(lib.esnext.temporal.d.ts, --, --)) >toPlainMonthDay : Symbol(Temporal.PlainDate.toPlainMonthDay, Decl(lib.esnext.temporal.d.ts, --, --)) } @@ -4862,7 +4853,7 @@ { // The June 2019 meeting const ym = new Temporal.PlainYearMonth(2019, 6); ->ym : Symbol(ym, Decl(temporal.ts, 1294, 9)) +>ym : Symbol(ym, Decl(temporal.ts, 1293, 9)) >Temporal.PlainYearMonth : Symbol(Temporal.PlainYearMonth, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) >PlainYearMonth : Symbol(Temporal.PlainYearMonth, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) @@ -4872,12 +4863,12 @@ { let ym: Temporal.PlainYearMonth; ->ym : Symbol(ym, Decl(temporal.ts, 1299, 7)) +>ym : Symbol(ym, Decl(temporal.ts, 1298, 7)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) >PlainYearMonth : Symbol(Temporal.PlainYearMonth, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) ym = Temporal.PlainYearMonth.from("2019-06"); // => 2019-06 ->ym : Symbol(ym, Decl(temporal.ts, 1299, 7)) +>ym : Symbol(ym, Decl(temporal.ts, 1298, 7)) >Temporal.PlainYearMonth.from : Symbol(Temporal.PlainYearMonthConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.PlainYearMonth : Symbol(Temporal.PlainYearMonth, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -4885,7 +4876,7 @@ >from : Symbol(Temporal.PlainYearMonthConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) ym = Temporal.PlainYearMonth.from("2019-06-24"); // => 2019-06 ->ym : Symbol(ym, Decl(temporal.ts, 1299, 7)) +>ym : Symbol(ym, Decl(temporal.ts, 1298, 7)) >Temporal.PlainYearMonth.from : Symbol(Temporal.PlainYearMonthConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.PlainYearMonth : Symbol(Temporal.PlainYearMonth, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -4893,7 +4884,7 @@ >from : Symbol(Temporal.PlainYearMonthConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) ym = Temporal.PlainYearMonth.from("2019-06-24T15:43:27"); // => 2019-06 ->ym : Symbol(ym, Decl(temporal.ts, 1299, 7)) +>ym : Symbol(ym, Decl(temporal.ts, 1298, 7)) >Temporal.PlainYearMonth.from : Symbol(Temporal.PlainYearMonthConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.PlainYearMonth : Symbol(Temporal.PlainYearMonth, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -4901,7 +4892,7 @@ >from : Symbol(Temporal.PlainYearMonthConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) ym = Temporal.PlainYearMonth.from("2019-06-24T15:43:27+01:00[Europe/Brussels]"); ->ym : Symbol(ym, Decl(temporal.ts, 1299, 7)) +>ym : Symbol(ym, Decl(temporal.ts, 1298, 7)) >Temporal.PlainYearMonth.from : Symbol(Temporal.PlainYearMonthConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.PlainYearMonth : Symbol(Temporal.PlainYearMonth, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -4910,26 +4901,26 @@ // => 2019-06 ym === Temporal.PlainYearMonth.from(ym); // => false ->ym : Symbol(ym, Decl(temporal.ts, 1299, 7)) +>ym : Symbol(ym, Decl(temporal.ts, 1298, 7)) >Temporal.PlainYearMonth.from : Symbol(Temporal.PlainYearMonthConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.PlainYearMonth : Symbol(Temporal.PlainYearMonth, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) >PlainYearMonth : Symbol(Temporal.PlainYearMonth, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >from : Symbol(Temporal.PlainYearMonthConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) ->ym : Symbol(ym, Decl(temporal.ts, 1299, 7)) +>ym : Symbol(ym, Decl(temporal.ts, 1298, 7)) ym = Temporal.PlainYearMonth.from({ year: 2019, month: 6 }); // => 2019-06 ->ym : Symbol(ym, Decl(temporal.ts, 1299, 7)) +>ym : Symbol(ym, Decl(temporal.ts, 1298, 7)) >Temporal.PlainYearMonth.from : Symbol(Temporal.PlainYearMonthConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.PlainYearMonth : Symbol(Temporal.PlainYearMonth, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) >PlainYearMonth : Symbol(Temporal.PlainYearMonth, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >from : Symbol(Temporal.PlainYearMonthConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) ->year : Symbol(year, Decl(temporal.ts, 1308, 39)) ->month : Symbol(month, Decl(temporal.ts, 1308, 51)) +>year : Symbol(year, Decl(temporal.ts, 1307, 39)) +>month : Symbol(month, Decl(temporal.ts, 1307, 51)) ym = Temporal.PlainYearMonth.from(Temporal.PlainDate.from("2019-06-24")); ->ym : Symbol(ym, Decl(temporal.ts, 1299, 7)) +>ym : Symbol(ym, Decl(temporal.ts, 1298, 7)) >Temporal.PlainYearMonth.from : Symbol(Temporal.PlainYearMonthConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.PlainYearMonth : Symbol(Temporal.PlainYearMonth, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -4946,34 +4937,34 @@ // Different overflow modes ym = Temporal.PlainYearMonth.from({ year: 2001, month: 13 }, { overflow: "constrain" }); ->ym : Symbol(ym, Decl(temporal.ts, 1299, 7)) +>ym : Symbol(ym, Decl(temporal.ts, 1298, 7)) >Temporal.PlainYearMonth.from : Symbol(Temporal.PlainYearMonthConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.PlainYearMonth : Symbol(Temporal.PlainYearMonth, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) >PlainYearMonth : Symbol(Temporal.PlainYearMonth, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >from : Symbol(Temporal.PlainYearMonthConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) ->year : Symbol(year, Decl(temporal.ts, 1314, 39)) ->month : Symbol(month, Decl(temporal.ts, 1314, 51)) ->overflow : Symbol(overflow, Decl(temporal.ts, 1314, 66)) +>year : Symbol(year, Decl(temporal.ts, 1313, 39)) +>month : Symbol(month, Decl(temporal.ts, 1313, 51)) +>overflow : Symbol(overflow, Decl(temporal.ts, 1313, 66)) // => 2001-12 ym = Temporal.PlainYearMonth.from({ year: 2001, month: 13 }, { overflow: "reject" }); ->ym : Symbol(ym, Decl(temporal.ts, 1299, 7)) +>ym : Symbol(ym, Decl(temporal.ts, 1298, 7)) >Temporal.PlainYearMonth.from : Symbol(Temporal.PlainYearMonthConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.PlainYearMonth : Symbol(Temporal.PlainYearMonth, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) >PlainYearMonth : Symbol(Temporal.PlainYearMonth, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >from : Symbol(Temporal.PlainYearMonthConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) ->year : Symbol(year, Decl(temporal.ts, 1316, 39)) ->month : Symbol(month, Decl(temporal.ts, 1316, 51)) ->overflow : Symbol(overflow, Decl(temporal.ts, 1316, 66)) +>year : Symbol(year, Decl(temporal.ts, 1315, 39)) +>month : Symbol(month, Decl(temporal.ts, 1315, 51)) +>overflow : Symbol(overflow, Decl(temporal.ts, 1315, 66)) // => throws } { const one = Temporal.PlainYearMonth.from("2006-08"); ->one : Symbol(one, Decl(temporal.ts, 1321, 9)) +>one : Symbol(one, Decl(temporal.ts, 1320, 9)) >Temporal.PlainYearMonth.from : Symbol(Temporal.PlainYearMonthConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.PlainYearMonth : Symbol(Temporal.PlainYearMonth, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -4981,7 +4972,7 @@ >from : Symbol(Temporal.PlainYearMonthConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) const two = Temporal.PlainYearMonth.from("2015-07"); ->two : Symbol(two, Decl(temporal.ts, 1322, 9)) +>two : Symbol(two, Decl(temporal.ts, 1321, 9)) >Temporal.PlainYearMonth.from : Symbol(Temporal.PlainYearMonthConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.PlainYearMonth : Symbol(Temporal.PlainYearMonth, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -4989,7 +4980,7 @@ >from : Symbol(Temporal.PlainYearMonthConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) const three = Temporal.PlainYearMonth.from("1930-02"); ->three : Symbol(three, Decl(temporal.ts, 1323, 9)) +>three : Symbol(three, Decl(temporal.ts, 1322, 9)) >Temporal.PlainYearMonth.from : Symbol(Temporal.PlainYearMonthConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.PlainYearMonth : Symbol(Temporal.PlainYearMonth, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -4997,11 +4988,11 @@ >from : Symbol(Temporal.PlainYearMonthConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) const sorted = [one, two, three].sort(Temporal.PlainYearMonth.compare); ->sorted : Symbol(sorted, Decl(temporal.ts, 1324, 9)) +>sorted : Symbol(sorted, Decl(temporal.ts, 1323, 9)) >[one, two, three].sort : Symbol(Array.sort, Decl(lib.es5.d.ts, --, --)) ->one : Symbol(one, Decl(temporal.ts, 1321, 9)) ->two : Symbol(two, Decl(temporal.ts, 1322, 9)) ->three : Symbol(three, Decl(temporal.ts, 1323, 9)) +>one : Symbol(one, Decl(temporal.ts, 1320, 9)) +>two : Symbol(two, Decl(temporal.ts, 1321, 9)) +>three : Symbol(three, Decl(temporal.ts, 1322, 9)) >sort : Symbol(Array.sort, Decl(lib.es5.d.ts, --, --)) >Temporal.PlainYearMonth.compare : Symbol(Temporal.PlainYearMonthConstructor.compare, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.PlainYearMonth : Symbol(Temporal.PlainYearMonth, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) @@ -5011,18 +5002,18 @@ sorted.join(" "); // => '1930-02 2006-08 2015-07' >sorted.join : Symbol(Array.join, Decl(lib.es5.d.ts, --, --)) ->sorted : Symbol(sorted, Decl(temporal.ts, 1324, 9)) +>sorted : Symbol(sorted, Decl(temporal.ts, 1323, 9)) >join : Symbol(Array.join, Decl(lib.es5.d.ts, --, --)) } { let ym: Temporal.PlainYearMonth; ->ym : Symbol(ym, Decl(temporal.ts, 1329, 7)) +>ym : Symbol(ym, Decl(temporal.ts, 1328, 7)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) >PlainYearMonth : Symbol(Temporal.PlainYearMonth, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) ym = Temporal.PlainYearMonth.from("2019-06"); ->ym : Symbol(ym, Decl(temporal.ts, 1329, 7)) +>ym : Symbol(ym, Decl(temporal.ts, 1328, 7)) >Temporal.PlainYearMonth.from : Symbol(Temporal.PlainYearMonthConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.PlainYearMonth : Symbol(Temporal.PlainYearMonth, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -5031,21 +5022,21 @@ ym.year; // => 2019 >ym.year : Symbol(Temporal.PlainYearMonth.year, Decl(lib.esnext.temporal.d.ts, --, --)) ->ym : Symbol(ym, Decl(temporal.ts, 1329, 7)) +>ym : Symbol(ym, Decl(temporal.ts, 1328, 7)) >year : Symbol(Temporal.PlainYearMonth.year, Decl(lib.esnext.temporal.d.ts, --, --)) ym.month; // => 6 >ym.month : Symbol(Temporal.PlainYearMonth.month, Decl(lib.esnext.temporal.d.ts, --, --)) ->ym : Symbol(ym, Decl(temporal.ts, 1329, 7)) +>ym : Symbol(ym, Decl(temporal.ts, 1328, 7)) >month : Symbol(Temporal.PlainYearMonth.month, Decl(lib.esnext.temporal.d.ts, --, --)) ym.monthCode; // => 'M06' >ym.monthCode : Symbol(Temporal.PlainYearMonth.monthCode, Decl(lib.esnext.temporal.d.ts, --, --)) ->ym : Symbol(ym, Decl(temporal.ts, 1329, 7)) +>ym : Symbol(ym, Decl(temporal.ts, 1328, 7)) >monthCode : Symbol(Temporal.PlainYearMonth.monthCode, Decl(lib.esnext.temporal.d.ts, --, --)) ym = Temporal.PlainYearMonth.from("2019-02-23[u-ca=hebrew]"); ->ym : Symbol(ym, Decl(temporal.ts, 1329, 7)) +>ym : Symbol(ym, Decl(temporal.ts, 1328, 7)) >Temporal.PlainYearMonth.from : Symbol(Temporal.PlainYearMonthConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.PlainYearMonth : Symbol(Temporal.PlainYearMonth, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -5054,23 +5045,23 @@ ym.year; // => 5779 >ym.year : Symbol(Temporal.PlainYearMonth.year, Decl(lib.esnext.temporal.d.ts, --, --)) ->ym : Symbol(ym, Decl(temporal.ts, 1329, 7)) +>ym : Symbol(ym, Decl(temporal.ts, 1328, 7)) >year : Symbol(Temporal.PlainYearMonth.year, Decl(lib.esnext.temporal.d.ts, --, --)) ym.month; // => 6 >ym.month : Symbol(Temporal.PlainYearMonth.month, Decl(lib.esnext.temporal.d.ts, --, --)) ->ym : Symbol(ym, Decl(temporal.ts, 1329, 7)) +>ym : Symbol(ym, Decl(temporal.ts, 1328, 7)) >month : Symbol(Temporal.PlainYearMonth.month, Decl(lib.esnext.temporal.d.ts, --, --)) ym.monthCode; // => 'M05L' >ym.monthCode : Symbol(Temporal.PlainYearMonth.monthCode, Decl(lib.esnext.temporal.d.ts, --, --)) ->ym : Symbol(ym, Decl(temporal.ts, 1329, 7)) +>ym : Symbol(ym, Decl(temporal.ts, 1328, 7)) >monthCode : Symbol(Temporal.PlainYearMonth.monthCode, Decl(lib.esnext.temporal.d.ts, --, --)) } { const ym = Temporal.PlainYearMonth.from("-000015-01-01[u-ca=gregory]"); ->ym : Symbol(ym, Decl(temporal.ts, 1343, 9)) +>ym : Symbol(ym, Decl(temporal.ts, 1342, 9)) >Temporal.PlainYearMonth.from : Symbol(Temporal.PlainYearMonthConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.PlainYearMonth : Symbol(Temporal.PlainYearMonth, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -5079,19 +5070,19 @@ ym.era; >ym.era : Symbol(Temporal.PlainYearMonth.era, Decl(lib.esnext.temporal.d.ts, --, --)) ->ym : Symbol(ym, Decl(temporal.ts, 1343, 9)) +>ym : Symbol(ym, Decl(temporal.ts, 1342, 9)) >era : Symbol(Temporal.PlainYearMonth.era, Decl(lib.esnext.temporal.d.ts, --, --)) // => 'bce' ym.eraYear; >ym.eraYear : Symbol(Temporal.PlainYearMonth.eraYear, Decl(lib.esnext.temporal.d.ts, --, --)) ->ym : Symbol(ym, Decl(temporal.ts, 1343, 9)) +>ym : Symbol(ym, Decl(temporal.ts, 1342, 9)) >eraYear : Symbol(Temporal.PlainYearMonth.eraYear, Decl(lib.esnext.temporal.d.ts, --, --)) // => 16 ym.year; >ym.year : Symbol(Temporal.PlainYearMonth.year, Decl(lib.esnext.temporal.d.ts, --, --)) ->ym : Symbol(ym, Decl(temporal.ts, 1343, 9)) +>ym : Symbol(ym, Decl(temporal.ts, 1342, 9)) >year : Symbol(Temporal.PlainYearMonth.year, Decl(lib.esnext.temporal.d.ts, --, --)) // => -15 @@ -5100,121 +5091,121 @@ { // Attempt to write some mnemonic poetry const monthsByDays: Record = {}; ->monthsByDays : Symbol(monthsByDays, Decl(temporal.ts, 1354, 9)) +>monthsByDays : Symbol(monthsByDays, Decl(temporal.ts, 1353, 9)) >Record : Symbol(Record, Decl(lib.es5.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) >PlainYearMonth : Symbol(Temporal.PlainYearMonth, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) for (let month = 1; month <= 12; month++) { ->month : Symbol(month, Decl(temporal.ts, 1355, 12)) ->month : Symbol(month, Decl(temporal.ts, 1355, 12)) ->month : Symbol(month, Decl(temporal.ts, 1355, 12)) +>month : Symbol(month, Decl(temporal.ts, 1354, 12)) +>month : Symbol(month, Decl(temporal.ts, 1354, 12)) +>month : Symbol(month, Decl(temporal.ts, 1354, 12)) const ym = Temporal.PlainYearMonth.from({ year: 2020, calendar: "iso8601", month }); ->ym : Symbol(ym, Decl(temporal.ts, 1356, 13)) +>ym : Symbol(ym, Decl(temporal.ts, 1355, 13)) >Temporal.PlainYearMonth.from : Symbol(Temporal.PlainYearMonthConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.PlainYearMonth : Symbol(Temporal.PlainYearMonth, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) >PlainYearMonth : Symbol(Temporal.PlainYearMonth, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >from : Symbol(Temporal.PlainYearMonthConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) ->year : Symbol(year, Decl(temporal.ts, 1356, 49)) ->calendar : Symbol(calendar, Decl(temporal.ts, 1356, 61)) ->month : Symbol(month, Decl(temporal.ts, 1356, 82)) +>year : Symbol(year, Decl(temporal.ts, 1355, 49)) +>calendar : Symbol(calendar, Decl(temporal.ts, 1355, 61)) +>month : Symbol(month, Decl(temporal.ts, 1355, 82)) monthsByDays[ym.daysInMonth] = (monthsByDays[ym.daysInMonth] || []).concat(ym); ->monthsByDays : Symbol(monthsByDays, Decl(temporal.ts, 1354, 9)) +>monthsByDays : Symbol(monthsByDays, Decl(temporal.ts, 1353, 9)) >ym.daysInMonth : Symbol(Temporal.PlainYearMonth.daysInMonth, Decl(lib.esnext.temporal.d.ts, --, --)) ->ym : Symbol(ym, Decl(temporal.ts, 1356, 13)) +>ym : Symbol(ym, Decl(temporal.ts, 1355, 13)) >daysInMonth : Symbol(Temporal.PlainYearMonth.daysInMonth, Decl(lib.esnext.temporal.d.ts, --, --)) >(monthsByDays[ym.daysInMonth] || []).concat : Symbol(Array.concat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) ->monthsByDays : Symbol(monthsByDays, Decl(temporal.ts, 1354, 9)) +>monthsByDays : Symbol(monthsByDays, Decl(temporal.ts, 1353, 9)) >ym.daysInMonth : Symbol(Temporal.PlainYearMonth.daysInMonth, Decl(lib.esnext.temporal.d.ts, --, --)) ->ym : Symbol(ym, Decl(temporal.ts, 1356, 13)) +>ym : Symbol(ym, Decl(temporal.ts, 1355, 13)) >daysInMonth : Symbol(Temporal.PlainYearMonth.daysInMonth, Decl(lib.esnext.temporal.d.ts, --, --)) >concat : Symbol(Array.concat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) ->ym : Symbol(ym, Decl(temporal.ts, 1356, 13)) +>ym : Symbol(ym, Decl(temporal.ts, 1355, 13)) } const strings = monthsByDays[30].map(ym => ym.toLocaleString("en", { month: "long", calendar: "iso8601" })); ->strings : Symbol(strings, Decl(temporal.ts, 1360, 9)) +>strings : Symbol(strings, Decl(temporal.ts, 1359, 9)) >monthsByDays[30].map : Symbol(Array.map, Decl(lib.es5.d.ts, --, --)) ->monthsByDays : Symbol(monthsByDays, Decl(temporal.ts, 1354, 9)) +>monthsByDays : Symbol(monthsByDays, Decl(temporal.ts, 1353, 9)) >map : Symbol(Array.map, Decl(lib.es5.d.ts, --, --)) ->ym : Symbol(ym, Decl(temporal.ts, 1360, 41)) +>ym : Symbol(ym, Decl(temporal.ts, 1359, 41)) >ym.toLocaleString : Symbol(Temporal.PlainYearMonth.toLocaleString, Decl(lib.esnext.temporal.d.ts, --, --)) ->ym : Symbol(ym, Decl(temporal.ts, 1360, 41)) +>ym : Symbol(ym, Decl(temporal.ts, 1359, 41)) >toLocaleString : Symbol(Temporal.PlainYearMonth.toLocaleString, Decl(lib.esnext.temporal.d.ts, --, --)) ->month : Symbol(month, Decl(temporal.ts, 1360, 72)) ->calendar : Symbol(calendar, Decl(temporal.ts, 1360, 87)) +>month : Symbol(month, Decl(temporal.ts, 1359, 72)) +>calendar : Symbol(calendar, Decl(temporal.ts, 1359, 87)) // Shuffle to improve poem as determined empirically strings.unshift(strings.pop()!); >strings.unshift : Symbol(Array.unshift, Decl(lib.es5.d.ts, --, --)) ->strings : Symbol(strings, Decl(temporal.ts, 1360, 9)) +>strings : Symbol(strings, Decl(temporal.ts, 1359, 9)) >unshift : Symbol(Array.unshift, Decl(lib.es5.d.ts, --, --)) >strings.pop : Symbol(Array.pop, Decl(lib.es5.d.ts, --, --)) ->strings : Symbol(strings, Decl(temporal.ts, 1360, 9)) +>strings : Symbol(strings, Decl(temporal.ts, 1359, 9)) >pop : Symbol(Array.pop, Decl(lib.es5.d.ts, --, --)) const format = new Intl.ListFormat("en"); ->format : Symbol(format, Decl(temporal.ts, 1363, 9)) +>format : Symbol(format, Decl(temporal.ts, 1362, 9)) >Intl.ListFormat : Symbol(Intl.ListFormat, Decl(lib.es2021.intl.d.ts, --, --), Decl(lib.es2021.intl.d.ts, --, --)) >Intl : Symbol(Intl, Decl(lib.es5.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2020.intl.d.ts, --, --), Decl(lib.es2021.intl.d.ts, --, --), Decl(lib.es2025.intl.d.ts, --, --) ... and 1 more) >ListFormat : Symbol(Intl.ListFormat, Decl(lib.es2021.intl.d.ts, --, --), Decl(lib.es2021.intl.d.ts, --, --)) const poem = `Thirty days hath ${format.format(strings)}`; ->poem : Symbol(poem, Decl(temporal.ts, 1364, 9)) +>poem : Symbol(poem, Decl(temporal.ts, 1363, 9)) >format.format : Symbol(Intl.ListFormat.format, Decl(lib.es2021.intl.d.ts, --, --)) ->format : Symbol(format, Decl(temporal.ts, 1363, 9)) +>format : Symbol(format, Decl(temporal.ts, 1362, 9)) >format : Symbol(Intl.ListFormat.format, Decl(lib.es2021.intl.d.ts, --, --)) ->strings : Symbol(strings, Decl(temporal.ts, 1360, 9)) +>strings : Symbol(strings, Decl(temporal.ts, 1359, 9)) console.log(poem); >console.log : Symbol(Console.log, Decl(lib.dom.d.ts, --, --)) >console : Symbol(console, Decl(lib.dom.d.ts, --, --)) >log : Symbol(Console.log, Decl(lib.dom.d.ts, --, --)) ->poem : Symbol(poem, Decl(temporal.ts, 1364, 9)) +>poem : Symbol(poem, Decl(temporal.ts, 1363, 9)) } { const ym = Temporal.PlainYearMonth.from({ year: 2019, month: 6, calendar: "iso8601" }); ->ym : Symbol(ym, Decl(temporal.ts, 1370, 9)) +>ym : Symbol(ym, Decl(temporal.ts, 1369, 9)) >Temporal.PlainYearMonth.from : Symbol(Temporal.PlainYearMonthConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.PlainYearMonth : Symbol(Temporal.PlainYearMonth, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) >PlainYearMonth : Symbol(Temporal.PlainYearMonth, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >from : Symbol(Temporal.PlainYearMonthConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) ->year : Symbol(year, Decl(temporal.ts, 1370, 45)) ->month : Symbol(month, Decl(temporal.ts, 1370, 57)) ->calendar : Symbol(calendar, Decl(temporal.ts, 1370, 67)) +>year : Symbol(year, Decl(temporal.ts, 1369, 45)) +>month : Symbol(month, Decl(temporal.ts, 1369, 57)) +>calendar : Symbol(calendar, Decl(temporal.ts, 1369, 67)) const percent = ym.daysInMonth / ym.daysInYear; ->percent : Symbol(percent, Decl(temporal.ts, 1371, 9)) +>percent : Symbol(percent, Decl(temporal.ts, 1370, 9)) >ym.daysInMonth : Symbol(Temporal.PlainYearMonth.daysInMonth, Decl(lib.esnext.temporal.d.ts, --, --)) ->ym : Symbol(ym, Decl(temporal.ts, 1370, 9)) +>ym : Symbol(ym, Decl(temporal.ts, 1369, 9)) >daysInMonth : Symbol(Temporal.PlainYearMonth.daysInMonth, Decl(lib.esnext.temporal.d.ts, --, --)) >ym.daysInYear : Symbol(Temporal.PlainYearMonth.daysInYear, Decl(lib.esnext.temporal.d.ts, --, --)) ->ym : Symbol(ym, Decl(temporal.ts, 1370, 9)) +>ym : Symbol(ym, Decl(temporal.ts, 1369, 9)) >daysInYear : Symbol(Temporal.PlainYearMonth.daysInYear, Decl(lib.esnext.temporal.d.ts, --, --)) `${ym.toLocaleString("en", { month: "long", year: "numeric", calendar: "iso8601" })} was ${percent.toLocaleString("en", { style: "percent" })} of the year!`; >ym.toLocaleString : Symbol(Temporal.PlainYearMonth.toLocaleString, Decl(lib.esnext.temporal.d.ts, --, --)) ->ym : Symbol(ym, Decl(temporal.ts, 1370, 9)) +>ym : Symbol(ym, Decl(temporal.ts, 1369, 9)) >toLocaleString : Symbol(Temporal.PlainYearMonth.toLocaleString, Decl(lib.esnext.temporal.d.ts, --, --)) ->month : Symbol(month, Decl(temporal.ts, 1372, 32)) ->year : Symbol(year, Decl(temporal.ts, 1372, 47)) ->calendar : Symbol(calendar, Decl(temporal.ts, 1372, 64)) +>month : Symbol(month, Decl(temporal.ts, 1371, 32)) +>year : Symbol(year, Decl(temporal.ts, 1371, 47)) +>calendar : Symbol(calendar, Decl(temporal.ts, 1371, 64)) >percent.toLocaleString : Symbol(Number.toLocaleString, Decl(lib.es5.d.ts, --, --)) ->percent : Symbol(percent, Decl(temporal.ts, 1371, 9)) +>percent : Symbol(percent, Decl(temporal.ts, 1370, 9)) >toLocaleString : Symbol(Number.toLocaleString, Decl(lib.es5.d.ts, --, --)) ->style : Symbol(style, Decl(temporal.ts, 1372, 125)) +>style : Symbol(style, Decl(temporal.ts, 1371, 125)) // => 'June 2019 was 8% of the year!' } { const ym = Temporal.PlainYearMonth.from("1900-01"); ->ym : Symbol(ym, Decl(temporal.ts, 1377, 9)) +>ym : Symbol(ym, Decl(temporal.ts, 1376, 9)) >Temporal.PlainYearMonth.from : Symbol(Temporal.PlainYearMonthConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.PlainYearMonth : Symbol(Temporal.PlainYearMonth, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -5223,14 +5214,14 @@ ym.monthsInYear; // => 12 >ym.monthsInYear : Symbol(Temporal.PlainYearMonth.monthsInYear, Decl(lib.esnext.temporal.d.ts, --, --)) ->ym : Symbol(ym, Decl(temporal.ts, 1377, 9)) +>ym : Symbol(ym, Decl(temporal.ts, 1376, 9)) >monthsInYear : Symbol(Temporal.PlainYearMonth.monthsInYear, Decl(lib.esnext.temporal.d.ts, --, --)) } { // Was June 2019 in a leap year? const ym = Temporal.PlainYearMonth.from("2019-06"); ->ym : Symbol(ym, Decl(temporal.ts, 1383, 9)) +>ym : Symbol(ym, Decl(temporal.ts, 1382, 9)) >Temporal.PlainYearMonth.from : Symbol(Temporal.PlainYearMonthConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.PlainYearMonth : Symbol(Temporal.PlainYearMonth, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -5239,22 +5230,22 @@ ym.inLeapYear; // => false >ym.inLeapYear : Symbol(Temporal.PlainYearMonth.inLeapYear, Decl(lib.esnext.temporal.d.ts, --, --)) ->ym : Symbol(ym, Decl(temporal.ts, 1383, 9)) +>ym : Symbol(ym, Decl(temporal.ts, 1382, 9)) >inLeapYear : Symbol(Temporal.PlainYearMonth.inLeapYear, Decl(lib.esnext.temporal.d.ts, --, --)) // Is 2100 a leap year? (no, because it's divisible by 100 and not 400) ym.with({ year: 2100 }).inLeapYear; // => false >ym.with({ year: 2100 }).inLeapYear : Symbol(Temporal.PlainYearMonth.inLeapYear, Decl(lib.esnext.temporal.d.ts, --, --)) >ym.with : Symbol(Temporal.PlainYearMonth.with, Decl(lib.esnext.temporal.d.ts, --, --)) ->ym : Symbol(ym, Decl(temporal.ts, 1383, 9)) +>ym : Symbol(ym, Decl(temporal.ts, 1382, 9)) >with : Symbol(Temporal.PlainYearMonth.with, Decl(lib.esnext.temporal.d.ts, --, --)) ->year : Symbol(year, Decl(temporal.ts, 1386, 13)) +>year : Symbol(year, Decl(temporal.ts, 1385, 13)) >inLeapYear : Symbol(Temporal.PlainYearMonth.inLeapYear, Decl(lib.esnext.temporal.d.ts, --, --)) } { const ym = Temporal.PlainYearMonth.from("2019-06"); ->ym : Symbol(ym, Decl(temporal.ts, 1390, 9)) +>ym : Symbol(ym, Decl(temporal.ts, 1389, 9)) >Temporal.PlainYearMonth.from : Symbol(Temporal.PlainYearMonthConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.PlainYearMonth : Symbol(Temporal.PlainYearMonth, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -5264,14 +5255,14 @@ // Get December of that year ym.with({ month: 12 }); // => 2019-12 >ym.with : Symbol(Temporal.PlainYearMonth.with, Decl(lib.esnext.temporal.d.ts, --, --)) ->ym : Symbol(ym, Decl(temporal.ts, 1390, 9)) +>ym : Symbol(ym, Decl(temporal.ts, 1389, 9)) >with : Symbol(Temporal.PlainYearMonth.with, Decl(lib.esnext.temporal.d.ts, --, --)) ->month : Symbol(month, Decl(temporal.ts, 1392, 13)) +>month : Symbol(month, Decl(temporal.ts, 1391, 13)) } { const ym = Temporal.PlainYearMonth.from("2019-06"); ->ym : Symbol(ym, Decl(temporal.ts, 1396, 9)) +>ym : Symbol(ym, Decl(temporal.ts, 1395, 9)) >Temporal.PlainYearMonth.from : Symbol(Temporal.PlainYearMonthConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.PlainYearMonth : Symbol(Temporal.PlainYearMonth, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -5280,15 +5271,15 @@ ym.add({ years: 20, months: 4 }); // => 2039-10 >ym.add : Symbol(Temporal.PlainYearMonth.add, Decl(lib.esnext.temporal.d.ts, --, --)) ->ym : Symbol(ym, Decl(temporal.ts, 1396, 9)) +>ym : Symbol(ym, Decl(temporal.ts, 1395, 9)) >add : Symbol(Temporal.PlainYearMonth.add, Decl(lib.esnext.temporal.d.ts, --, --)) ->years : Symbol(years, Decl(temporal.ts, 1397, 12)) ->months : Symbol(months, Decl(temporal.ts, 1397, 23)) +>years : Symbol(years, Decl(temporal.ts, 1396, 12)) +>months : Symbol(months, Decl(temporal.ts, 1396, 23)) } { const ym = Temporal.PlainYearMonth.from("2019-06"); ->ym : Symbol(ym, Decl(temporal.ts, 1401, 9)) +>ym : Symbol(ym, Decl(temporal.ts, 1400, 9)) >Temporal.PlainYearMonth.from : Symbol(Temporal.PlainYearMonthConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.PlainYearMonth : Symbol(Temporal.PlainYearMonth, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -5297,15 +5288,15 @@ ym.subtract({ years: 20, months: 4 }); // => 1999-02 >ym.subtract : Symbol(Temporal.PlainYearMonth.subtract, Decl(lib.esnext.temporal.d.ts, --, --)) ->ym : Symbol(ym, Decl(temporal.ts, 1401, 9)) +>ym : Symbol(ym, Decl(temporal.ts, 1400, 9)) >subtract : Symbol(Temporal.PlainYearMonth.subtract, Decl(lib.esnext.temporal.d.ts, --, --)) ->years : Symbol(years, Decl(temporal.ts, 1402, 17)) ->months : Symbol(months, Decl(temporal.ts, 1402, 28)) +>years : Symbol(years, Decl(temporal.ts, 1401, 17)) +>months : Symbol(months, Decl(temporal.ts, 1401, 28)) } { const ym = Temporal.PlainYearMonth.from("2006-08"); ->ym : Symbol(ym, Decl(temporal.ts, 1406, 9)) +>ym : Symbol(ym, Decl(temporal.ts, 1405, 9)) >Temporal.PlainYearMonth.from : Symbol(Temporal.PlainYearMonthConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.PlainYearMonth : Symbol(Temporal.PlainYearMonth, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -5313,7 +5304,7 @@ >from : Symbol(Temporal.PlainYearMonthConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) const other = Temporal.PlainYearMonth.from("2019-06"); ->other : Symbol(other, Decl(temporal.ts, 1407, 9)) +>other : Symbol(other, Decl(temporal.ts, 1406, 9)) >Temporal.PlainYearMonth.from : Symbol(Temporal.PlainYearMonthConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.PlainYearMonth : Symbol(Temporal.PlainYearMonth, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -5322,23 +5313,23 @@ ym.until(other); // => P12Y10M >ym.until : Symbol(Temporal.PlainYearMonth.until, Decl(lib.esnext.temporal.d.ts, --, --)) ->ym : Symbol(ym, Decl(temporal.ts, 1406, 9)) +>ym : Symbol(ym, Decl(temporal.ts, 1405, 9)) >until : Symbol(Temporal.PlainYearMonth.until, Decl(lib.esnext.temporal.d.ts, --, --)) ->other : Symbol(other, Decl(temporal.ts, 1407, 9)) +>other : Symbol(other, Decl(temporal.ts, 1406, 9)) ym.until(other, { largestUnit: "month" }); // => P154M >ym.until : Symbol(Temporal.PlainYearMonth.until, Decl(lib.esnext.temporal.d.ts, --, --)) ->ym : Symbol(ym, Decl(temporal.ts, 1406, 9)) +>ym : Symbol(ym, Decl(temporal.ts, 1405, 9)) >until : Symbol(Temporal.PlainYearMonth.until, Decl(lib.esnext.temporal.d.ts, --, --)) ->other : Symbol(other, Decl(temporal.ts, 1407, 9)) ->largestUnit : Symbol(largestUnit, Decl(temporal.ts, 1409, 21)) +>other : Symbol(other, Decl(temporal.ts, 1406, 9)) +>largestUnit : Symbol(largestUnit, Decl(temporal.ts, 1408, 21)) other.until(ym, { largestUnit: "month" }); // => -P154M >other.until : Symbol(Temporal.PlainYearMonth.until, Decl(lib.esnext.temporal.d.ts, --, --)) ->other : Symbol(other, Decl(temporal.ts, 1407, 9)) +>other : Symbol(other, Decl(temporal.ts, 1406, 9)) >until : Symbol(Temporal.PlainYearMonth.until, Decl(lib.esnext.temporal.d.ts, --, --)) ->ym : Symbol(ym, Decl(temporal.ts, 1406, 9)) ->largestUnit : Symbol(largestUnit, Decl(temporal.ts, 1410, 21)) +>ym : Symbol(ym, Decl(temporal.ts, 1405, 9)) +>largestUnit : Symbol(largestUnit, Decl(temporal.ts, 1409, 21)) // If you really need to calculate the difference between two YearMonths // in days, you can eliminate the ambiguity by explicitly choosing the @@ -5348,20 +5339,20 @@ ym.toPlainDate({ day: 1 }).until(other.toPlainDate({ day: 1 }), { largestUnit: "day" }); // => P4687D >ym.toPlainDate({ day: 1 }).until : Symbol(Temporal.PlainDate.until, Decl(lib.esnext.temporal.d.ts, --, --)) >ym.toPlainDate : Symbol(Temporal.PlainYearMonth.toPlainDate, Decl(lib.esnext.temporal.d.ts, --, --)) ->ym : Symbol(ym, Decl(temporal.ts, 1406, 9)) +>ym : Symbol(ym, Decl(temporal.ts, 1405, 9)) >toPlainDate : Symbol(Temporal.PlainYearMonth.toPlainDate, Decl(lib.esnext.temporal.d.ts, --, --)) ->day : Symbol(day, Decl(temporal.ts, 1417, 20)) +>day : Symbol(day, Decl(temporal.ts, 1416, 20)) >until : Symbol(Temporal.PlainDate.until, Decl(lib.esnext.temporal.d.ts, --, --)) >other.toPlainDate : Symbol(Temporal.PlainYearMonth.toPlainDate, Decl(lib.esnext.temporal.d.ts, --, --)) ->other : Symbol(other, Decl(temporal.ts, 1407, 9)) +>other : Symbol(other, Decl(temporal.ts, 1406, 9)) >toPlainDate : Symbol(Temporal.PlainYearMonth.toPlainDate, Decl(lib.esnext.temporal.d.ts, --, --)) ->day : Symbol(day, Decl(temporal.ts, 1417, 56)) ->largestUnit : Symbol(largestUnit, Decl(temporal.ts, 1417, 69)) +>day : Symbol(day, Decl(temporal.ts, 1416, 56)) +>largestUnit : Symbol(largestUnit, Decl(temporal.ts, 1416, 69)) } { const ym = Temporal.PlainYearMonth.from("2019-06"); ->ym : Symbol(ym, Decl(temporal.ts, 1421, 9)) +>ym : Symbol(ym, Decl(temporal.ts, 1420, 9)) >Temporal.PlainYearMonth.from : Symbol(Temporal.PlainYearMonthConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.PlainYearMonth : Symbol(Temporal.PlainYearMonth, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -5369,7 +5360,7 @@ >from : Symbol(Temporal.PlainYearMonthConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) const other = Temporal.PlainYearMonth.from("2006-08"); ->other : Symbol(other, Decl(temporal.ts, 1422, 9)) +>other : Symbol(other, Decl(temporal.ts, 1421, 9)) >Temporal.PlainYearMonth.from : Symbol(Temporal.PlainYearMonthConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.PlainYearMonth : Symbol(Temporal.PlainYearMonth, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -5378,14 +5369,14 @@ ym.since(other); // => P12Y10M >ym.since : Symbol(Temporal.PlainYearMonth.since, Decl(lib.esnext.temporal.d.ts, --, --)) ->ym : Symbol(ym, Decl(temporal.ts, 1421, 9)) +>ym : Symbol(ym, Decl(temporal.ts, 1420, 9)) >since : Symbol(Temporal.PlainYearMonth.since, Decl(lib.esnext.temporal.d.ts, --, --)) ->other : Symbol(other, Decl(temporal.ts, 1422, 9)) +>other : Symbol(other, Decl(temporal.ts, 1421, 9)) } { const ym = Temporal.PlainYearMonth.from("2019-06"); ->ym : Symbol(ym, Decl(temporal.ts, 1427, 9)) +>ym : Symbol(ym, Decl(temporal.ts, 1426, 9)) >Temporal.PlainYearMonth.from : Symbol(Temporal.PlainYearMonthConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.PlainYearMonth : Symbol(Temporal.PlainYearMonth, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -5393,7 +5384,7 @@ >from : Symbol(Temporal.PlainYearMonthConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) const other = Temporal.PlainYearMonth.from("2006-08"); ->other : Symbol(other, Decl(temporal.ts, 1428, 9)) +>other : Symbol(other, Decl(temporal.ts, 1427, 9)) >Temporal.PlainYearMonth.from : Symbol(Temporal.PlainYearMonthConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.PlainYearMonth : Symbol(Temporal.PlainYearMonth, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -5402,20 +5393,20 @@ ym.equals(other); // => false >ym.equals : Symbol(Temporal.PlainYearMonth.equals, Decl(lib.esnext.temporal.d.ts, --, --)) ->ym : Symbol(ym, Decl(temporal.ts, 1427, 9)) +>ym : Symbol(ym, Decl(temporal.ts, 1426, 9)) >equals : Symbol(Temporal.PlainYearMonth.equals, Decl(lib.esnext.temporal.d.ts, --, --)) ->other : Symbol(other, Decl(temporal.ts, 1428, 9)) +>other : Symbol(other, Decl(temporal.ts, 1427, 9)) ym.equals(ym); // => true >ym.equals : Symbol(Temporal.PlainYearMonth.equals, Decl(lib.esnext.temporal.d.ts, --, --)) ->ym : Symbol(ym, Decl(temporal.ts, 1427, 9)) +>ym : Symbol(ym, Decl(temporal.ts, 1426, 9)) >equals : Symbol(Temporal.PlainYearMonth.equals, Decl(lib.esnext.temporal.d.ts, --, --)) ->ym : Symbol(ym, Decl(temporal.ts, 1427, 9)) +>ym : Symbol(ym, Decl(temporal.ts, 1426, 9)) } { const ym = Temporal.PlainYearMonth.from("2019-06"); ->ym : Symbol(ym, Decl(temporal.ts, 1434, 9)) +>ym : Symbol(ym, Decl(temporal.ts, 1433, 9)) >Temporal.PlainYearMonth.from : Symbol(Temporal.PlainYearMonthConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.PlainYearMonth : Symbol(Temporal.PlainYearMonth, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -5424,13 +5415,13 @@ ym.toString(); // => '2019-06' >ym.toString : Symbol(Temporal.PlainYearMonth.toString, Decl(lib.esnext.temporal.d.ts, --, --)) ->ym : Symbol(ym, Decl(temporal.ts, 1434, 9)) +>ym : Symbol(ym, Decl(temporal.ts, 1433, 9)) >toString : Symbol(Temporal.PlainYearMonth.toString, Decl(lib.esnext.temporal.d.ts, --, --)) } { const { calendar } = new Intl.DateTimeFormat().resolvedOptions(); ->calendar : Symbol(calendar, Decl(temporal.ts, 1439, 11)) +>calendar : Symbol(calendar, Decl(temporal.ts, 1438, 11)) >new Intl.DateTimeFormat().resolvedOptions : Symbol(Intl.DateTimeFormat.resolvedOptions, Decl(lib.es5.d.ts, --, --)) >Intl.DateTimeFormat : Symbol(Intl.DateTimeFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2021.intl.d.ts, --, --), Decl(lib.esnext.intl.d.ts, --, --)) >Intl : Symbol(Intl, Decl(lib.es5.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2020.intl.d.ts, --, --), Decl(lib.es2021.intl.d.ts, --, --), Decl(lib.es2025.intl.d.ts, --, --) ... and 1 more) @@ -5438,53 +5429,53 @@ >resolvedOptions : Symbol(Intl.DateTimeFormat.resolvedOptions, Decl(lib.es5.d.ts, --, --)) const ym = Temporal.PlainYearMonth.from({ year: 2019, month: 6, calendar }); ->ym : Symbol(ym, Decl(temporal.ts, 1440, 9)) +>ym : Symbol(ym, Decl(temporal.ts, 1439, 9)) >Temporal.PlainYearMonth.from : Symbol(Temporal.PlainYearMonthConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.PlainYearMonth : Symbol(Temporal.PlainYearMonth, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) >PlainYearMonth : Symbol(Temporal.PlainYearMonth, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >from : Symbol(Temporal.PlainYearMonthConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) ->year : Symbol(year, Decl(temporal.ts, 1440, 45)) ->month : Symbol(month, Decl(temporal.ts, 1440, 57)) ->calendar : Symbol(calendar, Decl(temporal.ts, 1440, 67)) +>year : Symbol(year, Decl(temporal.ts, 1439, 45)) +>month : Symbol(month, Decl(temporal.ts, 1439, 57)) +>calendar : Symbol(calendar, Decl(temporal.ts, 1439, 67)) ym.toLocaleString(); // example output: '6/2019' >ym.toLocaleString : Symbol(Temporal.PlainYearMonth.toLocaleString, Decl(lib.esnext.temporal.d.ts, --, --)) ->ym : Symbol(ym, Decl(temporal.ts, 1440, 9)) +>ym : Symbol(ym, Decl(temporal.ts, 1439, 9)) >toLocaleString : Symbol(Temporal.PlainYearMonth.toLocaleString, Decl(lib.esnext.temporal.d.ts, --, --)) // Same as above, but explicitly specifying the calendar: ym.toLocaleString(undefined, { calendar }); >ym.toLocaleString : Symbol(Temporal.PlainYearMonth.toLocaleString, Decl(lib.esnext.temporal.d.ts, --, --)) ->ym : Symbol(ym, Decl(temporal.ts, 1440, 9)) +>ym : Symbol(ym, Decl(temporal.ts, 1439, 9)) >toLocaleString : Symbol(Temporal.PlainYearMonth.toLocaleString, Decl(lib.esnext.temporal.d.ts, --, --)) >undefined : Symbol(undefined) ->calendar : Symbol(calendar, Decl(temporal.ts, 1443, 34)) +>calendar : Symbol(calendar, Decl(temporal.ts, 1442, 34)) ym.toLocaleString("de-DE", { calendar }); // example output: '6.2019' >ym.toLocaleString : Symbol(Temporal.PlainYearMonth.toLocaleString, Decl(lib.esnext.temporal.d.ts, --, --)) ->ym : Symbol(ym, Decl(temporal.ts, 1440, 9)) +>ym : Symbol(ym, Decl(temporal.ts, 1439, 9)) >toLocaleString : Symbol(Temporal.PlainYearMonth.toLocaleString, Decl(lib.esnext.temporal.d.ts, --, --)) ->calendar : Symbol(calendar, Decl(temporal.ts, 1445, 32)) +>calendar : Symbol(calendar, Decl(temporal.ts, 1444, 32)) ym.toLocaleString("de-DE", { month: "long", year: "numeric", calendar }); // => 'Juni 2019' >ym.toLocaleString : Symbol(Temporal.PlainYearMonth.toLocaleString, Decl(lib.esnext.temporal.d.ts, --, --)) ->ym : Symbol(ym, Decl(temporal.ts, 1440, 9)) +>ym : Symbol(ym, Decl(temporal.ts, 1439, 9)) >toLocaleString : Symbol(Temporal.PlainYearMonth.toLocaleString, Decl(lib.esnext.temporal.d.ts, --, --)) ->month : Symbol(month, Decl(temporal.ts, 1446, 32)) ->year : Symbol(year, Decl(temporal.ts, 1446, 47)) ->calendar : Symbol(calendar, Decl(temporal.ts, 1446, 64)) +>month : Symbol(month, Decl(temporal.ts, 1445, 32)) +>year : Symbol(year, Decl(temporal.ts, 1445, 47)) +>calendar : Symbol(calendar, Decl(temporal.ts, 1445, 64)) ym.toLocaleString(`en-US-u-nu-fullwide-ca-${calendar}`); // => '6/2019' >ym.toLocaleString : Symbol(Temporal.PlainYearMonth.toLocaleString, Decl(lib.esnext.temporal.d.ts, --, --)) ->ym : Symbol(ym, Decl(temporal.ts, 1440, 9)) +>ym : Symbol(ym, Decl(temporal.ts, 1439, 9)) >toLocaleString : Symbol(Temporal.PlainYearMonth.toLocaleString, Decl(lib.esnext.temporal.d.ts, --, --)) ->calendar : Symbol(calendar, Decl(temporal.ts, 1439, 11)) +>calendar : Symbol(calendar, Decl(temporal.ts, 1438, 11)) } { const ym = Temporal.PlainYearMonth.from("2019-06"); ->ym : Symbol(ym, Decl(temporal.ts, 1451, 9)) +>ym : Symbol(ym, Decl(temporal.ts, 1450, 9)) >Temporal.PlainYearMonth.from : Symbol(Temporal.PlainYearMonthConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.PlainYearMonth : Symbol(Temporal.PlainYearMonth, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -5493,27 +5484,27 @@ ym.toPlainDate({ day: 24 }); // => 2019-06-24 >ym.toPlainDate : Symbol(Temporal.PlainYearMonth.toPlainDate, Decl(lib.esnext.temporal.d.ts, --, --)) ->ym : Symbol(ym, Decl(temporal.ts, 1451, 9)) +>ym : Symbol(ym, Decl(temporal.ts, 1450, 9)) >toPlainDate : Symbol(Temporal.PlainYearMonth.toPlainDate, Decl(lib.esnext.temporal.d.ts, --, --)) ->day : Symbol(day, Decl(temporal.ts, 1452, 20)) +>day : Symbol(day, Decl(temporal.ts, 1451, 20)) } { let md: Temporal.PlainMonthDay; ->md : Symbol(md, Decl(temporal.ts, 1456, 7)) +>md : Symbol(md, Decl(temporal.ts, 1455, 7)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) >PlainMonthDay : Symbol(Temporal.PlainMonthDay, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) // Pi day md = new Temporal.PlainMonthDay(3, 14); // => 03-14 ->md : Symbol(md, Decl(temporal.ts, 1456, 7)) +>md : Symbol(md, Decl(temporal.ts, 1455, 7)) >Temporal.PlainMonthDay : Symbol(Temporal.PlainMonthDay, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) >PlainMonthDay : Symbol(Temporal.PlainMonthDay, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) // Leap day md = new Temporal.PlainMonthDay(2, 29); // => 02-29 ->md : Symbol(md, Decl(temporal.ts, 1456, 7)) +>md : Symbol(md, Decl(temporal.ts, 1455, 7)) >Temporal.PlainMonthDay : Symbol(Temporal.PlainMonthDay, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) >PlainMonthDay : Symbol(Temporal.PlainMonthDay, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) @@ -5521,12 +5512,12 @@ { let md: Temporal.PlainMonthDay; ->md : Symbol(md, Decl(temporal.ts, 1465, 7)) +>md : Symbol(md, Decl(temporal.ts, 1464, 7)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) >PlainMonthDay : Symbol(Temporal.PlainMonthDay, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) md = Temporal.PlainMonthDay.from("08-24"); // => 08-24 ->md : Symbol(md, Decl(temporal.ts, 1465, 7)) +>md : Symbol(md, Decl(temporal.ts, 1464, 7)) >Temporal.PlainMonthDay.from : Symbol(Temporal.PlainMonthDayConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.PlainMonthDay : Symbol(Temporal.PlainMonthDay, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -5534,7 +5525,7 @@ >from : Symbol(Temporal.PlainMonthDayConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) md = Temporal.PlainMonthDay.from("0824"); // => 08-24 ->md : Symbol(md, Decl(temporal.ts, 1465, 7)) +>md : Symbol(md, Decl(temporal.ts, 1464, 7)) >Temporal.PlainMonthDay.from : Symbol(Temporal.PlainMonthDayConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.PlainMonthDay : Symbol(Temporal.PlainMonthDay, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -5542,7 +5533,7 @@ >from : Symbol(Temporal.PlainMonthDayConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) md = Temporal.PlainMonthDay.from("2006-08-24"); // => 08-24 ->md : Symbol(md, Decl(temporal.ts, 1465, 7)) +>md : Symbol(md, Decl(temporal.ts, 1464, 7)) >Temporal.PlainMonthDay.from : Symbol(Temporal.PlainMonthDayConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.PlainMonthDay : Symbol(Temporal.PlainMonthDay, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -5550,7 +5541,7 @@ >from : Symbol(Temporal.PlainMonthDayConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) md = Temporal.PlainMonthDay.from("2006-08-24T15:43:27"); // => 08-24 ->md : Symbol(md, Decl(temporal.ts, 1465, 7)) +>md : Symbol(md, Decl(temporal.ts, 1464, 7)) >Temporal.PlainMonthDay.from : Symbol(Temporal.PlainMonthDayConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.PlainMonthDay : Symbol(Temporal.PlainMonthDay, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -5558,7 +5549,7 @@ >from : Symbol(Temporal.PlainMonthDayConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) md = Temporal.PlainMonthDay.from("2006-08-24T15:43:27+01:00[Europe/Brussels]"); ->md : Symbol(md, Decl(temporal.ts, 1465, 7)) +>md : Symbol(md, Decl(temporal.ts, 1464, 7)) >Temporal.PlainMonthDay.from : Symbol(Temporal.PlainMonthDayConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.PlainMonthDay : Symbol(Temporal.PlainMonthDay, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -5567,26 +5558,26 @@ // => 08-24 md === Temporal.PlainMonthDay.from(md); // => false ->md : Symbol(md, Decl(temporal.ts, 1465, 7)) +>md : Symbol(md, Decl(temporal.ts, 1464, 7)) >Temporal.PlainMonthDay.from : Symbol(Temporal.PlainMonthDayConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.PlainMonthDay : Symbol(Temporal.PlainMonthDay, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) >PlainMonthDay : Symbol(Temporal.PlainMonthDay, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >from : Symbol(Temporal.PlainMonthDayConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) ->md : Symbol(md, Decl(temporal.ts, 1465, 7)) +>md : Symbol(md, Decl(temporal.ts, 1464, 7)) md = Temporal.PlainMonthDay.from({ monthCode: "M08", day: 24 }); // => 08-24 ->md : Symbol(md, Decl(temporal.ts, 1465, 7)) +>md : Symbol(md, Decl(temporal.ts, 1464, 7)) >Temporal.PlainMonthDay.from : Symbol(Temporal.PlainMonthDayConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.PlainMonthDay : Symbol(Temporal.PlainMonthDay, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) >PlainMonthDay : Symbol(Temporal.PlainMonthDay, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >from : Symbol(Temporal.PlainMonthDayConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) ->monthCode : Symbol(monthCode, Decl(temporal.ts, 1475, 38)) ->day : Symbol(day, Decl(temporal.ts, 1475, 56)) +>monthCode : Symbol(monthCode, Decl(temporal.ts, 1474, 38)) +>day : Symbol(day, Decl(temporal.ts, 1474, 56)) md = Temporal.PlainMonthDay.from(Temporal.PlainDate.from("2006-08-24")); ->md : Symbol(md, Decl(temporal.ts, 1465, 7)) +>md : Symbol(md, Decl(temporal.ts, 1464, 7)) >Temporal.PlainMonthDay.from : Symbol(Temporal.PlainMonthDayConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.PlainMonthDay : Symbol(Temporal.PlainMonthDay, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -5603,111 +5594,111 @@ // Different overflow modes md = Temporal.PlainMonthDay.from({ month: 13, day: 1, year: 2000 }, { overflow: "constrain" }); ->md : Symbol(md, Decl(temporal.ts, 1465, 7)) +>md : Symbol(md, Decl(temporal.ts, 1464, 7)) >Temporal.PlainMonthDay.from : Symbol(Temporal.PlainMonthDayConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.PlainMonthDay : Symbol(Temporal.PlainMonthDay, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) >PlainMonthDay : Symbol(Temporal.PlainMonthDay, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >from : Symbol(Temporal.PlainMonthDayConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) ->month : Symbol(month, Decl(temporal.ts, 1481, 38)) ->day : Symbol(day, Decl(temporal.ts, 1481, 49)) ->year : Symbol(year, Decl(temporal.ts, 1481, 57)) ->overflow : Symbol(overflow, Decl(temporal.ts, 1481, 73)) +>month : Symbol(month, Decl(temporal.ts, 1480, 38)) +>day : Symbol(day, Decl(temporal.ts, 1480, 49)) +>year : Symbol(year, Decl(temporal.ts, 1480, 57)) +>overflow : Symbol(overflow, Decl(temporal.ts, 1480, 73)) // => 12-01 md = Temporal.PlainMonthDay.from({ month: 1, day: 32, year: 2000 }, { overflow: "constrain" }); ->md : Symbol(md, Decl(temporal.ts, 1465, 7)) +>md : Symbol(md, Decl(temporal.ts, 1464, 7)) >Temporal.PlainMonthDay.from : Symbol(Temporal.PlainMonthDayConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.PlainMonthDay : Symbol(Temporal.PlainMonthDay, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) >PlainMonthDay : Symbol(Temporal.PlainMonthDay, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >from : Symbol(Temporal.PlainMonthDayConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) ->month : Symbol(month, Decl(temporal.ts, 1483, 38)) ->day : Symbol(day, Decl(temporal.ts, 1483, 48)) ->year : Symbol(year, Decl(temporal.ts, 1483, 57)) ->overflow : Symbol(overflow, Decl(temporal.ts, 1483, 73)) +>month : Symbol(month, Decl(temporal.ts, 1482, 38)) +>day : Symbol(day, Decl(temporal.ts, 1482, 48)) +>year : Symbol(year, Decl(temporal.ts, 1482, 57)) +>overflow : Symbol(overflow, Decl(temporal.ts, 1482, 73)) // => 01-31 md = Temporal.PlainMonthDay.from({ month: 13, day: 1, year: 2000 }, { overflow: "reject" }); ->md : Symbol(md, Decl(temporal.ts, 1465, 7)) +>md : Symbol(md, Decl(temporal.ts, 1464, 7)) >Temporal.PlainMonthDay.from : Symbol(Temporal.PlainMonthDayConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.PlainMonthDay : Symbol(Temporal.PlainMonthDay, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) >PlainMonthDay : Symbol(Temporal.PlainMonthDay, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >from : Symbol(Temporal.PlainMonthDayConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) ->month : Symbol(month, Decl(temporal.ts, 1485, 38)) ->day : Symbol(day, Decl(temporal.ts, 1485, 49)) ->year : Symbol(year, Decl(temporal.ts, 1485, 57)) ->overflow : Symbol(overflow, Decl(temporal.ts, 1485, 73)) +>month : Symbol(month, Decl(temporal.ts, 1484, 38)) +>day : Symbol(day, Decl(temporal.ts, 1484, 49)) +>year : Symbol(year, Decl(temporal.ts, 1484, 57)) +>overflow : Symbol(overflow, Decl(temporal.ts, 1484, 73)) // => throws md = Temporal.PlainMonthDay.from({ month: 1, day: 32, year: 2000 }, { overflow: "reject" }); ->md : Symbol(md, Decl(temporal.ts, 1465, 7)) +>md : Symbol(md, Decl(temporal.ts, 1464, 7)) >Temporal.PlainMonthDay.from : Symbol(Temporal.PlainMonthDayConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.PlainMonthDay : Symbol(Temporal.PlainMonthDay, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) >PlainMonthDay : Symbol(Temporal.PlainMonthDay, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >from : Symbol(Temporal.PlainMonthDayConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) ->month : Symbol(month, Decl(temporal.ts, 1487, 38)) ->day : Symbol(day, Decl(temporal.ts, 1487, 48)) ->year : Symbol(year, Decl(temporal.ts, 1487, 57)) ->overflow : Symbol(overflow, Decl(temporal.ts, 1487, 73)) +>month : Symbol(month, Decl(temporal.ts, 1486, 38)) +>day : Symbol(day, Decl(temporal.ts, 1486, 48)) +>year : Symbol(year, Decl(temporal.ts, 1486, 57)) +>overflow : Symbol(overflow, Decl(temporal.ts, 1486, 73)) // => throws md = Temporal.PlainMonthDay.from({ month: 2, day: 29, year: 2001 }, { overflow: "reject" }); ->md : Symbol(md, Decl(temporal.ts, 1465, 7)) +>md : Symbol(md, Decl(temporal.ts, 1464, 7)) >Temporal.PlainMonthDay.from : Symbol(Temporal.PlainMonthDayConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.PlainMonthDay : Symbol(Temporal.PlainMonthDay, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) >PlainMonthDay : Symbol(Temporal.PlainMonthDay, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >from : Symbol(Temporal.PlainMonthDayConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) ->month : Symbol(month, Decl(temporal.ts, 1489, 38)) ->day : Symbol(day, Decl(temporal.ts, 1489, 48)) ->year : Symbol(year, Decl(temporal.ts, 1489, 57)) ->overflow : Symbol(overflow, Decl(temporal.ts, 1489, 73)) +>month : Symbol(month, Decl(temporal.ts, 1488, 38)) +>day : Symbol(day, Decl(temporal.ts, 1488, 48)) +>year : Symbol(year, Decl(temporal.ts, 1488, 57)) +>overflow : Symbol(overflow, Decl(temporal.ts, 1488, 73)) // => throws (this year is not a leap year in the ISO 8601 calendar) // non-ISO calendars md = Temporal.PlainMonthDay.from({ monthCode: "M05L", day: 15, calendar: "hebrew" }); ->md : Symbol(md, Decl(temporal.ts, 1465, 7)) +>md : Symbol(md, Decl(temporal.ts, 1464, 7)) >Temporal.PlainMonthDay.from : Symbol(Temporal.PlainMonthDayConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.PlainMonthDay : Symbol(Temporal.PlainMonthDay, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) >PlainMonthDay : Symbol(Temporal.PlainMonthDay, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >from : Symbol(Temporal.PlainMonthDayConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) ->monthCode : Symbol(monthCode, Decl(temporal.ts, 1493, 38)) ->day : Symbol(day, Decl(temporal.ts, 1493, 57)) ->calendar : Symbol(calendar, Decl(temporal.ts, 1493, 66)) +>monthCode : Symbol(monthCode, Decl(temporal.ts, 1492, 38)) +>day : Symbol(day, Decl(temporal.ts, 1492, 57)) +>calendar : Symbol(calendar, Decl(temporal.ts, 1492, 66)) // => 1970-02-21[u-ca=hebrew] md = Temporal.PlainMonthDay.from({ month: 6, day: 15, year: 5779, calendar: "hebrew" }); ->md : Symbol(md, Decl(temporal.ts, 1465, 7)) +>md : Symbol(md, Decl(temporal.ts, 1464, 7)) >Temporal.PlainMonthDay.from : Symbol(Temporal.PlainMonthDayConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.PlainMonthDay : Symbol(Temporal.PlainMonthDay, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) >PlainMonthDay : Symbol(Temporal.PlainMonthDay, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >from : Symbol(Temporal.PlainMonthDayConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) ->month : Symbol(month, Decl(temporal.ts, 1495, 38)) ->day : Symbol(day, Decl(temporal.ts, 1495, 48)) ->year : Symbol(year, Decl(temporal.ts, 1495, 57)) ->calendar : Symbol(calendar, Decl(temporal.ts, 1495, 69)) +>month : Symbol(month, Decl(temporal.ts, 1494, 38)) +>day : Symbol(day, Decl(temporal.ts, 1494, 48)) +>year : Symbol(year, Decl(temporal.ts, 1494, 57)) +>calendar : Symbol(calendar, Decl(temporal.ts, 1494, 69)) // => 1970-02-21[u-ca=hebrew] /* WRONG */ md = Temporal.PlainMonthDay.from({ month: 6, day: 15, calendar: "hebrew" }); ->md : Symbol(md, Decl(temporal.ts, 1465, 7)) +>md : Symbol(md, Decl(temporal.ts, 1464, 7)) >Temporal.PlainMonthDay.from : Symbol(Temporal.PlainMonthDayConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.PlainMonthDay : Symbol(Temporal.PlainMonthDay, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) >PlainMonthDay : Symbol(Temporal.PlainMonthDay, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >from : Symbol(Temporal.PlainMonthDayConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) ->month : Symbol(month, Decl(temporal.ts, 1497, 50)) ->day : Symbol(day, Decl(temporal.ts, 1497, 60)) ->calendar : Symbol(calendar, Decl(temporal.ts, 1497, 69)) +>month : Symbol(month, Decl(temporal.ts, 1496, 50)) +>day : Symbol(day, Decl(temporal.ts, 1496, 60)) +>calendar : Symbol(calendar, Decl(temporal.ts, 1496, 69)) // => throws (either year or monthCode is required) md = Temporal.PlainMonthDay.from("2019-02-20[u-ca=hebrew]"); ->md : Symbol(md, Decl(temporal.ts, 1465, 7)) +>md : Symbol(md, Decl(temporal.ts, 1464, 7)) >Temporal.PlainMonthDay.from : Symbol(Temporal.PlainMonthDayConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.PlainMonthDay : Symbol(Temporal.PlainMonthDay, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -5716,28 +5707,28 @@ md.monthCode; // => 'M05L' >md.monthCode : Symbol(Temporal.PlainMonthDay.monthCode, Decl(lib.esnext.temporal.d.ts, --, --)) ->md : Symbol(md, Decl(temporal.ts, 1465, 7)) +>md : Symbol(md, Decl(temporal.ts, 1464, 7)) >monthCode : Symbol(Temporal.PlainMonthDay.monthCode, Decl(lib.esnext.temporal.d.ts, --, --)) md.day; // => 15 >md.day : Symbol(Temporal.PlainMonthDay.day, Decl(lib.esnext.temporal.d.ts, --, --)) ->md : Symbol(md, Decl(temporal.ts, 1465, 7)) +>md : Symbol(md, Decl(temporal.ts, 1464, 7)) >day : Symbol(Temporal.PlainMonthDay.day, Decl(lib.esnext.temporal.d.ts, --, --)) md.month; // undefined ->md : Symbol(md, Decl(temporal.ts, 1465, 7)) +>md : Symbol(md, Decl(temporal.ts, 1464, 7)) // (month property is not present in this type; use monthCode instead) } { let md: Temporal.PlainMonthDay; ->md : Symbol(md, Decl(temporal.ts, 1507, 7)) +>md : Symbol(md, Decl(temporal.ts, 1506, 7)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) >PlainMonthDay : Symbol(Temporal.PlainMonthDay, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) md = Temporal.PlainMonthDay.from("08-24"); ->md : Symbol(md, Decl(temporal.ts, 1507, 7)) +>md : Symbol(md, Decl(temporal.ts, 1506, 7)) >Temporal.PlainMonthDay.from : Symbol(Temporal.PlainMonthDayConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.PlainMonthDay : Symbol(Temporal.PlainMonthDay, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -5746,21 +5737,21 @@ md.monthCode; // => 'M08' >md.monthCode : Symbol(Temporal.PlainMonthDay.monthCode, Decl(lib.esnext.temporal.d.ts, --, --)) ->md : Symbol(md, Decl(temporal.ts, 1507, 7)) +>md : Symbol(md, Decl(temporal.ts, 1506, 7)) >monthCode : Symbol(Temporal.PlainMonthDay.monthCode, Decl(lib.esnext.temporal.d.ts, --, --)) md.day; // => 24 >md.day : Symbol(Temporal.PlainMonthDay.day, Decl(lib.esnext.temporal.d.ts, --, --)) ->md : Symbol(md, Decl(temporal.ts, 1507, 7)) +>md : Symbol(md, Decl(temporal.ts, 1506, 7)) >day : Symbol(Temporal.PlainMonthDay.day, Decl(lib.esnext.temporal.d.ts, --, --)) md.month; // => undefined ->md : Symbol(md, Decl(temporal.ts, 1507, 7)) +>md : Symbol(md, Decl(temporal.ts, 1506, 7)) // (no `month` property; use `monthCode` instead) md = Temporal.PlainMonthDay.from("2019-02-20[u-ca=hebrew]"); ->md : Symbol(md, Decl(temporal.ts, 1507, 7)) +>md : Symbol(md, Decl(temporal.ts, 1506, 7)) >Temporal.PlainMonthDay.from : Symbol(Temporal.PlainMonthDayConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.PlainMonthDay : Symbol(Temporal.PlainMonthDay, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -5769,23 +5760,23 @@ md.monthCode; // => 'M05L' >md.monthCode : Symbol(Temporal.PlainMonthDay.monthCode, Decl(lib.esnext.temporal.d.ts, --, --)) ->md : Symbol(md, Decl(temporal.ts, 1507, 7)) +>md : Symbol(md, Decl(temporal.ts, 1506, 7)) >monthCode : Symbol(Temporal.PlainMonthDay.monthCode, Decl(lib.esnext.temporal.d.ts, --, --)) md.day; // => 15 >md.day : Symbol(Temporal.PlainMonthDay.day, Decl(lib.esnext.temporal.d.ts, --, --)) ->md : Symbol(md, Decl(temporal.ts, 1507, 7)) +>md : Symbol(md, Decl(temporal.ts, 1506, 7)) >day : Symbol(Temporal.PlainMonthDay.day, Decl(lib.esnext.temporal.d.ts, --, --)) md.month; // => undefined ->md : Symbol(md, Decl(temporal.ts, 1507, 7)) +>md : Symbol(md, Decl(temporal.ts, 1506, 7)) // (no `month` property; use `monthCode` instead) } { const md = Temporal.PlainMonthDay.from("11-15"); ->md : Symbol(md, Decl(temporal.ts, 1523, 9)) +>md : Symbol(md, Decl(temporal.ts, 1522, 9)) >Temporal.PlainMonthDay.from : Symbol(Temporal.PlainMonthDayConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.PlainMonthDay : Symbol(Temporal.PlainMonthDay, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -5795,9 +5786,9 @@ // What's the last day of that month? md.with({ day: 31 }); // => 11-30 >md.with : Symbol(Temporal.PlainMonthDay.with, Decl(lib.esnext.temporal.d.ts, --, --)) ->md : Symbol(md, Decl(temporal.ts, 1523, 9)) +>md : Symbol(md, Decl(temporal.ts, 1522, 9)) >with : Symbol(Temporal.PlainMonthDay.with, Decl(lib.esnext.temporal.d.ts, --, --)) ->day : Symbol(day, Decl(temporal.ts, 1525, 13)) +>day : Symbol(day, Decl(temporal.ts, 1524, 13)) Temporal.PlainMonthDay.from("02-01").with({ day: 31 }); // => 02-29 >Temporal.PlainMonthDay.from("02-01").with : Symbol(Temporal.PlainMonthDay.with, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -5807,12 +5798,12 @@ >PlainMonthDay : Symbol(Temporal.PlainMonthDay, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >from : Symbol(Temporal.PlainMonthDayConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >with : Symbol(Temporal.PlainMonthDay.with, Decl(lib.esnext.temporal.d.ts, --, --)) ->day : Symbol(day, Decl(temporal.ts, 1526, 47)) +>day : Symbol(day, Decl(temporal.ts, 1525, 47)) } { const md1 = Temporal.PlainMonthDay.from("02-28"); ->md1 : Symbol(md1, Decl(temporal.ts, 1530, 9)) +>md1 : Symbol(md1, Decl(temporal.ts, 1529, 9)) >Temporal.PlainMonthDay.from : Symbol(Temporal.PlainMonthDayConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.PlainMonthDay : Symbol(Temporal.PlainMonthDay, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -5820,7 +5811,7 @@ >from : Symbol(Temporal.PlainMonthDayConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) const md2 = Temporal.PlainMonthDay.from("02-29"); ->md2 : Symbol(md2, Decl(temporal.ts, 1531, 9)) +>md2 : Symbol(md2, Decl(temporal.ts, 1530, 9)) >Temporal.PlainMonthDay.from : Symbol(Temporal.PlainMonthDayConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.PlainMonthDay : Symbol(Temporal.PlainMonthDay, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -5829,44 +5820,44 @@ md1.equals(md2); // => false >md1.equals : Symbol(Temporal.PlainMonthDay.equals, Decl(lib.esnext.temporal.d.ts, --, --)) ->md1 : Symbol(md1, Decl(temporal.ts, 1530, 9)) +>md1 : Symbol(md1, Decl(temporal.ts, 1529, 9)) >equals : Symbol(Temporal.PlainMonthDay.equals, Decl(lib.esnext.temporal.d.ts, --, --)) ->md2 : Symbol(md2, Decl(temporal.ts, 1531, 9)) +>md2 : Symbol(md2, Decl(temporal.ts, 1530, 9)) md1.equals("02-29"); // => false >md1.equals : Symbol(Temporal.PlainMonthDay.equals, Decl(lib.esnext.temporal.d.ts, --, --)) ->md1 : Symbol(md1, Decl(temporal.ts, 1530, 9)) +>md1 : Symbol(md1, Decl(temporal.ts, 1529, 9)) >equals : Symbol(Temporal.PlainMonthDay.equals, Decl(lib.esnext.temporal.d.ts, --, --)) md1.equals({ monthCode: "M02", day: 29 }); // => false >md1.equals : Symbol(Temporal.PlainMonthDay.equals, Decl(lib.esnext.temporal.d.ts, --, --)) ->md1 : Symbol(md1, Decl(temporal.ts, 1530, 9)) +>md1 : Symbol(md1, Decl(temporal.ts, 1529, 9)) >equals : Symbol(Temporal.PlainMonthDay.equals, Decl(lib.esnext.temporal.d.ts, --, --)) ->monthCode : Symbol(monthCode, Decl(temporal.ts, 1534, 16)) ->day : Symbol(day, Decl(temporal.ts, 1534, 34)) +>monthCode : Symbol(monthCode, Decl(temporal.ts, 1533, 16)) +>day : Symbol(day, Decl(temporal.ts, 1533, 34)) md2.equals(md2); // => true >md2.equals : Symbol(Temporal.PlainMonthDay.equals, Decl(lib.esnext.temporal.d.ts, --, --)) ->md2 : Symbol(md2, Decl(temporal.ts, 1531, 9)) +>md2 : Symbol(md2, Decl(temporal.ts, 1530, 9)) >equals : Symbol(Temporal.PlainMonthDay.equals, Decl(lib.esnext.temporal.d.ts, --, --)) ->md2 : Symbol(md2, Decl(temporal.ts, 1531, 9)) +>md2 : Symbol(md2, Decl(temporal.ts, 1530, 9)) md2.equals("02-29"); // => true >md2.equals : Symbol(Temporal.PlainMonthDay.equals, Decl(lib.esnext.temporal.d.ts, --, --)) ->md2 : Symbol(md2, Decl(temporal.ts, 1531, 9)) +>md2 : Symbol(md2, Decl(temporal.ts, 1530, 9)) >equals : Symbol(Temporal.PlainMonthDay.equals, Decl(lib.esnext.temporal.d.ts, --, --)) md2.equals({ monthCode: "M02", day: 29 }); // => true >md2.equals : Symbol(Temporal.PlainMonthDay.equals, Decl(lib.esnext.temporal.d.ts, --, --)) ->md2 : Symbol(md2, Decl(temporal.ts, 1531, 9)) +>md2 : Symbol(md2, Decl(temporal.ts, 1530, 9)) >equals : Symbol(Temporal.PlainMonthDay.equals, Decl(lib.esnext.temporal.d.ts, --, --)) ->monthCode : Symbol(monthCode, Decl(temporal.ts, 1537, 16)) ->day : Symbol(day, Decl(temporal.ts, 1537, 34)) +>monthCode : Symbol(monthCode, Decl(temporal.ts, 1536, 16)) +>day : Symbol(day, Decl(temporal.ts, 1536, 34)) } { const md = Temporal.PlainMonthDay.from("08-24"); ->md : Symbol(md, Decl(temporal.ts, 1541, 9)) +>md : Symbol(md, Decl(temporal.ts, 1540, 9)) >Temporal.PlainMonthDay.from : Symbol(Temporal.PlainMonthDayConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.PlainMonthDay : Symbol(Temporal.PlainMonthDay, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -5875,13 +5866,13 @@ md.toString(); // => '08-24' >md.toString : Symbol(Temporal.PlainMonthDay.toString, Decl(lib.esnext.temporal.d.ts, --, --)) ->md : Symbol(md, Decl(temporal.ts, 1541, 9)) +>md : Symbol(md, Decl(temporal.ts, 1540, 9)) >toString : Symbol(Temporal.PlainMonthDay.toString, Decl(lib.esnext.temporal.d.ts, --, --)) } { const { calendar } = new Intl.DateTimeFormat().resolvedOptions(); ->calendar : Symbol(calendar, Decl(temporal.ts, 1546, 11)) +>calendar : Symbol(calendar, Decl(temporal.ts, 1545, 11)) >new Intl.DateTimeFormat().resolvedOptions : Symbol(Intl.DateTimeFormat.resolvedOptions, Decl(lib.es5.d.ts, --, --)) >Intl.DateTimeFormat : Symbol(Intl.DateTimeFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2021.intl.d.ts, --, --), Decl(lib.esnext.intl.d.ts, --, --)) >Intl : Symbol(Intl, Decl(lib.es5.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2020.intl.d.ts, --, --), Decl(lib.es2021.intl.d.ts, --, --), Decl(lib.es2025.intl.d.ts, --, --) ... and 1 more) @@ -5889,53 +5880,53 @@ >resolvedOptions : Symbol(Intl.DateTimeFormat.resolvedOptions, Decl(lib.es5.d.ts, --, --)) const md = Temporal.PlainMonthDay.from({ monthCode: "M08", day: 24, calendar }); ->md : Symbol(md, Decl(temporal.ts, 1547, 9)) +>md : Symbol(md, Decl(temporal.ts, 1546, 9)) >Temporal.PlainMonthDay.from : Symbol(Temporal.PlainMonthDayConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.PlainMonthDay : Symbol(Temporal.PlainMonthDay, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) >PlainMonthDay : Symbol(Temporal.PlainMonthDay, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >from : Symbol(Temporal.PlainMonthDayConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) ->monthCode : Symbol(monthCode, Decl(temporal.ts, 1547, 44)) ->day : Symbol(day, Decl(temporal.ts, 1547, 62)) ->calendar : Symbol(calendar, Decl(temporal.ts, 1547, 71)) +>monthCode : Symbol(monthCode, Decl(temporal.ts, 1546, 44)) +>day : Symbol(day, Decl(temporal.ts, 1546, 62)) +>calendar : Symbol(calendar, Decl(temporal.ts, 1546, 71)) md.toLocaleString(); // example output: '8/24' >md.toLocaleString : Symbol(Temporal.PlainMonthDay.toLocaleString, Decl(lib.esnext.temporal.d.ts, --, --)) ->md : Symbol(md, Decl(temporal.ts, 1547, 9)) +>md : Symbol(md, Decl(temporal.ts, 1546, 9)) >toLocaleString : Symbol(Temporal.PlainMonthDay.toLocaleString, Decl(lib.esnext.temporal.d.ts, --, --)) // Same as above, but explicitly specifying the calendar: md.toLocaleString(undefined, { calendar }); // example output: '8/24' >md.toLocaleString : Symbol(Temporal.PlainMonthDay.toLocaleString, Decl(lib.esnext.temporal.d.ts, --, --)) ->md : Symbol(md, Decl(temporal.ts, 1547, 9)) +>md : Symbol(md, Decl(temporal.ts, 1546, 9)) >toLocaleString : Symbol(Temporal.PlainMonthDay.toLocaleString, Decl(lib.esnext.temporal.d.ts, --, --)) >undefined : Symbol(undefined) ->calendar : Symbol(calendar, Decl(temporal.ts, 1550, 34)) +>calendar : Symbol(calendar, Decl(temporal.ts, 1549, 34)) md.toLocaleString("de-DE", { calendar }); // => '24.8.' >md.toLocaleString : Symbol(Temporal.PlainMonthDay.toLocaleString, Decl(lib.esnext.temporal.d.ts, --, --)) ->md : Symbol(md, Decl(temporal.ts, 1547, 9)) +>md : Symbol(md, Decl(temporal.ts, 1546, 9)) >toLocaleString : Symbol(Temporal.PlainMonthDay.toLocaleString, Decl(lib.esnext.temporal.d.ts, --, --)) ->calendar : Symbol(calendar, Decl(temporal.ts, 1552, 32)) +>calendar : Symbol(calendar, Decl(temporal.ts, 1551, 32)) md.toLocaleString("de-DE", { month: "long", day: "numeric", calendar }); // => '24. August' >md.toLocaleString : Symbol(Temporal.PlainMonthDay.toLocaleString, Decl(lib.esnext.temporal.d.ts, --, --)) ->md : Symbol(md, Decl(temporal.ts, 1547, 9)) +>md : Symbol(md, Decl(temporal.ts, 1546, 9)) >toLocaleString : Symbol(Temporal.PlainMonthDay.toLocaleString, Decl(lib.esnext.temporal.d.ts, --, --)) ->month : Symbol(month, Decl(temporal.ts, 1553, 32)) ->day : Symbol(day, Decl(temporal.ts, 1553, 47)) ->calendar : Symbol(calendar, Decl(temporal.ts, 1553, 63)) +>month : Symbol(month, Decl(temporal.ts, 1552, 32)) +>day : Symbol(day, Decl(temporal.ts, 1552, 47)) +>calendar : Symbol(calendar, Decl(temporal.ts, 1552, 63)) md.toLocaleString(`en-US-u-nu-fullwide-ca-${calendar}`); // => '8/24' >md.toLocaleString : Symbol(Temporal.PlainMonthDay.toLocaleString, Decl(lib.esnext.temporal.d.ts, --, --)) ->md : Symbol(md, Decl(temporal.ts, 1547, 9)) +>md : Symbol(md, Decl(temporal.ts, 1546, 9)) >toLocaleString : Symbol(Temporal.PlainMonthDay.toLocaleString, Decl(lib.esnext.temporal.d.ts, --, --)) ->calendar : Symbol(calendar, Decl(temporal.ts, 1546, 11)) +>calendar : Symbol(calendar, Decl(temporal.ts, 1545, 11)) } { const md = Temporal.PlainMonthDay.from({ ->md : Symbol(md, Decl(temporal.ts, 1558, 9)) +>md : Symbol(md, Decl(temporal.ts, 1557, 9)) >Temporal.PlainMonthDay.from : Symbol(Temporal.PlainMonthDayConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.PlainMonthDay : Symbol(Temporal.PlainMonthDay, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -5943,23 +5934,23 @@ >from : Symbol(Temporal.PlainMonthDayConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) calendar: "japanese", ->calendar : Symbol(calendar, Decl(temporal.ts, 1558, 44)) +>calendar : Symbol(calendar, Decl(temporal.ts, 1557, 44)) monthCode: "M01", ->monthCode : Symbol(monthCode, Decl(temporal.ts, 1559, 29)) +>monthCode : Symbol(monthCode, Decl(temporal.ts, 1558, 29)) day: 1, ->day : Symbol(day, Decl(temporal.ts, 1560, 25)) +>day : Symbol(day, Decl(temporal.ts, 1559, 25)) }); const date = md.toPlainDate({ era: "reiwa", eraYear: 2 }); // => 2020-01-01[u-ca=japanese] ->date : Symbol(date, Decl(temporal.ts, 1564, 9)) +>date : Symbol(date, Decl(temporal.ts, 1563, 9)) >md.toPlainDate : Symbol(Temporal.PlainMonthDay.toPlainDate, Decl(lib.esnext.temporal.d.ts, --, --)) ->md : Symbol(md, Decl(temporal.ts, 1558, 9)) +>md : Symbol(md, Decl(temporal.ts, 1557, 9)) >toPlainDate : Symbol(Temporal.PlainMonthDay.toPlainDate, Decl(lib.esnext.temporal.d.ts, --, --)) ->era : Symbol(era, Decl(temporal.ts, 1564, 33)) ->eraYear : Symbol(eraYear, Decl(temporal.ts, 1564, 47)) +>era : Symbol(era, Decl(temporal.ts, 1563, 33)) +>eraYear : Symbol(eraYear, Decl(temporal.ts, 1563, 47)) } { @@ -5989,29 +5980,29 @@ { let d: Temporal.Duration; ->d : Symbol(d, Decl(temporal.ts, 1575, 7)) +>d : Symbol(d, Decl(temporal.ts, 1574, 7)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) >Duration : Symbol(Temporal.Duration, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) d = Temporal.Duration.from({ years: 1, days: 1 }); // => P1Y1D ->d : Symbol(d, Decl(temporal.ts, 1575, 7)) +>d : Symbol(d, Decl(temporal.ts, 1574, 7)) >Temporal.Duration.from : Symbol(Temporal.DurationConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.Duration : Symbol(Temporal.Duration, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) >Duration : Symbol(Temporal.Duration, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >from : Symbol(Temporal.DurationConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) ->years : Symbol(years, Decl(temporal.ts, 1577, 32)) ->days : Symbol(days, Decl(temporal.ts, 1577, 42)) +>years : Symbol(years, Decl(temporal.ts, 1576, 32)) +>days : Symbol(days, Decl(temporal.ts, 1576, 42)) d = Temporal.Duration.from({ days: -2, hours: -12 }); // => -P2DT12H ->d : Symbol(d, Decl(temporal.ts, 1575, 7)) +>d : Symbol(d, Decl(temporal.ts, 1574, 7)) >Temporal.Duration.from : Symbol(Temporal.DurationConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.Duration : Symbol(Temporal.Duration, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) >Duration : Symbol(Temporal.Duration, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >from : Symbol(Temporal.DurationConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) ->days : Symbol(days, Decl(temporal.ts, 1578, 32)) ->hours : Symbol(hours, Decl(temporal.ts, 1578, 42)) +>days : Symbol(days, Decl(temporal.ts, 1577, 32)) +>hours : Symbol(hours, Decl(temporal.ts, 1577, 42)) Temporal.Duration.from(d) === d; // => false >Temporal.Duration.from : Symbol(Temporal.DurationConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -6019,11 +6010,11 @@ >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) >Duration : Symbol(Temporal.Duration, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >from : Symbol(Temporal.DurationConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) ->d : Symbol(d, Decl(temporal.ts, 1575, 7)) ->d : Symbol(d, Decl(temporal.ts, 1575, 7)) +>d : Symbol(d, Decl(temporal.ts, 1574, 7)) +>d : Symbol(d, Decl(temporal.ts, 1574, 7)) d = Temporal.Duration.from("P1Y1D"); // => P1Y1D ->d : Symbol(d, Decl(temporal.ts, 1575, 7)) +>d : Symbol(d, Decl(temporal.ts, 1574, 7)) >Temporal.Duration.from : Symbol(Temporal.DurationConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.Duration : Symbol(Temporal.Duration, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -6031,7 +6022,7 @@ >from : Symbol(Temporal.DurationConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) d = Temporal.Duration.from("-P2DT12H"); // => -P2DT12H ->d : Symbol(d, Decl(temporal.ts, 1575, 7)) +>d : Symbol(d, Decl(temporal.ts, 1574, 7)) >Temporal.Duration.from : Symbol(Temporal.DurationConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.Duration : Symbol(Temporal.Duration, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -6039,7 +6030,7 @@ >from : Symbol(Temporal.DurationConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) d = Temporal.Duration.from("P0D"); // => PT0S ->d : Symbol(d, Decl(temporal.ts, 1575, 7)) +>d : Symbol(d, Decl(temporal.ts, 1574, 7)) >Temporal.Duration.from : Symbol(Temporal.DurationConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.Duration : Symbol(Temporal.Duration, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -6049,43 +6040,43 @@ { const one = Temporal.Duration.from({ hours: 79, minutes: 10 }); ->one : Symbol(one, Decl(temporal.ts, 1588, 9)) +>one : Symbol(one, Decl(temporal.ts, 1587, 9)) >Temporal.Duration.from : Symbol(Temporal.DurationConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.Duration : Symbol(Temporal.Duration, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) >Duration : Symbol(Temporal.Duration, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >from : Symbol(Temporal.DurationConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) ->hours : Symbol(hours, Decl(temporal.ts, 1588, 40)) ->minutes : Symbol(minutes, Decl(temporal.ts, 1588, 51)) +>hours : Symbol(hours, Decl(temporal.ts, 1587, 40)) +>minutes : Symbol(minutes, Decl(temporal.ts, 1587, 51)) const two = Temporal.Duration.from({ days: 3, hours: 7, seconds: 630 }); ->two : Symbol(two, Decl(temporal.ts, 1589, 9)) +>two : Symbol(two, Decl(temporal.ts, 1588, 9)) >Temporal.Duration.from : Symbol(Temporal.DurationConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.Duration : Symbol(Temporal.Duration, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) >Duration : Symbol(Temporal.Duration, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >from : Symbol(Temporal.DurationConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) ->days : Symbol(days, Decl(temporal.ts, 1589, 40)) ->hours : Symbol(hours, Decl(temporal.ts, 1589, 49)) ->seconds : Symbol(seconds, Decl(temporal.ts, 1589, 59)) +>days : Symbol(days, Decl(temporal.ts, 1588, 40)) +>hours : Symbol(hours, Decl(temporal.ts, 1588, 49)) +>seconds : Symbol(seconds, Decl(temporal.ts, 1588, 59)) const three = Temporal.Duration.from({ days: 3, hours: 6, minutes: 50 }); ->three : Symbol(three, Decl(temporal.ts, 1590, 9)) +>three : Symbol(three, Decl(temporal.ts, 1589, 9)) >Temporal.Duration.from : Symbol(Temporal.DurationConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.Duration : Symbol(Temporal.Duration, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) >Duration : Symbol(Temporal.Duration, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >from : Symbol(Temporal.DurationConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) ->days : Symbol(days, Decl(temporal.ts, 1590, 42)) ->hours : Symbol(hours, Decl(temporal.ts, 1590, 51)) ->minutes : Symbol(minutes, Decl(temporal.ts, 1590, 61)) +>days : Symbol(days, Decl(temporal.ts, 1589, 42)) +>hours : Symbol(hours, Decl(temporal.ts, 1589, 51)) +>minutes : Symbol(minutes, Decl(temporal.ts, 1589, 61)) const sorted1 = [one, two, three].sort(Temporal.Duration.compare); ->sorted1 : Symbol(sorted1, Decl(temporal.ts, 1591, 9)) +>sorted1 : Symbol(sorted1, Decl(temporal.ts, 1590, 9)) >[one, two, three].sort : Symbol(Array.sort, Decl(lib.es5.d.ts, --, --)) ->one : Symbol(one, Decl(temporal.ts, 1588, 9)) ->two : Symbol(two, Decl(temporal.ts, 1589, 9)) ->three : Symbol(three, Decl(temporal.ts, 1590, 9)) +>one : Symbol(one, Decl(temporal.ts, 1587, 9)) +>two : Symbol(two, Decl(temporal.ts, 1588, 9)) +>three : Symbol(three, Decl(temporal.ts, 1589, 9)) >sort : Symbol(Array.sort, Decl(lib.es5.d.ts, --, --)) >Temporal.Duration.compare : Symbol(Temporal.DurationConstructor.compare, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.Duration : Symbol(Temporal.Duration, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) @@ -6095,14 +6086,14 @@ sorted1.join(" "); >sorted1.join : Symbol(Array.join, Decl(lib.es5.d.ts, --, --)) ->sorted1 : Symbol(sorted1, Decl(temporal.ts, 1591, 9)) +>sorted1 : Symbol(sorted1, Decl(temporal.ts, 1590, 9)) >join : Symbol(Array.join, Decl(lib.es5.d.ts, --, --)) // => 'P3DT6H50M PT79H10M P3DT7H630S' // Sorting relative to a date, taking DST changes into account: const relativeTo = Temporal.ZonedDateTime.from("2020-11-01T00:00-07:00[America/Los_Angeles]"); ->relativeTo : Symbol(relativeTo, Decl(temporal.ts, 1596, 9)) +>relativeTo : Symbol(relativeTo, Decl(temporal.ts, 1595, 9)) >Temporal.ZonedDateTime.from : Symbol(Temporal.ZonedDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.ZonedDateTime : Symbol(Temporal.ZonedDateTime, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -6110,26 +6101,26 @@ >from : Symbol(Temporal.ZonedDateTimeConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) const sorted2 = [one, two, three].sort((one, two) => Temporal.Duration.compare(one, two, { relativeTo })); ->sorted2 : Symbol(sorted2, Decl(temporal.ts, 1597, 9)) +>sorted2 : Symbol(sorted2, Decl(temporal.ts, 1596, 9)) >[one, two, three].sort : Symbol(Array.sort, Decl(lib.es5.d.ts, --, --)) ->one : Symbol(one, Decl(temporal.ts, 1588, 9)) ->two : Symbol(two, Decl(temporal.ts, 1589, 9)) ->three : Symbol(three, Decl(temporal.ts, 1590, 9)) +>one : Symbol(one, Decl(temporal.ts, 1587, 9)) +>two : Symbol(two, Decl(temporal.ts, 1588, 9)) +>three : Symbol(three, Decl(temporal.ts, 1589, 9)) >sort : Symbol(Array.sort, Decl(lib.es5.d.ts, --, --)) ->one : Symbol(one, Decl(temporal.ts, 1597, 44)) ->two : Symbol(two, Decl(temporal.ts, 1597, 48)) +>one : Symbol(one, Decl(temporal.ts, 1596, 44)) +>two : Symbol(two, Decl(temporal.ts, 1596, 48)) >Temporal.Duration.compare : Symbol(Temporal.DurationConstructor.compare, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.Duration : Symbol(Temporal.Duration, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) >Duration : Symbol(Temporal.Duration, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >compare : Symbol(Temporal.DurationConstructor.compare, Decl(lib.esnext.temporal.d.ts, --, --)) ->one : Symbol(one, Decl(temporal.ts, 1597, 44)) ->two : Symbol(two, Decl(temporal.ts, 1597, 48)) ->relativeTo : Symbol(relativeTo, Decl(temporal.ts, 1597, 94)) +>one : Symbol(one, Decl(temporal.ts, 1596, 44)) +>two : Symbol(two, Decl(temporal.ts, 1596, 48)) +>relativeTo : Symbol(relativeTo, Decl(temporal.ts, 1596, 94)) sorted2.join(" "); >sorted2.join : Symbol(Array.join, Decl(lib.es5.d.ts, --, --)) ->sorted2 : Symbol(sorted2, Decl(temporal.ts, 1597, 9)) +>sorted2 : Symbol(sorted2, Decl(temporal.ts, 1596, 9)) >join : Symbol(Array.join, Decl(lib.es5.d.ts, --, --)) // => 'PT79H10M P3DT6H50M P3DT7H630S' @@ -6137,7 +6128,7 @@ { const d = Temporal.Duration.from("P1Y2M3W4DT5H6M7.987654321S"); ->d : Symbol(d, Decl(temporal.ts, 1603, 9)) +>d : Symbol(d, Decl(temporal.ts, 1602, 9)) >Temporal.Duration.from : Symbol(Temporal.DurationConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.Duration : Symbol(Temporal.Duration, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -6146,63 +6137,63 @@ d.years; // => 1 >d.years : Symbol(Temporal.Duration.years, Decl(lib.esnext.temporal.d.ts, --, --)) ->d : Symbol(d, Decl(temporal.ts, 1603, 9)) +>d : Symbol(d, Decl(temporal.ts, 1602, 9)) >years : Symbol(Temporal.Duration.years, Decl(lib.esnext.temporal.d.ts, --, --)) d.months; // => 2 >d.months : Symbol(Temporal.Duration.months, Decl(lib.esnext.temporal.d.ts, --, --)) ->d : Symbol(d, Decl(temporal.ts, 1603, 9)) +>d : Symbol(d, Decl(temporal.ts, 1602, 9)) >months : Symbol(Temporal.Duration.months, Decl(lib.esnext.temporal.d.ts, --, --)) d.weeks; // => 3 >d.weeks : Symbol(Temporal.Duration.weeks, Decl(lib.esnext.temporal.d.ts, --, --)) ->d : Symbol(d, Decl(temporal.ts, 1603, 9)) +>d : Symbol(d, Decl(temporal.ts, 1602, 9)) >weeks : Symbol(Temporal.Duration.weeks, Decl(lib.esnext.temporal.d.ts, --, --)) d.days; // => 4 >d.days : Symbol(Temporal.Duration.days, Decl(lib.esnext.temporal.d.ts, --, --)) ->d : Symbol(d, Decl(temporal.ts, 1603, 9)) +>d : Symbol(d, Decl(temporal.ts, 1602, 9)) >days : Symbol(Temporal.Duration.days, Decl(lib.esnext.temporal.d.ts, --, --)) d.hours; // => 5 >d.hours : Symbol(Temporal.Duration.hours, Decl(lib.esnext.temporal.d.ts, --, --)) ->d : Symbol(d, Decl(temporal.ts, 1603, 9)) +>d : Symbol(d, Decl(temporal.ts, 1602, 9)) >hours : Symbol(Temporal.Duration.hours, Decl(lib.esnext.temporal.d.ts, --, --)) d.minutes; // => 6 >d.minutes : Symbol(Temporal.Duration.minutes, Decl(lib.esnext.temporal.d.ts, --, --)) ->d : Symbol(d, Decl(temporal.ts, 1603, 9)) +>d : Symbol(d, Decl(temporal.ts, 1602, 9)) >minutes : Symbol(Temporal.Duration.minutes, Decl(lib.esnext.temporal.d.ts, --, --)) d.seconds; // => 7 >d.seconds : Symbol(Temporal.Duration.seconds, Decl(lib.esnext.temporal.d.ts, --, --)) ->d : Symbol(d, Decl(temporal.ts, 1603, 9)) +>d : Symbol(d, Decl(temporal.ts, 1602, 9)) >seconds : Symbol(Temporal.Duration.seconds, Decl(lib.esnext.temporal.d.ts, --, --)) d.milliseconds; // => 987 >d.milliseconds : Symbol(Temporal.Duration.milliseconds, Decl(lib.esnext.temporal.d.ts, --, --)) ->d : Symbol(d, Decl(temporal.ts, 1603, 9)) +>d : Symbol(d, Decl(temporal.ts, 1602, 9)) >milliseconds : Symbol(Temporal.Duration.milliseconds, Decl(lib.esnext.temporal.d.ts, --, --)) d.microseconds; // => 654 >d.microseconds : Symbol(Temporal.Duration.microseconds, Decl(lib.esnext.temporal.d.ts, --, --)) ->d : Symbol(d, Decl(temporal.ts, 1603, 9)) +>d : Symbol(d, Decl(temporal.ts, 1602, 9)) >microseconds : Symbol(Temporal.Duration.microseconds, Decl(lib.esnext.temporal.d.ts, --, --)) d.nanoseconds; // => 321 >d.nanoseconds : Symbol(Temporal.Duration.nanoseconds, Decl(lib.esnext.temporal.d.ts, --, --)) ->d : Symbol(d, Decl(temporal.ts, 1603, 9)) +>d : Symbol(d, Decl(temporal.ts, 1602, 9)) >nanoseconds : Symbol(Temporal.Duration.nanoseconds, Decl(lib.esnext.temporal.d.ts, --, --)) } { let d: Temporal.Duration; ->d : Symbol(d, Decl(temporal.ts, 1617, 7)) +>d : Symbol(d, Decl(temporal.ts, 1616, 7)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) >Duration : Symbol(Temporal.Duration, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) d = Temporal.Duration.from("PT0S"); ->d : Symbol(d, Decl(temporal.ts, 1617, 7)) +>d : Symbol(d, Decl(temporal.ts, 1616, 7)) >Temporal.Duration.from : Symbol(Temporal.DurationConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.Duration : Symbol(Temporal.Duration, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -6211,74 +6202,74 @@ d.blank; // => true >d.blank : Symbol(Temporal.Duration.blank, Decl(lib.esnext.temporal.d.ts, --, --)) ->d : Symbol(d, Decl(temporal.ts, 1617, 7)) +>d : Symbol(d, Decl(temporal.ts, 1616, 7)) >blank : Symbol(Temporal.Duration.blank, Decl(lib.esnext.temporal.d.ts, --, --)) d = Temporal.Duration.from({ days: 0, hours: 0, minutes: 0 }); ->d : Symbol(d, Decl(temporal.ts, 1617, 7)) +>d : Symbol(d, Decl(temporal.ts, 1616, 7)) >Temporal.Duration.from : Symbol(Temporal.DurationConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.Duration : Symbol(Temporal.Duration, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) >Duration : Symbol(Temporal.Duration, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >from : Symbol(Temporal.DurationConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) ->days : Symbol(days, Decl(temporal.ts, 1622, 32)) ->hours : Symbol(hours, Decl(temporal.ts, 1622, 41)) ->minutes : Symbol(minutes, Decl(temporal.ts, 1622, 51)) +>days : Symbol(days, Decl(temporal.ts, 1621, 32)) +>hours : Symbol(hours, Decl(temporal.ts, 1621, 41)) +>minutes : Symbol(minutes, Decl(temporal.ts, 1621, 51)) d.blank; // => true >d.blank : Symbol(Temporal.Duration.blank, Decl(lib.esnext.temporal.d.ts, --, --)) ->d : Symbol(d, Decl(temporal.ts, 1617, 7)) +>d : Symbol(d, Decl(temporal.ts, 1616, 7)) >blank : Symbol(Temporal.Duration.blank, Decl(lib.esnext.temporal.d.ts, --, --)) } { let duration: Temporal.Duration; ->duration : Symbol(duration, Decl(temporal.ts, 1627, 7)) +>duration : Symbol(duration, Decl(temporal.ts, 1626, 7)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) >Duration : Symbol(Temporal.Duration, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) duration = Temporal.Duration.from({ months: 50, days: 50, hours: 50, minutes: 100 }); ->duration : Symbol(duration, Decl(temporal.ts, 1627, 7)) +>duration : Symbol(duration, Decl(temporal.ts, 1626, 7)) >Temporal.Duration.from : Symbol(Temporal.DurationConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.Duration : Symbol(Temporal.Duration, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) >Duration : Symbol(Temporal.Duration, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >from : Symbol(Temporal.DurationConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) ->months : Symbol(months, Decl(temporal.ts, 1629, 39)) ->days : Symbol(days, Decl(temporal.ts, 1629, 51)) ->hours : Symbol(hours, Decl(temporal.ts, 1629, 61)) ->minutes : Symbol(minutes, Decl(temporal.ts, 1629, 72)) +>months : Symbol(months, Decl(temporal.ts, 1628, 39)) +>days : Symbol(days, Decl(temporal.ts, 1628, 51)) +>hours : Symbol(hours, Decl(temporal.ts, 1628, 61)) +>minutes : Symbol(minutes, Decl(temporal.ts, 1628, 72)) // Perform a balance operation using additional ISO 8601 calendar rules: let { years, months } = duration; ->years : Symbol(years, Decl(temporal.ts, 1631, 9)) ->months : Symbol(months, Decl(temporal.ts, 1631, 16)) ->duration : Symbol(duration, Decl(temporal.ts, 1627, 7)) +>years : Symbol(years, Decl(temporal.ts, 1630, 9)) +>months : Symbol(months, Decl(temporal.ts, 1630, 16)) +>duration : Symbol(duration, Decl(temporal.ts, 1626, 7)) years += Math.floor(months / 12); ->years : Symbol(years, Decl(temporal.ts, 1631, 9)) +>years : Symbol(years, Decl(temporal.ts, 1630, 9)) >Math.floor : Symbol(Math.floor, Decl(lib.es5.d.ts, --, --)) >Math : Symbol(Math, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) >floor : Symbol(Math.floor, Decl(lib.es5.d.ts, --, --)) ->months : Symbol(months, Decl(temporal.ts, 1631, 16)) +>months : Symbol(months, Decl(temporal.ts, 1630, 16)) months %= 12; ->months : Symbol(months, Decl(temporal.ts, 1631, 16)) +>months : Symbol(months, Decl(temporal.ts, 1630, 16)) duration = duration.with({ years, months }); ->duration : Symbol(duration, Decl(temporal.ts, 1627, 7)) +>duration : Symbol(duration, Decl(temporal.ts, 1626, 7)) >duration.with : Symbol(Temporal.Duration.with, Decl(lib.esnext.temporal.d.ts, --, --)) ->duration : Symbol(duration, Decl(temporal.ts, 1627, 7)) +>duration : Symbol(duration, Decl(temporal.ts, 1626, 7)) >with : Symbol(Temporal.Duration.with, Decl(lib.esnext.temporal.d.ts, --, --)) ->years : Symbol(years, Decl(temporal.ts, 1634, 30)) ->months : Symbol(months, Decl(temporal.ts, 1634, 37)) +>years : Symbol(years, Decl(temporal.ts, 1633, 30)) +>months : Symbol(months, Decl(temporal.ts, 1633, 37)) // => P4Y2M50DT50H100M } { const hour = Temporal.Duration.from("PT1H"); ->hour : Symbol(hour, Decl(temporal.ts, 1639, 9)) +>hour : Symbol(hour, Decl(temporal.ts, 1638, 9)) >Temporal.Duration.from : Symbol(Temporal.DurationConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.Duration : Symbol(Temporal.Duration, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -6287,52 +6278,52 @@ hour.add({ minutes: 30 }); // => PT1H30M >hour.add : Symbol(Temporal.Duration.add, Decl(lib.esnext.temporal.d.ts, --, --)) ->hour : Symbol(hour, Decl(temporal.ts, 1639, 9)) +>hour : Symbol(hour, Decl(temporal.ts, 1638, 9)) >add : Symbol(Temporal.Duration.add, Decl(lib.esnext.temporal.d.ts, --, --)) ->minutes : Symbol(minutes, Decl(temporal.ts, 1640, 14)) +>minutes : Symbol(minutes, Decl(temporal.ts, 1639, 14)) // Examples of balancing: const one = Temporal.Duration.from({ hours: 1, minutes: 30 }); ->one : Symbol(one, Decl(temporal.ts, 1643, 9)) +>one : Symbol(one, Decl(temporal.ts, 1642, 9)) >Temporal.Duration.from : Symbol(Temporal.DurationConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.Duration : Symbol(Temporal.Duration, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) >Duration : Symbol(Temporal.Duration, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >from : Symbol(Temporal.DurationConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) ->hours : Symbol(hours, Decl(temporal.ts, 1643, 40)) ->minutes : Symbol(minutes, Decl(temporal.ts, 1643, 50)) +>hours : Symbol(hours, Decl(temporal.ts, 1642, 40)) +>minutes : Symbol(minutes, Decl(temporal.ts, 1642, 50)) const two = Temporal.Duration.from({ hours: 2, minutes: 45 }); ->two : Symbol(two, Decl(temporal.ts, 1644, 9)) +>two : Symbol(two, Decl(temporal.ts, 1643, 9)) >Temporal.Duration.from : Symbol(Temporal.DurationConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.Duration : Symbol(Temporal.Duration, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) >Duration : Symbol(Temporal.Duration, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >from : Symbol(Temporal.DurationConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) ->hours : Symbol(hours, Decl(temporal.ts, 1644, 40)) ->minutes : Symbol(minutes, Decl(temporal.ts, 1644, 50)) +>hours : Symbol(hours, Decl(temporal.ts, 1643, 40)) +>minutes : Symbol(minutes, Decl(temporal.ts, 1643, 50)) const result = one.add(two); // => PT4H15M ->result : Symbol(result, Decl(temporal.ts, 1645, 9)) +>result : Symbol(result, Decl(temporal.ts, 1644, 9)) >one.add : Symbol(Temporal.Duration.add, Decl(lib.esnext.temporal.d.ts, --, --)) ->one : Symbol(one, Decl(temporal.ts, 1643, 9)) +>one : Symbol(one, Decl(temporal.ts, 1642, 9)) >add : Symbol(Temporal.Duration.add, Decl(lib.esnext.temporal.d.ts, --, --)) ->two : Symbol(two, Decl(temporal.ts, 1644, 9)) +>two : Symbol(two, Decl(temporal.ts, 1643, 9)) // Example of adding calendar units const oneAndAHalfMonth = Temporal.Duration.from({ months: 1, days: 16 }); ->oneAndAHalfMonth : Symbol(oneAndAHalfMonth, Decl(temporal.ts, 1648, 9)) +>oneAndAHalfMonth : Symbol(oneAndAHalfMonth, Decl(temporal.ts, 1647, 9)) >Temporal.Duration.from : Symbol(Temporal.DurationConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.Duration : Symbol(Temporal.Duration, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) >Duration : Symbol(Temporal.Duration, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >from : Symbol(Temporal.DurationConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) ->months : Symbol(months, Decl(temporal.ts, 1648, 53)) ->days : Symbol(days, Decl(temporal.ts, 1648, 64)) +>months : Symbol(months, Decl(temporal.ts, 1647, 53)) +>days : Symbol(days, Decl(temporal.ts, 1647, 64)) // To convert units, use arithmetic relative to a start date: const startDate1 = Temporal.PlainDate.from("2000-12-01"); ->startDate1 : Symbol(startDate1, Decl(temporal.ts, 1651, 9)) +>startDate1 : Symbol(startDate1, Decl(temporal.ts, 1650, 9)) >Temporal.PlainDate.from : Symbol(Temporal.PlainDateConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.PlainDate : Symbol(Temporal.PlainDate, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -6343,19 +6334,19 @@ >startDate1.add(oneAndAHalfMonth).add(oneAndAHalfMonth) .since : Symbol(Temporal.PlainDate.since, Decl(lib.esnext.temporal.d.ts, --, --)) >startDate1.add(oneAndAHalfMonth).add : Symbol(Temporal.PlainDate.add, Decl(lib.esnext.temporal.d.ts, --, --)) >startDate1.add : Symbol(Temporal.PlainDate.add, Decl(lib.esnext.temporal.d.ts, --, --)) ->startDate1 : Symbol(startDate1, Decl(temporal.ts, 1651, 9)) +>startDate1 : Symbol(startDate1, Decl(temporal.ts, 1650, 9)) >add : Symbol(Temporal.PlainDate.add, Decl(lib.esnext.temporal.d.ts, --, --)) ->oneAndAHalfMonth : Symbol(oneAndAHalfMonth, Decl(temporal.ts, 1648, 9)) +>oneAndAHalfMonth : Symbol(oneAndAHalfMonth, Decl(temporal.ts, 1647, 9)) >add : Symbol(Temporal.PlainDate.add, Decl(lib.esnext.temporal.d.ts, --, --)) ->oneAndAHalfMonth : Symbol(oneAndAHalfMonth, Decl(temporal.ts, 1648, 9)) +>oneAndAHalfMonth : Symbol(oneAndAHalfMonth, Decl(temporal.ts, 1647, 9)) .since(startDate1, { largestUnit: "months" }); // => P3M4D >since : Symbol(Temporal.PlainDate.since, Decl(lib.esnext.temporal.d.ts, --, --)) ->startDate1 : Symbol(startDate1, Decl(temporal.ts, 1651, 9)) ->largestUnit : Symbol(largestUnit, Decl(temporal.ts, 1653, 28)) +>startDate1 : Symbol(startDate1, Decl(temporal.ts, 1650, 9)) +>largestUnit : Symbol(largestUnit, Decl(temporal.ts, 1652, 28)) const startDate2 = Temporal.PlainDate.from("2001-01-01"); ->startDate2 : Symbol(startDate2, Decl(temporal.ts, 1655, 9)) +>startDate2 : Symbol(startDate2, Decl(temporal.ts, 1654, 9)) >Temporal.PlainDate.from : Symbol(Temporal.PlainDateConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.PlainDate : Symbol(Temporal.PlainDate, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -6366,21 +6357,21 @@ >startDate2.add(oneAndAHalfMonth).add(oneAndAHalfMonth) .since : Symbol(Temporal.PlainDate.since, Decl(lib.esnext.temporal.d.ts, --, --)) >startDate2.add(oneAndAHalfMonth).add : Symbol(Temporal.PlainDate.add, Decl(lib.esnext.temporal.d.ts, --, --)) >startDate2.add : Symbol(Temporal.PlainDate.add, Decl(lib.esnext.temporal.d.ts, --, --)) ->startDate2 : Symbol(startDate2, Decl(temporal.ts, 1655, 9)) +>startDate2 : Symbol(startDate2, Decl(temporal.ts, 1654, 9)) >add : Symbol(Temporal.PlainDate.add, Decl(lib.esnext.temporal.d.ts, --, --)) ->oneAndAHalfMonth : Symbol(oneAndAHalfMonth, Decl(temporal.ts, 1648, 9)) +>oneAndAHalfMonth : Symbol(oneAndAHalfMonth, Decl(temporal.ts, 1647, 9)) >add : Symbol(Temporal.PlainDate.add, Decl(lib.esnext.temporal.d.ts, --, --)) ->oneAndAHalfMonth : Symbol(oneAndAHalfMonth, Decl(temporal.ts, 1648, 9)) +>oneAndAHalfMonth : Symbol(oneAndAHalfMonth, Decl(temporal.ts, 1647, 9)) .since(startDate2, { largestUnit: "months" }); // => P3M1D >since : Symbol(Temporal.PlainDate.since, Decl(lib.esnext.temporal.d.ts, --, --)) ->startDate2 : Symbol(startDate2, Decl(temporal.ts, 1655, 9)) ->largestUnit : Symbol(largestUnit, Decl(temporal.ts, 1657, 28)) +>startDate2 : Symbol(startDate2, Decl(temporal.ts, 1654, 9)) +>largestUnit : Symbol(largestUnit, Decl(temporal.ts, 1656, 28)) } { const hourAndAHalf = Temporal.Duration.from("PT1H30M"); ->hourAndAHalf : Symbol(hourAndAHalf, Decl(temporal.ts, 1661, 9)) +>hourAndAHalf : Symbol(hourAndAHalf, Decl(temporal.ts, 1660, 9)) >Temporal.Duration.from : Symbol(Temporal.DurationConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.Duration : Symbol(Temporal.Duration, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -6389,67 +6380,67 @@ hourAndAHalf.subtract({ hours: 1 }); // => PT30M >hourAndAHalf.subtract : Symbol(Temporal.Duration.subtract, Decl(lib.esnext.temporal.d.ts, --, --)) ->hourAndAHalf : Symbol(hourAndAHalf, Decl(temporal.ts, 1661, 9)) +>hourAndAHalf : Symbol(hourAndAHalf, Decl(temporal.ts, 1660, 9)) >subtract : Symbol(Temporal.Duration.subtract, Decl(lib.esnext.temporal.d.ts, --, --)) ->hours : Symbol(hours, Decl(temporal.ts, 1662, 27)) +>hours : Symbol(hours, Decl(temporal.ts, 1661, 27)) const one = Temporal.Duration.from({ minutes: 180 }); ->one : Symbol(one, Decl(temporal.ts, 1664, 9)) +>one : Symbol(one, Decl(temporal.ts, 1663, 9)) >Temporal.Duration.from : Symbol(Temporal.DurationConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.Duration : Symbol(Temporal.Duration, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) >Duration : Symbol(Temporal.Duration, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >from : Symbol(Temporal.DurationConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) ->minutes : Symbol(minutes, Decl(temporal.ts, 1664, 40)) +>minutes : Symbol(minutes, Decl(temporal.ts, 1663, 40)) const two = Temporal.Duration.from({ seconds: 30 }); ->two : Symbol(two, Decl(temporal.ts, 1665, 9)) +>two : Symbol(two, Decl(temporal.ts, 1664, 9)) >Temporal.Duration.from : Symbol(Temporal.DurationConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.Duration : Symbol(Temporal.Duration, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) >Duration : Symbol(Temporal.Duration, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >from : Symbol(Temporal.DurationConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) ->seconds : Symbol(seconds, Decl(temporal.ts, 1665, 40)) +>seconds : Symbol(seconds, Decl(temporal.ts, 1664, 40)) one.subtract(two); // => PT179M30S >one.subtract : Symbol(Temporal.Duration.subtract, Decl(lib.esnext.temporal.d.ts, --, --)) ->one : Symbol(one, Decl(temporal.ts, 1664, 9)) +>one : Symbol(one, Decl(temporal.ts, 1663, 9)) >subtract : Symbol(Temporal.Duration.subtract, Decl(lib.esnext.temporal.d.ts, --, --)) ->two : Symbol(two, Decl(temporal.ts, 1665, 9)) +>two : Symbol(two, Decl(temporal.ts, 1664, 9)) one.subtract(two).round({ largestUnit: "hour" }); // => PT2H59M30S >one.subtract(two).round : Symbol(Temporal.Duration.round, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >one.subtract : Symbol(Temporal.Duration.subtract, Decl(lib.esnext.temporal.d.ts, --, --)) ->one : Symbol(one, Decl(temporal.ts, 1664, 9)) +>one : Symbol(one, Decl(temporal.ts, 1663, 9)) >subtract : Symbol(Temporal.Duration.subtract, Decl(lib.esnext.temporal.d.ts, --, --)) ->two : Symbol(two, Decl(temporal.ts, 1665, 9)) +>two : Symbol(two, Decl(temporal.ts, 1664, 9)) >round : Symbol(Temporal.Duration.round, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) ->largestUnit : Symbol(largestUnit, Decl(temporal.ts, 1667, 29)) +>largestUnit : Symbol(largestUnit, Decl(temporal.ts, 1666, 29)) // Example of subtracting calendar units; cannot be subtracted using // subtract() because units need to be converted const threeMonths = Temporal.Duration.from({ months: 3 }); ->threeMonths : Symbol(threeMonths, Decl(temporal.ts, 1671, 9)) +>threeMonths : Symbol(threeMonths, Decl(temporal.ts, 1670, 9)) >Temporal.Duration.from : Symbol(Temporal.DurationConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.Duration : Symbol(Temporal.Duration, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) >Duration : Symbol(Temporal.Duration, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >from : Symbol(Temporal.DurationConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) ->months : Symbol(months, Decl(temporal.ts, 1671, 48)) +>months : Symbol(months, Decl(temporal.ts, 1670, 48)) const oneAndAHalfMonth = Temporal.Duration.from({ months: 1, days: 15 }); ->oneAndAHalfMonth : Symbol(oneAndAHalfMonth, Decl(temporal.ts, 1672, 9)) +>oneAndAHalfMonth : Symbol(oneAndAHalfMonth, Decl(temporal.ts, 1671, 9)) >Temporal.Duration.from : Symbol(Temporal.DurationConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.Duration : Symbol(Temporal.Duration, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) >Duration : Symbol(Temporal.Duration, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >from : Symbol(Temporal.DurationConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) ->months : Symbol(months, Decl(temporal.ts, 1672, 53)) ->days : Symbol(days, Decl(temporal.ts, 1672, 64)) +>months : Symbol(months, Decl(temporal.ts, 1671, 53)) +>days : Symbol(days, Decl(temporal.ts, 1671, 64)) // To convert units, use arithmetic relative to a start date: const startDate1 = Temporal.PlainDate.from("2001-01-01"); ->startDate1 : Symbol(startDate1, Decl(temporal.ts, 1675, 9)) +>startDate1 : Symbol(startDate1, Decl(temporal.ts, 1674, 9)) >Temporal.PlainDate.from : Symbol(Temporal.PlainDateConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.PlainDate : Symbol(Temporal.PlainDate, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -6460,19 +6451,19 @@ >startDate1.add(threeMonths).subtract(oneAndAHalfMonth) .since : Symbol(Temporal.PlainDate.since, Decl(lib.esnext.temporal.d.ts, --, --)) >startDate1.add(threeMonths).subtract : Symbol(Temporal.PlainDate.subtract, Decl(lib.esnext.temporal.d.ts, --, --)) >startDate1.add : Symbol(Temporal.PlainDate.add, Decl(lib.esnext.temporal.d.ts, --, --)) ->startDate1 : Symbol(startDate1, Decl(temporal.ts, 1675, 9)) +>startDate1 : Symbol(startDate1, Decl(temporal.ts, 1674, 9)) >add : Symbol(Temporal.PlainDate.add, Decl(lib.esnext.temporal.d.ts, --, --)) ->threeMonths : Symbol(threeMonths, Decl(temporal.ts, 1671, 9)) +>threeMonths : Symbol(threeMonths, Decl(temporal.ts, 1670, 9)) >subtract : Symbol(Temporal.PlainDate.subtract, Decl(lib.esnext.temporal.d.ts, --, --)) ->oneAndAHalfMonth : Symbol(oneAndAHalfMonth, Decl(temporal.ts, 1672, 9)) +>oneAndAHalfMonth : Symbol(oneAndAHalfMonth, Decl(temporal.ts, 1671, 9)) .since(startDate1, { largestUnit: "months" }); // => P1M13D >since : Symbol(Temporal.PlainDate.since, Decl(lib.esnext.temporal.d.ts, --, --)) ->startDate1 : Symbol(startDate1, Decl(temporal.ts, 1675, 9)) ->largestUnit : Symbol(largestUnit, Decl(temporal.ts, 1677, 28)) +>startDate1 : Symbol(startDate1, Decl(temporal.ts, 1674, 9)) +>largestUnit : Symbol(largestUnit, Decl(temporal.ts, 1676, 28)) const startDate2 = Temporal.PlainDate.from("2001-02-01"); ->startDate2 : Symbol(startDate2, Decl(temporal.ts, 1679, 9)) +>startDate2 : Symbol(startDate2, Decl(temporal.ts, 1678, 9)) >Temporal.PlainDate.from : Symbol(Temporal.PlainDateConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.PlainDate : Symbol(Temporal.PlainDate, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -6483,21 +6474,21 @@ >startDate2.add(threeMonths).subtract(oneAndAHalfMonth) .since : Symbol(Temporal.PlainDate.since, Decl(lib.esnext.temporal.d.ts, --, --)) >startDate2.add(threeMonths).subtract : Symbol(Temporal.PlainDate.subtract, Decl(lib.esnext.temporal.d.ts, --, --)) >startDate2.add : Symbol(Temporal.PlainDate.add, Decl(lib.esnext.temporal.d.ts, --, --)) ->startDate2 : Symbol(startDate2, Decl(temporal.ts, 1679, 9)) +>startDate2 : Symbol(startDate2, Decl(temporal.ts, 1678, 9)) >add : Symbol(Temporal.PlainDate.add, Decl(lib.esnext.temporal.d.ts, --, --)) ->threeMonths : Symbol(threeMonths, Decl(temporal.ts, 1671, 9)) +>threeMonths : Symbol(threeMonths, Decl(temporal.ts, 1670, 9)) >subtract : Symbol(Temporal.PlainDate.subtract, Decl(lib.esnext.temporal.d.ts, --, --)) ->oneAndAHalfMonth : Symbol(oneAndAHalfMonth, Decl(temporal.ts, 1672, 9)) +>oneAndAHalfMonth : Symbol(oneAndAHalfMonth, Decl(temporal.ts, 1671, 9)) .since(startDate2, { largestUnit: "months" }); // => P1M16D >since : Symbol(Temporal.PlainDate.since, Decl(lib.esnext.temporal.d.ts, --, --)) ->startDate2 : Symbol(startDate2, Decl(temporal.ts, 1679, 9)) ->largestUnit : Symbol(largestUnit, Decl(temporal.ts, 1681, 28)) +>startDate2 : Symbol(startDate2, Decl(temporal.ts, 1678, 9)) +>largestUnit : Symbol(largestUnit, Decl(temporal.ts, 1680, 28)) } { const d = Temporal.Duration.from("P1Y2M3DT4H5M6.987654321S"); ->d : Symbol(d, Decl(temporal.ts, 1685, 9)) +>d : Symbol(d, Decl(temporal.ts, 1684, 9)) >Temporal.Duration.from : Symbol(Temporal.DurationConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.Duration : Symbol(Temporal.Duration, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -6506,25 +6497,25 @@ d.sign; // 1 >d.sign : Symbol(Temporal.Duration.sign, Decl(lib.esnext.temporal.d.ts, --, --)) ->d : Symbol(d, Decl(temporal.ts, 1685, 9)) +>d : Symbol(d, Decl(temporal.ts, 1684, 9)) >sign : Symbol(Temporal.Duration.sign, Decl(lib.esnext.temporal.d.ts, --, --)) d.negated(); // -P1Y2M3DT4H5M6.987654321S >d.negated : Symbol(Temporal.Duration.negated, Decl(lib.esnext.temporal.d.ts, --, --)) ->d : Symbol(d, Decl(temporal.ts, 1685, 9)) +>d : Symbol(d, Decl(temporal.ts, 1684, 9)) >negated : Symbol(Temporal.Duration.negated, Decl(lib.esnext.temporal.d.ts, --, --)) d.negated().sign; // -1 >d.negated().sign : Symbol(Temporal.Duration.sign, Decl(lib.esnext.temporal.d.ts, --, --)) >d.negated : Symbol(Temporal.Duration.negated, Decl(lib.esnext.temporal.d.ts, --, --)) ->d : Symbol(d, Decl(temporal.ts, 1685, 9)) +>d : Symbol(d, Decl(temporal.ts, 1684, 9)) >negated : Symbol(Temporal.Duration.negated, Decl(lib.esnext.temporal.d.ts, --, --)) >sign : Symbol(Temporal.Duration.sign, Decl(lib.esnext.temporal.d.ts, --, --)) } { const d = Temporal.Duration.from("-PT8H30M"); ->d : Symbol(d, Decl(temporal.ts, 1692, 9)) +>d : Symbol(d, Decl(temporal.ts, 1691, 9)) >Temporal.Duration.from : Symbol(Temporal.DurationConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.Duration : Symbol(Temporal.Duration, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -6533,59 +6524,59 @@ d.abs(); // PT8H30M >d.abs : Symbol(Temporal.Duration.abs, Decl(lib.esnext.temporal.d.ts, --, --)) ->d : Symbol(d, Decl(temporal.ts, 1692, 9)) +>d : Symbol(d, Decl(temporal.ts, 1691, 9)) >abs : Symbol(Temporal.Duration.abs, Decl(lib.esnext.temporal.d.ts, --, --)) } { let d: Temporal.Duration; ->d : Symbol(d, Decl(temporal.ts, 1697, 7)) +>d : Symbol(d, Decl(temporal.ts, 1696, 7)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) >Duration : Symbol(Temporal.Duration, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) // Balance a duration as far as possible without knowing a starting point d = Temporal.Duration.from({ minutes: 130 }); ->d : Symbol(d, Decl(temporal.ts, 1697, 7)) +>d : Symbol(d, Decl(temporal.ts, 1696, 7)) >Temporal.Duration.from : Symbol(Temporal.DurationConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.Duration : Symbol(Temporal.Duration, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) >Duration : Symbol(Temporal.Duration, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >from : Symbol(Temporal.DurationConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) ->minutes : Symbol(minutes, Decl(temporal.ts, 1700, 32)) +>minutes : Symbol(minutes, Decl(temporal.ts, 1699, 32)) d.round({ largestUnit: "day" }); // => PT2H10M >d.round : Symbol(Temporal.Duration.round, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) ->d : Symbol(d, Decl(temporal.ts, 1697, 7)) +>d : Symbol(d, Decl(temporal.ts, 1696, 7)) >round : Symbol(Temporal.Duration.round, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) ->largestUnit : Symbol(largestUnit, Decl(temporal.ts, 1701, 13)) +>largestUnit : Symbol(largestUnit, Decl(temporal.ts, 1700, 13)) // Round to the nearest unit d = Temporal.Duration.from({ minutes: 10, seconds: 52 }); ->d : Symbol(d, Decl(temporal.ts, 1697, 7)) +>d : Symbol(d, Decl(temporal.ts, 1696, 7)) >Temporal.Duration.from : Symbol(Temporal.DurationConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.Duration : Symbol(Temporal.Duration, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) >Duration : Symbol(Temporal.Duration, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >from : Symbol(Temporal.DurationConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) ->minutes : Symbol(minutes, Decl(temporal.ts, 1704, 32)) ->seconds : Symbol(seconds, Decl(temporal.ts, 1704, 45)) +>minutes : Symbol(minutes, Decl(temporal.ts, 1703, 32)) +>seconds : Symbol(seconds, Decl(temporal.ts, 1703, 45)) d.round({ smallestUnit: "minute" }); // => PT11M >d.round : Symbol(Temporal.Duration.round, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) ->d : Symbol(d, Decl(temporal.ts, 1697, 7)) +>d : Symbol(d, Decl(temporal.ts, 1696, 7)) >round : Symbol(Temporal.Duration.round, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) ->smallestUnit : Symbol(smallestUnit, Decl(temporal.ts, 1705, 13)) +>smallestUnit : Symbol(smallestUnit, Decl(temporal.ts, 1704, 13)) d.round({ smallestUnit: "minute", roundingMode: "trunc" }); // => PT10M >d.round : Symbol(Temporal.Duration.round, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) ->d : Symbol(d, Decl(temporal.ts, 1697, 7)) +>d : Symbol(d, Decl(temporal.ts, 1696, 7)) >round : Symbol(Temporal.Duration.round, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) ->smallestUnit : Symbol(smallestUnit, Decl(temporal.ts, 1706, 13)) ->roundingMode : Symbol(roundingMode, Decl(temporal.ts, 1706, 37)) +>smallestUnit : Symbol(smallestUnit, Decl(temporal.ts, 1705, 13)) +>roundingMode : Symbol(roundingMode, Decl(temporal.ts, 1705, 37)) // How many seconds in a multi-unit duration? d = Temporal.Duration.from("PT2H34M18S"); ->d : Symbol(d, Decl(temporal.ts, 1697, 7)) +>d : Symbol(d, Decl(temporal.ts, 1696, 7)) >Temporal.Duration.from : Symbol(Temporal.DurationConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.Duration : Symbol(Temporal.Duration, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -6595,60 +6586,60 @@ d.round({ largestUnit: "second" }).seconds; // => 9258 >d.round({ largestUnit: "second" }).seconds : Symbol(Temporal.Duration.seconds, Decl(lib.esnext.temporal.d.ts, --, --)) >d.round : Symbol(Temporal.Duration.round, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) ->d : Symbol(d, Decl(temporal.ts, 1697, 7)) +>d : Symbol(d, Decl(temporal.ts, 1696, 7)) >round : Symbol(Temporal.Duration.round, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) ->largestUnit : Symbol(largestUnit, Decl(temporal.ts, 1710, 13)) +>largestUnit : Symbol(largestUnit, Decl(temporal.ts, 1709, 13)) >seconds : Symbol(Temporal.Duration.seconds, Decl(lib.esnext.temporal.d.ts, --, --)) // Normalize, with and without taking DST into account d = Temporal.Duration.from({ hours: 2756 }); ->d : Symbol(d, Decl(temporal.ts, 1697, 7)) +>d : Symbol(d, Decl(temporal.ts, 1696, 7)) >Temporal.Duration.from : Symbol(Temporal.DurationConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.Duration : Symbol(Temporal.Duration, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) >Duration : Symbol(Temporal.Duration, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >from : Symbol(Temporal.DurationConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) ->hours : Symbol(hours, Decl(temporal.ts, 1713, 32)) +>hours : Symbol(hours, Decl(temporal.ts, 1712, 32)) d.round({ >d.round : Symbol(Temporal.Duration.round, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) ->d : Symbol(d, Decl(temporal.ts, 1697, 7)) +>d : Symbol(d, Decl(temporal.ts, 1696, 7)) >round : Symbol(Temporal.Duration.round, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) relativeTo: "2020-01-01T00:00+01:00[Europe/Rome]", ->relativeTo : Symbol(relativeTo, Decl(temporal.ts, 1714, 13)) +>relativeTo : Symbol(relativeTo, Decl(temporal.ts, 1713, 13)) largestUnit: "year", ->largestUnit : Symbol(largestUnit, Decl(temporal.ts, 1715, 58)) +>largestUnit : Symbol(largestUnit, Decl(temporal.ts, 1714, 58)) }); // => P114DT21H // (one hour longer because DST skipped an hour) d.round({ >d.round : Symbol(Temporal.Duration.round, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) ->d : Symbol(d, Decl(temporal.ts, 1697, 7)) +>d : Symbol(d, Decl(temporal.ts, 1696, 7)) >round : Symbol(Temporal.Duration.round, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) relativeTo: "2020-01-01", ->relativeTo : Symbol(relativeTo, Decl(temporal.ts, 1719, 13)) +>relativeTo : Symbol(relativeTo, Decl(temporal.ts, 1718, 13)) largestUnit: "year", ->largestUnit : Symbol(largestUnit, Decl(temporal.ts, 1720, 33)) +>largestUnit : Symbol(largestUnit, Decl(temporal.ts, 1719, 33)) }); // => P114DT20H // (one hour shorter if ignoring DST) // Normalize days into months or years d = Temporal.Duration.from({ days: 190 }); ->d : Symbol(d, Decl(temporal.ts, 1697, 7)) +>d : Symbol(d, Decl(temporal.ts, 1696, 7)) >Temporal.Duration.from : Symbol(Temporal.DurationConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.Duration : Symbol(Temporal.Duration, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) >Duration : Symbol(Temporal.Duration, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >from : Symbol(Temporal.DurationConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) ->days : Symbol(days, Decl(temporal.ts, 1726, 32)) +>days : Symbol(days, Decl(temporal.ts, 1725, 32)) const refDate = Temporal.PlainDate.from("2020-01-01"); ->refDate : Symbol(refDate, Decl(temporal.ts, 1727, 9)) +>refDate : Symbol(refDate, Decl(temporal.ts, 1726, 9)) >Temporal.PlainDate.from : Symbol(Temporal.PlainDateConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.PlainDate : Symbol(Temporal.PlainDate, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -6657,83 +6648,83 @@ d.round({ relativeTo: refDate, largestUnit: "year" }); // => P6M8D >d.round : Symbol(Temporal.Duration.round, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) ->d : Symbol(d, Decl(temporal.ts, 1697, 7)) +>d : Symbol(d, Decl(temporal.ts, 1696, 7)) >round : Symbol(Temporal.Duration.round, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) ->relativeTo : Symbol(relativeTo, Decl(temporal.ts, 1728, 13)) ->refDate : Symbol(refDate, Decl(temporal.ts, 1727, 9)) ->largestUnit : Symbol(largestUnit, Decl(temporal.ts, 1728, 34)) +>relativeTo : Symbol(relativeTo, Decl(temporal.ts, 1727, 13)) +>refDate : Symbol(refDate, Decl(temporal.ts, 1726, 9)) +>largestUnit : Symbol(largestUnit, Decl(temporal.ts, 1727, 34)) // Same, but in a different calendar system d.round({ >d.round : Symbol(Temporal.Duration.round, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) ->d : Symbol(d, Decl(temporal.ts, 1697, 7)) +>d : Symbol(d, Decl(temporal.ts, 1696, 7)) >round : Symbol(Temporal.Duration.round, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) relativeTo: refDate.withCalendar("hebrew"), ->relativeTo : Symbol(relativeTo, Decl(temporal.ts, 1731, 13)) +>relativeTo : Symbol(relativeTo, Decl(temporal.ts, 1730, 13)) >refDate.withCalendar : Symbol(Temporal.PlainDate.withCalendar, Decl(lib.esnext.temporal.d.ts, --, --)) ->refDate : Symbol(refDate, Decl(temporal.ts, 1727, 9)) +>refDate : Symbol(refDate, Decl(temporal.ts, 1726, 9)) >withCalendar : Symbol(Temporal.PlainDate.withCalendar, Decl(lib.esnext.temporal.d.ts, --, --)) largestUnit: "year", ->largestUnit : Symbol(largestUnit, Decl(temporal.ts, 1732, 51)) +>largestUnit : Symbol(largestUnit, Decl(temporal.ts, 1731, 51)) }); // => P6M13D // Round a duration up to the next 5-minute billing period d = Temporal.Duration.from({ minutes: 6 }); ->d : Symbol(d, Decl(temporal.ts, 1697, 7)) +>d : Symbol(d, Decl(temporal.ts, 1696, 7)) >Temporal.Duration.from : Symbol(Temporal.DurationConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.Duration : Symbol(Temporal.Duration, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) >Duration : Symbol(Temporal.Duration, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >from : Symbol(Temporal.DurationConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) ->minutes : Symbol(minutes, Decl(temporal.ts, 1737, 32)) +>minutes : Symbol(minutes, Decl(temporal.ts, 1736, 32)) d.round({ >d.round : Symbol(Temporal.Duration.round, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) ->d : Symbol(d, Decl(temporal.ts, 1697, 7)) +>d : Symbol(d, Decl(temporal.ts, 1696, 7)) >round : Symbol(Temporal.Duration.round, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) smallestUnit: "minute", ->smallestUnit : Symbol(smallestUnit, Decl(temporal.ts, 1738, 13)) +>smallestUnit : Symbol(smallestUnit, Decl(temporal.ts, 1737, 13)) roundingIncrement: 5, ->roundingIncrement : Symbol(roundingIncrement, Decl(temporal.ts, 1739, 31)) +>roundingIncrement : Symbol(roundingIncrement, Decl(temporal.ts, 1738, 31)) roundingMode: "ceil", ->roundingMode : Symbol(roundingMode, Decl(temporal.ts, 1740, 29)) +>roundingMode : Symbol(roundingMode, Decl(temporal.ts, 1739, 29)) }); // => PT10M // How many full 3-month quarters of this year, are in this duration? d = Temporal.Duration.from({ months: 10, days: 15 }); ->d : Symbol(d, Decl(temporal.ts, 1697, 7)) +>d : Symbol(d, Decl(temporal.ts, 1696, 7)) >Temporal.Duration.from : Symbol(Temporal.DurationConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.Duration : Symbol(Temporal.Duration, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) >Duration : Symbol(Temporal.Duration, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >from : Symbol(Temporal.DurationConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) ->months : Symbol(months, Decl(temporal.ts, 1745, 32)) ->days : Symbol(days, Decl(temporal.ts, 1745, 44)) +>months : Symbol(months, Decl(temporal.ts, 1744, 32)) +>days : Symbol(days, Decl(temporal.ts, 1744, 44)) d = d.round({ ->d : Symbol(d, Decl(temporal.ts, 1697, 7)) +>d : Symbol(d, Decl(temporal.ts, 1696, 7)) >d.round : Symbol(Temporal.Duration.round, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) ->d : Symbol(d, Decl(temporal.ts, 1697, 7)) +>d : Symbol(d, Decl(temporal.ts, 1696, 7)) >round : Symbol(Temporal.Duration.round, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) smallestUnit: "month", ->smallestUnit : Symbol(smallestUnit, Decl(temporal.ts, 1746, 17)) +>smallestUnit : Symbol(smallestUnit, Decl(temporal.ts, 1745, 17)) roundingIncrement: 3, ->roundingIncrement : Symbol(roundingIncrement, Decl(temporal.ts, 1747, 30)) +>roundingIncrement : Symbol(roundingIncrement, Decl(temporal.ts, 1746, 30)) roundingMode: "trunc", ->roundingMode : Symbol(roundingMode, Decl(temporal.ts, 1748, 29)) +>roundingMode : Symbol(roundingMode, Decl(temporal.ts, 1747, 29)) relativeTo: Temporal.Now.plainDateISO(), ->relativeTo : Symbol(relativeTo, Decl(temporal.ts, 1749, 30)) +>relativeTo : Symbol(relativeTo, Decl(temporal.ts, 1748, 30)) >Temporal.Now.plainDateISO : Symbol(Temporal.Now.plainDateISO, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.Now : Symbol(Temporal.Now, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -6742,41 +6733,41 @@ }); const quarters = d.months / 3; ->quarters : Symbol(quarters, Decl(temporal.ts, 1752, 9)) +>quarters : Symbol(quarters, Decl(temporal.ts, 1751, 9)) >d.months : Symbol(Temporal.Duration.months, Decl(lib.esnext.temporal.d.ts, --, --)) ->d : Symbol(d, Decl(temporal.ts, 1697, 7)) +>d : Symbol(d, Decl(temporal.ts, 1696, 7)) >months : Symbol(Temporal.Duration.months, Decl(lib.esnext.temporal.d.ts, --, --)) quarters; // => 3 ->quarters : Symbol(quarters, Decl(temporal.ts, 1752, 9)) +>quarters : Symbol(quarters, Decl(temporal.ts, 1751, 9)) } { let d: Temporal.Duration; ->d : Symbol(d, Decl(temporal.ts, 1757, 7)) +>d : Symbol(d, Decl(temporal.ts, 1756, 7)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) >Duration : Symbol(Temporal.Duration, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) // How many seconds in 130 hours and 20 minutes? d = Temporal.Duration.from({ hours: 130, minutes: 20 }); ->d : Symbol(d, Decl(temporal.ts, 1757, 7)) +>d : Symbol(d, Decl(temporal.ts, 1756, 7)) >Temporal.Duration.from : Symbol(Temporal.DurationConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.Duration : Symbol(Temporal.Duration, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) >Duration : Symbol(Temporal.Duration, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >from : Symbol(Temporal.DurationConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) ->hours : Symbol(hours, Decl(temporal.ts, 1760, 32)) ->minutes : Symbol(minutes, Decl(temporal.ts, 1760, 44)) +>hours : Symbol(hours, Decl(temporal.ts, 1759, 32)) +>minutes : Symbol(minutes, Decl(temporal.ts, 1759, 44)) d.total({ unit: "second" }); // => 469200 >d.total : Symbol(Temporal.Duration.total, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) ->d : Symbol(d, Decl(temporal.ts, 1757, 7)) +>d : Symbol(d, Decl(temporal.ts, 1756, 7)) >total : Symbol(Temporal.Duration.total, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) ->unit : Symbol(unit, Decl(temporal.ts, 1761, 13)) +>unit : Symbol(unit, Decl(temporal.ts, 1760, 13)) // How many 24-hour days is 123456789 seconds? d = Temporal.Duration.from("PT123456789S"); ->d : Symbol(d, Decl(temporal.ts, 1757, 7)) +>d : Symbol(d, Decl(temporal.ts, 1756, 7)) >Temporal.Duration.from : Symbol(Temporal.DurationConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.Duration : Symbol(Temporal.Duration, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -6785,140 +6776,140 @@ d.total({ unit: "day" }); // 1428.8980208333332 >d.total : Symbol(Temporal.Duration.total, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) ->d : Symbol(d, Decl(temporal.ts, 1757, 7)) +>d : Symbol(d, Decl(temporal.ts, 1756, 7)) >total : Symbol(Temporal.Duration.total, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) ->unit : Symbol(unit, Decl(temporal.ts, 1765, 13)) +>unit : Symbol(unit, Decl(temporal.ts, 1764, 13)) // Find totals in months, with and without taking DST into account d = Temporal.Duration.from({ hours: 2756 }); ->d : Symbol(d, Decl(temporal.ts, 1757, 7)) +>d : Symbol(d, Decl(temporal.ts, 1756, 7)) >Temporal.Duration.from : Symbol(Temporal.DurationConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.Duration : Symbol(Temporal.Duration, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) >Duration : Symbol(Temporal.Duration, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >from : Symbol(Temporal.DurationConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) ->hours : Symbol(hours, Decl(temporal.ts, 1768, 32)) +>hours : Symbol(hours, Decl(temporal.ts, 1767, 32)) d.total({ >d.total : Symbol(Temporal.Duration.total, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) ->d : Symbol(d, Decl(temporal.ts, 1757, 7)) +>d : Symbol(d, Decl(temporal.ts, 1756, 7)) >total : Symbol(Temporal.Duration.total, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) relativeTo: "2020-01-01T00:00+01:00[Europe/Rome]", ->relativeTo : Symbol(relativeTo, Decl(temporal.ts, 1769, 13)) +>relativeTo : Symbol(relativeTo, Decl(temporal.ts, 1768, 13)) unit: "month", ->unit : Symbol(unit, Decl(temporal.ts, 1770, 58)) +>unit : Symbol(unit, Decl(temporal.ts, 1769, 58)) }); // => 3.7958333333333334 d.total({ >d.total : Symbol(Temporal.Duration.total, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) ->d : Symbol(d, Decl(temporal.ts, 1757, 7)) +>d : Symbol(d, Decl(temporal.ts, 1756, 7)) >total : Symbol(Temporal.Duration.total, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) unit: "month", ->unit : Symbol(unit, Decl(temporal.ts, 1773, 13)) +>unit : Symbol(unit, Decl(temporal.ts, 1772, 13)) relativeTo: "2020-01-01", ->relativeTo : Symbol(relativeTo, Decl(temporal.ts, 1774, 22)) +>relativeTo : Symbol(relativeTo, Decl(temporal.ts, 1773, 22)) }); // => 3.7944444444444443 } { let d: Temporal.Duration; ->d : Symbol(d, Decl(temporal.ts, 1780, 7)) +>d : Symbol(d, Decl(temporal.ts, 1779, 7)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) >Duration : Symbol(Temporal.Duration, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) d = Temporal.Duration.from({ years: 1, days: 1 }); ->d : Symbol(d, Decl(temporal.ts, 1780, 7)) +>d : Symbol(d, Decl(temporal.ts, 1779, 7)) >Temporal.Duration.from : Symbol(Temporal.DurationConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.Duration : Symbol(Temporal.Duration, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) >Duration : Symbol(Temporal.Duration, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >from : Symbol(Temporal.DurationConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) ->years : Symbol(years, Decl(temporal.ts, 1782, 32)) ->days : Symbol(days, Decl(temporal.ts, 1782, 42)) +>years : Symbol(years, Decl(temporal.ts, 1781, 32)) +>days : Symbol(days, Decl(temporal.ts, 1781, 42)) d.toString(); // => P1Y1D >d.toString : Symbol(Temporal.Duration.toString, Decl(lib.esnext.temporal.d.ts, --, --)) ->d : Symbol(d, Decl(temporal.ts, 1780, 7)) +>d : Symbol(d, Decl(temporal.ts, 1779, 7)) >toString : Symbol(Temporal.Duration.toString, Decl(lib.esnext.temporal.d.ts, --, --)) d = Temporal.Duration.from({ years: -1, days: -1 }); ->d : Symbol(d, Decl(temporal.ts, 1780, 7)) +>d : Symbol(d, Decl(temporal.ts, 1779, 7)) >Temporal.Duration.from : Symbol(Temporal.DurationConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.Duration : Symbol(Temporal.Duration, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) >Duration : Symbol(Temporal.Duration, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >from : Symbol(Temporal.DurationConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) ->years : Symbol(years, Decl(temporal.ts, 1784, 32)) ->days : Symbol(days, Decl(temporal.ts, 1784, 43)) +>years : Symbol(years, Decl(temporal.ts, 1783, 32)) +>days : Symbol(days, Decl(temporal.ts, 1783, 43)) d.toString(); // => -P1Y1D >d.toString : Symbol(Temporal.Duration.toString, Decl(lib.esnext.temporal.d.ts, --, --)) ->d : Symbol(d, Decl(temporal.ts, 1780, 7)) +>d : Symbol(d, Decl(temporal.ts, 1779, 7)) >toString : Symbol(Temporal.Duration.toString, Decl(lib.esnext.temporal.d.ts, --, --)) d = Temporal.Duration.from({ milliseconds: 1000 }); ->d : Symbol(d, Decl(temporal.ts, 1780, 7)) +>d : Symbol(d, Decl(temporal.ts, 1779, 7)) >Temporal.Duration.from : Symbol(Temporal.DurationConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.Duration : Symbol(Temporal.Duration, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) >Duration : Symbol(Temporal.Duration, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >from : Symbol(Temporal.DurationConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) ->milliseconds : Symbol(milliseconds, Decl(temporal.ts, 1786, 32)) +>milliseconds : Symbol(milliseconds, Decl(temporal.ts, 1785, 32)) d.toString(); // => PT1S >d.toString : Symbol(Temporal.Duration.toString, Decl(lib.esnext.temporal.d.ts, --, --)) ->d : Symbol(d, Decl(temporal.ts, 1780, 7)) +>d : Symbol(d, Decl(temporal.ts, 1779, 7)) >toString : Symbol(Temporal.Duration.toString, Decl(lib.esnext.temporal.d.ts, --, --)) // The output format always balances units under 1 s, even if the // underlying Temporal.Duration object doesn't. const nobal = Temporal.Duration.from({ milliseconds: 3500 }); ->nobal : Symbol(nobal, Decl(temporal.ts, 1791, 9)) +>nobal : Symbol(nobal, Decl(temporal.ts, 1790, 9)) >Temporal.Duration.from : Symbol(Temporal.DurationConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.Duration : Symbol(Temporal.Duration, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) >Duration : Symbol(Temporal.Duration, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >from : Symbol(Temporal.DurationConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) ->milliseconds : Symbol(milliseconds, Decl(temporal.ts, 1791, 42)) +>milliseconds : Symbol(milliseconds, Decl(temporal.ts, 1790, 42)) console.log(`${nobal}`, nobal.seconds, nobal.milliseconds); // => 'PT3.5S 0 3500' >console.log : Symbol(Console.log, Decl(lib.dom.d.ts, --, --)) >console : Symbol(console, Decl(lib.dom.d.ts, --, --)) >log : Symbol(Console.log, Decl(lib.dom.d.ts, --, --)) ->nobal : Symbol(nobal, Decl(temporal.ts, 1791, 9)) +>nobal : Symbol(nobal, Decl(temporal.ts, 1790, 9)) >nobal.seconds : Symbol(Temporal.Duration.seconds, Decl(lib.esnext.temporal.d.ts, --, --)) ->nobal : Symbol(nobal, Decl(temporal.ts, 1791, 9)) +>nobal : Symbol(nobal, Decl(temporal.ts, 1790, 9)) >seconds : Symbol(Temporal.Duration.seconds, Decl(lib.esnext.temporal.d.ts, --, --)) >nobal.milliseconds : Symbol(Temporal.Duration.milliseconds, Decl(lib.esnext.temporal.d.ts, --, --)) ->nobal : Symbol(nobal, Decl(temporal.ts, 1791, 9)) +>nobal : Symbol(nobal, Decl(temporal.ts, 1790, 9)) >milliseconds : Symbol(Temporal.Duration.milliseconds, Decl(lib.esnext.temporal.d.ts, --, --)) const bal = nobal.round({ largestUnit: "year" }); // balance through round ->bal : Symbol(bal, Decl(temporal.ts, 1793, 9)) +>bal : Symbol(bal, Decl(temporal.ts, 1792, 9)) >nobal.round : Symbol(Temporal.Duration.round, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) ->nobal : Symbol(nobal, Decl(temporal.ts, 1791, 9)) +>nobal : Symbol(nobal, Decl(temporal.ts, 1790, 9)) >round : Symbol(Temporal.Duration.round, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) ->largestUnit : Symbol(largestUnit, Decl(temporal.ts, 1793, 29)) +>largestUnit : Symbol(largestUnit, Decl(temporal.ts, 1792, 29)) console.log(`${bal}`, bal.seconds, bal.milliseconds); // => 'PT3.5S 3 500' >console.log : Symbol(Console.log, Decl(lib.dom.d.ts, --, --)) >console : Symbol(console, Decl(lib.dom.d.ts, --, --)) >log : Symbol(Console.log, Decl(lib.dom.d.ts, --, --)) ->bal : Symbol(bal, Decl(temporal.ts, 1793, 9)) +>bal : Symbol(bal, Decl(temporal.ts, 1792, 9)) >bal.seconds : Symbol(Temporal.Duration.seconds, Decl(lib.esnext.temporal.d.ts, --, --)) ->bal : Symbol(bal, Decl(temporal.ts, 1793, 9)) +>bal : Symbol(bal, Decl(temporal.ts, 1792, 9)) >seconds : Symbol(Temporal.Duration.seconds, Decl(lib.esnext.temporal.d.ts, --, --)) >bal.milliseconds : Symbol(Temporal.Duration.milliseconds, Decl(lib.esnext.temporal.d.ts, --, --)) ->bal : Symbol(bal, Decl(temporal.ts, 1793, 9)) +>bal : Symbol(bal, Decl(temporal.ts, 1792, 9)) >milliseconds : Symbol(Temporal.Duration.milliseconds, Decl(lib.esnext.temporal.d.ts, --, --)) d = Temporal.Duration.from("PT59.999999999S"); ->d : Symbol(d, Decl(temporal.ts, 1780, 7)) +>d : Symbol(d, Decl(temporal.ts, 1779, 7)) >Temporal.Duration.from : Symbol(Temporal.DurationConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.Duration : Symbol(Temporal.Duration, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -6927,35 +6918,35 @@ d.toString({ smallestUnit: "second" }); // => PT59S >d.toString : Symbol(Temporal.Duration.toString, Decl(lib.esnext.temporal.d.ts, --, --)) ->d : Symbol(d, Decl(temporal.ts, 1780, 7)) +>d : Symbol(d, Decl(temporal.ts, 1779, 7)) >toString : Symbol(Temporal.Duration.toString, Decl(lib.esnext.temporal.d.ts, --, --)) ->smallestUnit : Symbol(smallestUnit, Decl(temporal.ts, 1797, 16)) +>smallestUnit : Symbol(smallestUnit, Decl(temporal.ts, 1796, 16)) d.toString({ fractionalSecondDigits: 0 }); // => PT59S >d.toString : Symbol(Temporal.Duration.toString, Decl(lib.esnext.temporal.d.ts, --, --)) ->d : Symbol(d, Decl(temporal.ts, 1780, 7)) +>d : Symbol(d, Decl(temporal.ts, 1779, 7)) >toString : Symbol(Temporal.Duration.toString, Decl(lib.esnext.temporal.d.ts, --, --)) ->fractionalSecondDigits : Symbol(fractionalSecondDigits, Decl(temporal.ts, 1798, 16)) +>fractionalSecondDigits : Symbol(fractionalSecondDigits, Decl(temporal.ts, 1797, 16)) d.toString({ fractionalSecondDigits: 4 }); // => PT59.9999S >d.toString : Symbol(Temporal.Duration.toString, Decl(lib.esnext.temporal.d.ts, --, --)) ->d : Symbol(d, Decl(temporal.ts, 1780, 7)) +>d : Symbol(d, Decl(temporal.ts, 1779, 7)) >toString : Symbol(Temporal.Duration.toString, Decl(lib.esnext.temporal.d.ts, --, --)) ->fractionalSecondDigits : Symbol(fractionalSecondDigits, Decl(temporal.ts, 1799, 16)) +>fractionalSecondDigits : Symbol(fractionalSecondDigits, Decl(temporal.ts, 1798, 16)) d.toString({ fractionalSecondDigits: 8, roundingMode: "halfExpand" }); >d.toString : Symbol(Temporal.Duration.toString, Decl(lib.esnext.temporal.d.ts, --, --)) ->d : Symbol(d, Decl(temporal.ts, 1780, 7)) +>d : Symbol(d, Decl(temporal.ts, 1779, 7)) >toString : Symbol(Temporal.Duration.toString, Decl(lib.esnext.temporal.d.ts, --, --)) ->fractionalSecondDigits : Symbol(fractionalSecondDigits, Decl(temporal.ts, 1800, 16)) ->roundingMode : Symbol(roundingMode, Decl(temporal.ts, 1800, 43)) +>fractionalSecondDigits : Symbol(fractionalSecondDigits, Decl(temporal.ts, 1799, 16)) +>roundingMode : Symbol(roundingMode, Decl(temporal.ts, 1799, 43)) // => PT60.00000000S } { const d = Temporal.Duration.from("P1DT6H30M"); ->d : Symbol(d, Decl(temporal.ts, 1805, 9)) +>d : Symbol(d, Decl(temporal.ts, 1804, 9)) >Temporal.Duration.from : Symbol(Temporal.DurationConstructor.from, Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal.Duration : Symbol(Temporal.Duration, Decl(lib.esnext.temporal.d.ts, --, --), Decl(lib.esnext.temporal.d.ts, --, --)) >Temporal : Symbol(Temporal, Decl(lib.esnext.temporal.d.ts, --, --)) @@ -6964,20 +6955,20 @@ d.toLocaleString(); // example output: '1 day 6 hours 30 minutes' >d.toLocaleString : Symbol(Temporal.Duration.toLocaleString, Decl(lib.esnext.temporal.d.ts, --, --)) ->d : Symbol(d, Decl(temporal.ts, 1805, 9)) +>d : Symbol(d, Decl(temporal.ts, 1804, 9)) >toLocaleString : Symbol(Temporal.Duration.toLocaleString, Decl(lib.esnext.temporal.d.ts, --, --)) d.toLocaleString("de-DE"); // example output: '1 Tag 6 Stunden 30 Minuten' >d.toLocaleString : Symbol(Temporal.Duration.toLocaleString, Decl(lib.esnext.temporal.d.ts, --, --)) ->d : Symbol(d, Decl(temporal.ts, 1805, 9)) +>d : Symbol(d, Decl(temporal.ts, 1804, 9)) >toLocaleString : Symbol(Temporal.Duration.toLocaleString, Decl(lib.esnext.temporal.d.ts, --, --)) d.toLocaleString("en-US", { days: "short", hours: "numeric" }); // example output: '1 day 6 hours' >d.toLocaleString : Symbol(Temporal.Duration.toLocaleString, Decl(lib.esnext.temporal.d.ts, --, --)) ->d : Symbol(d, Decl(temporal.ts, 1805, 9)) +>d : Symbol(d, Decl(temporal.ts, 1804, 9)) >toLocaleString : Symbol(Temporal.Duration.toLocaleString, Decl(lib.esnext.temporal.d.ts, --, --)) ->days : Symbol(days, Decl(temporal.ts, 1808, 31)) ->hours : Symbol(hours, Decl(temporal.ts, 1808, 46)) +>days : Symbol(days, Decl(temporal.ts, 1807, 31)) +>hours : Symbol(hours, Decl(temporal.ts, 1807, 46)) } { diff --git a/tests/baselines/reference/temporal.types b/tests/baselines/reference/temporal.types index b8c7f7790d2ea..db094a61dc0e3 100644 --- a/tests/baselines/reference/temporal.types +++ b/tests/baselines/reference/temporal.types @@ -407,26 +407,6 @@ Type Count: 2,500 >getTime : () => number > : ^^^^^^ - instant = Temporal.Instant.fromEpochMilliseconds(legacyDate); // valueOf() called implicitly ->instant = Temporal.Instant.fromEpochMilliseconds(legacyDate) : Temporal.Instant -> : ^^^^^^^^^^^^^^^^ ->instant : Temporal.Instant -> : ^^^^^^^^^^^^^^^^ ->Temporal.Instant.fromEpochMilliseconds(legacyDate) : Temporal.Instant -> : ^^^^^^^^^^^^^^^^ ->Temporal.Instant.fromEpochMilliseconds : (epochMilliseconds: number) => Temporal.Instant -> : ^ ^^ ^^^^^^^^^^^^^^^^^^^^^ ->Temporal.Instant : Temporal.InstantConstructor -> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^ ->Temporal : typeof Temporal -> : ^^^^^^^^^^^^^^^ ->Instant : Temporal.InstantConstructor -> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^ ->fromEpochMilliseconds : (epochMilliseconds: number) => Temporal.Instant -> : ^ ^^ ^^^^^^^^^^^^^^^^^^^^^ ->legacyDate : Date -> : ^^^^ - instant = legacyDate.toTemporalInstant(); // recommended >instant = legacyDate.toTemporalInstant() : Temporal.Instant > : ^^^^^^^^^^^^^^^^ diff --git a/tests/cases/compiler/temporal.ts b/tests/cases/compiler/temporal.ts index 7d5321a2d1457..8163d6cb67f17 100644 --- a/tests/cases/compiler/temporal.ts +++ b/tests/cases/compiler/temporal.ts @@ -73,7 +73,6 @@ const legacyDate = new Date("1995-12-17T03:24Z"); let instant: Temporal.Instant; instant = Temporal.Instant.fromEpochMilliseconds(legacyDate.getTime()); // => 1995-12-17T03:24:00Z - instant = Temporal.Instant.fromEpochMilliseconds(legacyDate); // valueOf() called implicitly instant = legacyDate.toTemporalInstant(); // recommended }