Skip to content

temporal-polyfill@1.0.7

Choose a tag to compare

@arshaw arshaw released this 04 Nov 03:38
· 56 commits to main since this release

🎉 6 Million Weekly Downloads

temporal-polyfill has passed 6 million downloads a week! Thank you to everyone using it, reporting issues and sending fixes.

📉 Size Wins

  • Smaller global IIFE bundles after min+gzip, mainly from smaller string parsing:
    • Basic (global.js): 19,450 → 19,172 bytes (−1.4%)
    • Full (full/global.js): 23,280 → 23,020 bytes (−1.1%)

🐛 Bugfixes

Wider usage has brought reports of more rare cases, so most of these fixes are for corner cases.

  • FIX: Pre-1970 values round to the correct boundary in Instant#round, Instant#toString and ZonedDateTime#toString (#110, #117, #111). Thx @vera-rubin
  • FIX: ZonedDateTime until/since and function API diffs reject equal instants in different time zones for date units (#112)
  • FIX: Temporal strings with malformed or misplaced annotations are rejected, such as 2024-10-03[] (#119)
  • FIX: ZonedDateTime.from accepts in-range values near the Instant limits, such as a Z string at either end (#120)
  • FIX: Two offset changes close together in a time zone keep the offset between them, such as Africa/Casablanca in Ramadan, and getTimeZoneTransition finds both (#121)
  • FIX: Temporal.Now uses UTC when the host reports no system time zone through Intl (#122)
  • FIX: ZonedDateTime#withPlainTime picks the earlier occurrence of a repeated hour, regardless of the current offset (#123)
  • FIX: Unminified builds no longer compute a debug string for every object on Node and similar hosts, which makes creating objects faster there (#116)
  • FIX: Better correctness in these other areas:
    • Rounding, including halfEven ties with a roundingIncrement, Duration#toString with negative or very large values, and -0 results
    • Repeated and skipped times in ZonedDateTime and the function API, such as until/since, round and startOf*/endOf*
    • String validation, including UTC offsets, discarded offsets, non-ISO calendars and withCalendar/withTimeZone arguments
    • Dates at the limits of the supported range
    • Function API agreement with the class API, with and without native Temporal
    • getTimeZoneTransition search, and Chinese and Dangi leap-month arithmetic