Update dependency @js-temporal/polyfill to v0.4.4 #277
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
0.4.3
->0.4.4
Release Notes
js-temporal/temporal-polyfill (@js-temporal/polyfill)
v0.4.4
Compare Source
Breaking changes:
Temporal.ZonedDateTime
objects are no longer supported as parameters toIntl.DateTimeFormat
formatting methods. ([12071fb
], see also Upstream PR, Upstream PR 2)Temporal.ZonedDateTime
's time zone, useTemporal.ZonedDateTime.prototype.toLocaleString
. This method:Intl.DateTimeFormat
instance in the same time zone and calendar as theTemporal.ZonedDateTime
instanceTemporal.Instant
from theTemporal.ZonedDateTime
instance.Temporal.Instant
instance using the createdIntl.DateTimeFormat
instance.Temporal.ZonedDateTime
instance:Temporal.ZonedDateTime
instance in the right time zone usingTemporal.ZonedDateTime.prototype.withTimeZone
.Temporal.Now.timeZoneId()
.Be careful when caching the current system time zone (or an
Intl.DateTimeFormat
instance using that time zone), because the system time zone can change during the lifetime of your program (e.g. when a user on a mobile device crosses a time zone boundary or when a user manually edits time zone settings).timeZone
property when creating anIntl.DateTimeFormat
instance to avoid an ambiguity about which time zone the formatted results will be in.Intl.DateTimeFormat
instances can be expensive to create. For performance-sensitive code where the same calendar and time zone are used repeatedly for formatting, we recommend creating and reusing anIntl.DateTimeFormat
instance with the desiredtimeZone
andcalendar
options, and then formatting using the value ofTemporal.ZonedDateTime.prototype.epochMilliseconds
.Intl.DateTimeFormat
instances may also require a lot of RAM, so indefinitely caching large numbers of them is not recommended for memory-constrained environments..calendar
property on Temporal types has been replaced with a.calendarId
property that returns the string calendar identifier and a.getCalendar()
method that returns an object that implementsTemporal.CalendarProtocol
.getCalendar()
will always return a new object if the containing instance was constructed using a built-in calendar identifier string. However, if the containing instance was constructed using a calendar object (either a built-in calendar or custom calendar), then the same object is returned. ([cc701b4
], see also Upstream issue)When a calendar is an object, its
id
property will be used for comparison. ([3916e54
], see also Upstream issue).calendar
property has been entirely removed fromTemporal.PlainTime
. ([0727d86
], see also Issue 1, Issue 2).timeZone
property onTemporal.ZonedDateTime
has been replaced with a.timeZoneId
property that returns the string time zone identifier and a.getTimeZone()
method that returns an object that implementsTemporal.TimeZoneProtocol
. ([d3263f0
], see also Upstream issue)getTimeZone()
will always return a new object if theTemporal.ZonedDateTime
instance was constructed using a built-in time zone identifier string.However, if the instance was constructed using a time zone object (either a built-in time zone or custom time zone), then the same object is returned.
Termporal.Now.timeZone()
is replaced byTemporal.Now.timeZoneId()
, which returns a time zone identifier string, not aTemporal.TimeZone
instance. ([600f0cc
], see also Upstream issue)When a calendar is an object, its
id
property will be used for comparison. ([d6cb286
], see also Upstream issue)id
property and make overridingtoString
optional (but recommended!) forTemporal.TimeZoneProtocol
. ([97637bb
])9b7f61a
], [0c38267
], see also Discussion)NanosecondsToDays
internal operation to be less than the length of one calendar day.This could happen due to shenanigans in a custom time zone's
getOffsetNanosecondsFor
orgetPossibleInstantsFor
methods, or a custom calendar'sdateAdd
method.([
44b00a3
], see also Upstream issue5d78c81
])fields
andmergeFields
methods forTemporal.CalendarProtocol
(custom calendar) objects. ([5ad6327
])Temporal.PlainTime
strings.Bug fixes:
fields()
method duringdateFromFields()
,yearMonthFromFields()
, andmonthDayFromFields()
.Previously, these methods only referenced hardcoded
'era'
and'eraYear'
field identifiers. ([375a4ad
])c0f7349
])d94c1cd
], see also proposal-temporal PR, Issue 1, Issue 2)BalanceTime
operations. ([9260a8a
])NanosecondsToDays
operations. ([e02f062
])NanosecondsToDays
calls don't flip sign. ([0b238cc
])Temporal.Duration
using non-numeric inputs. ([46c4132
], see also Upstream issue)CreateTemporalDuration
. ([856a546
], see also Upstream issue)RoundDuration
. ([8d3c1f1
])RoundDuration
to avoid problems when the values are larger thanNumber.MAX_SAFE_INTEGER
. ([955323f
])Temporal.PlainMonthDay
from fields, preventing the reference year from accidentally being in 1971. ([ef4a0c4
])monthDayFromFields
. ([7ebd0f9
])996f8fa
])'M01L'
and'M12L'
in the Chinese calendar. ([696f2c7
])GetNamedTimeZoneOffsetNanoseconds
. ([c42570b
])e391397
], see also Upstream issue)GetMethod
on a string calendar. ([fe698d8
], see also Upstream issue)BalanceDurationRelative
andUnbalanceDurationRelative
. ([a907acf
])Temporal.ZonedDateTime.prototype.round
. ([0d2d60e
], see also Spec PR)This change avoids a common bug where a UTC timestamp is accidentally interpreted as if it were a local time in a real time zone.
If you do want to parse the time portion of a UTC timestamp string, use:
Temporal.Instant.from(s).toZonedDateTimeISO('UTC').toPlainTime()
. ([a7a50ea
])Temporal.Duration
strings, and avoid rounding errors when nanoseconds components are present. ([58b5601
])relativeTo
string options that are neither validTemporal.PlainDate
norTemporal.ZonedDateTime
strings, such as'2022-08-18T17:01Z'
. ([4db15c4
])d88cfa4
])Temporal.TimeZoneProtocol
andTemporal.CalendarProtocol
. ([84563ce
], [755c762
], see also Discussion)Temporal.TimeZone
andTemporal.Calendar
arguments with each other, to prevent bugs likenew Temporal.ZonedDateTime(0n, cal, tz)
where the switched calendar and time zone arguments would cause exceptions to be thrown later. ([7922f1f
])Non-breaking changes:
yearOfWeek
methods that complement existingweekOfYear
methods.The new method returns the year associated with
weekOfYear
, which may (see https://en.wikipedia.org/wiki/ISO_week_date) vary fromyear
in some calendars like'iso8601'
.This new method can be useful for formatting IS0 8601 strings using the year-week-day format like
1981-W53-7
. ([bf08ca5
])Calendar and time zone annotations are now allowed to contain a "critical" flag (
'!'
) prefix.Critical flags have no effect when parsing input strings because Temporal already treats unknown or inconsistent inputs as errors by default. ([
e8b2e71
])Temporal only recognizes time zone and calendar annotations.
Unrecognized non-critical annotations will be ignored.
Unrecognized critical annotations will cause the parsing method to throw an exception.
toString()
methods forTemporal.PlainDate
,Temporal.PlainDateTime
,Temporal.PlainYearMonth
,Temporal.PlainMonthDay
, andTemporal.ZonedDateTime
to emit critical IXDTF annotations using the'critical'
option.Use this option with care, because the platform that you're communicating with may not understand this syntax.
calendarName: 'critical'
behaves likecalendarName: 'always'
andtimeZoneName: 'critical'
behaves liketimeZoneName: 'always'
, but they also output a'!'
prefix in the corresponding annotation. ([50a64f1
])Critical flags are never used by Temporal, but could be consumed by other programs.
Temporal.Instant
strings. ([b86b87f
])acd6464
])acd6464
])af87527
])New modes include
'expand'
,'halfCeil'
,'halfFloor'
,'halfTrunc'
, and'halfEven'
.([
eb5404d
])9e730d6
])globalThis
. ([73a0bf3
], see also GitHub Issue)Temporal.Calendar
methods to return 0. ([8a49023
])Temporal.PlainMonthDay
. ([e1cd417
])6d124a5
], see also Upstream issue, Spec change)BalanceISODate
. ([d2a23dd
])Temporal.TimeZone.prototype.getNextTransition()
for dates that predate 1847, which is the earliest data in the IANA time zone database. ([9591af3
])3b61abf
])GetPreviousTransition
. ([5922bdf
])Other:
c65455a
])6b462d4
], see also GitHub PR)Configuration
📅 Schedule: Branch creation - "every weekend" in timezone Asia/Tokyo, Automerge - At any time (no schedule defined).
🚦 Automerge: Enabled.
♻ Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.