Skip to content

temporal-polyfill@1.0.1

Latest

Choose a tag to compare

@arshaw arshaw released this 19 Jun 01:46
· 1 commit to main since this release

✨ Features

  • Tree-shakeable API 🌳 See docs
  • Uses native Temporal when available (prior versions never did)
  • New /implementation and /shim entrypoints for finer control over native vs. polyfilled. See docs
  • Smaller global bundle: 20,212 B → 19,594 B (-3%)
  • Conformance
    • Conformance with latest spec (June 2026)
    • Accurate method descriptors: function.length and non-constructable
    • Better non-ISO calendar system conformance — calendar math is now algorithmic where possible instead of relying on faulty Intl-scraped data (credit to @internationalized/date). Requires different entrypoints. See Upgrade Notes below

💥 Breaking

  • iso8601 and gregory work as before, but other calendars now need a different entrypoint. See Upgrade Notes below
  • Raised minimum browser support; BigInt now required. See support matrix
  • Raised minimum Node.js support to 16
  • Dropped CJS; ESM and global IIFE only
  • global.min.js is no longer in the NPM package, but remains on the jsdelivr CDN (like this), which auto-minifies

🛠️ Upgrade Notes

If you use any of the following calendar systems, please use the /full/ entrypoints now: buddhist, chinese, coptic, dangi, ethiopic, ethioaa, hebrew, indian, islamic-civil, islamic-tbla, islamic-umalqura, japanese, persian, and roc.

- import 'temporal-polyfill/global'
+ import 'temporal-polyfill/full/global'

- import { Temporal } from 'temporal-polyfill'
+ import { Temporal } from 'temporal-polyfill/full'

🐛 Bugfixes

  • Temporal.Duration.round() no longer throws for zero durations with relativeTo (#87)
  • Temporal.Duration.prototype.total() now returns 0 for blank durations with relativeTo instead of throwing (#55)
  • Temporal.Duration.from() no longer double-rounds huge subsecond values, fixing false out-of-range errors and microsecond stringification (#92)
  • Day rounding no longer drops tiny sub-day remainders on large Temporal.Duration / Temporal.PlainDateTime diffs, so ceil rounds up correctly when just past a whole day (#84)
  • Temporal.PlainMonthDay.prototype.toLocaleString() no longer includes the internal reference year in date styles (#75)
  • Temporal.PlainDate.prototype.withCalendar() now keeps the correct Buddhist month for historical ISO dates like 1582-01-01 (#74)
  • Intl.DateTimeFormat.prototype.formatToParts() now formats polyfilled Temporal.PlainTime in Node 22 instead of throwing TypeError: Cannot use valueOf (#95)
  • Temporal.ZonedDateTime.from() now accepts Brazilian wall times near close-together 2000 offset transitions, e.g. America/Noronha and America/Boa_Vista (#73)
  • Temporal.ZonedDateTime.from() no longer clamps future offset calculations, preserving the +02:00 summer offset for future Europe/Berlin dates like 2044-06-10 (#49)

🔢 Version Number

This first real 1.0 release is numbered 1.0.1 because 1.0.0 was accidentally published as a blank package years ago (related to #88).