Socket
Socket
Sign inDemoInstall

@js-temporal/polyfill

Package Overview
Dependencies
2
Maintainers
3
Versions
9
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

0.4.4

Diff

ptomato
published 0.4.3 •

Changelog

Source

0.4.3

Bug fixes:

  • Fix an off-by-one error when dates in the Hebrew calendar were created using monthCode, the year was a leap year, and the month was after the leap month ([f3d0ca9f])
  • Fix addition of months and years for lunisolar calendars ([4f8b04c1])
  • Fix the ISO8601 representation of years between 1 BCE and 999 BCE ([b251dc0e]).
  • Fix a bug causing time to appear to go backwards for a small number of milliseconds ([bb59ca97])
  • Always validate ISO8601 time components as well as date components ([34662a05])
  • Fix comparison of dates that might have a differing number of hours in their respective days ([a4c60241])
  • Include calendar reference information when calendarName='always' is passed to various Temporal toString method's options bags ([54fcc4f3])
  • Fix a nonconformant use of the relativeTo property bag ([9992f9b1])
  • Fix ZonedDateTime.prototype.withPlainTime(null) to throw a TypeError, instead of treating it as midnight ([ec2b0546])
  • Fix parsing of some valid Instant strings when they would be out of range before considering the UTC offset ([d9de9e74])
  • Bail out early in non-ISO calendar implementations to avoid an infinte loop when calculating the duration between two identical dates. ([6f3c42c9])
  • Fix type resolution when using TypeScript Node16 and transpiling to CJS ([9bab0eb5], see also the relevant TypeScript issue)

Non-breaking changes:

  • Consistently call observable operations with undefined options arguments, instead of empty objects ([297b8f38])
jameswr
published 0.4.2 •

Changelog

Source

0.4.2

This version is a patch version enabling TypeScript Node16 support for this package.

Bug Fixes:

  • Add types to exports/./import to support Typescript Node16 ([304c86dd])
jameswr
published 0.4.1 •

Changelog

Source

0.4.1

This version is a patch version enabling polyfill compatibility with Safari versions <15.1 (October 2021 and earlier).

Bug fixes:

  • Remove erroneous options from Safari's Intl.DateTimeFormat resolvedOptions bag. The underlying bug in Safari was fixed in Safari 15.1.
jameswr
published 0.4.0 •

Changelog

Source

0.4.0

This version roughly corresponds with all the changes made to the Temporal polyfill as of the January 2022 TC39 Plenary meeting.

Breaking changes:

  • Use JSBI instead of big-integer for Big Integer math operations. If your codebase does not need to polyfill BigInt, consider using the JSBI Babel plugin to transpile these operations to native BigInt.
  • Reject plain date-only strings ([b733c213], see also Spec PR, proposal-temporal polyfill PR)
  • Reject '-000000' as an extended year value ([670cda6b], see also Spec PR)
  • Add missing branding checks for Calendar and Timezone classes to match spec changes ([670cda6b], see also Spec PR)

Bug fixes:

Non-breaking changes:

  • Rename public ...FromFields types ([3554d7f1])
  • Add validation for hard-coded Era data in Calendar.ts ([08e84c9f])
  • Improve code in Calendar.ts to handle calendar with a constant era but a variable number of months in a year ([ef8c588b])
  • Add an optional calendar to PlainTime, PlainDateTime, and PlainMonthDay ([f8837367], see also Spec PR)
  • Only require a year in Gregorian calendar implementations, not a full date ([02aec1c3])
  • Include valueOf in the Temporal.Duration type ([b1dd7eb3])
  • Expand the types allowed to be used as TimezoneLike and CalendarLike to match the spec ([9d54c646])
  • Improve worse-case performance when finding Timezone transition points by over 1000X! ([e70d6324])
  • Change Calendar.fields to return an Array, not an Iterable ([3145c6c4], see also Spec PR)

Other:

  • Update build dependencies ([500b4c97])
  • Run tests against Node 17 on CI ([db63e22a])
jameswr
published 0.3.0 •

Changelog

Source

0.3.0

This version roughly corresponds with all the changes made to the Temporal polyfill as of the October 2021 TC39 Plenary meeting.

Breaking changes:

  • Timezones now require a getOffsetNanosecondsFor method, and no longer fall back to the intrinsic definition (previously provided by Temporal.Timezone#getOffsetNanosecondsFor) if not provided. ([08346dc5], see also proposal-temporal polyfill PR)
  • Disallow Z designators when parsing strings for Plain Temporal types ([f3f8a994], see also Spec PR)
  • Allow ISO strings with "Z" + a bracketed IANA name ([70bd9898], see also Spec PR)
  • Emit ES2020 builds for newer browsers, and emit ES5 for older browsers. ([2331468d], [9e95c62b])
  • Temporal.Duration constructor will now throw if given a non-integer ([9df5d068], see also Spec PR)
  • Remove support for sub-minute offsets in ISO strings ([766e5037], see also Spec PR, Spec PR)
  • Throw TypeError on missing options from Duration.total ([4ec075f0], see also Spec PR)
  • Reject non-integer Duration fields in Duration.with() ([e6b2488d], see also Spec PR)
  • Ensure an Object is returned from calendar.mergeFields() ([4e63f25f], see also Spec PR)

Bug fixes:

  • Fix GetFormatterParts for Firefox Nightly ([47f9132f])
  • Fix TS types of RoundTo and TotalOf ([3008a670])
  • Fix crash setting day outside current JPN era ([6d3588c3], see also proposal-temporal polyfill PR)
  • Copy options object for PlainYearMonth.{add,subtract} and InterpretTemporalDateTimeFields to prevent user-modified objects from interfering with later operations. ([bafa1bdf], see also Spec PR)
  • Validate input to Calendar.prototype.fields ([7ebc700e], see also Spec PR)
  • Stop observably calling into getPossibleInstantsFor in InterpretISODateTimeOffset ([5448e59f], see also Spec PR)
  • Call CalendarEquals correctly ([07ea694e], see also proposal-temporal polyfill PR)
  • Fix arithmetic issues when using non-ISO months ([079a3325], see also proposal-temporal polyfill PR)
  • Regex: tighten matching of month and day values in datesplit ([b5736546], see also proposal-temporal polyfill PR)
  • Fix TS types for required CalendarProtocol methods ([0ee4581f], see also proposal-temporal polyfill PR)

Non-breaking changes:

  • Various #round and #total methods now accept string parameters or options bags. Strings are interpreted as the smallestUnit option (or unit for Temporal.Duration#total). ([068e801f], see also Spec PR)
  • Add @@toStringTag to TS types ([41ab6bc0])
  • Accept string Calendar names in PlainMonthDay and PlainYearMonth constructors ([27b4c7e8])
  • Make options optional in Calendar method TS types ([3a09d00d])
  • Align implementation of RoundDuration with adjusted spec text ([4a0d0264], see also Spec PR)

Other:

  • Bump various dependencies ([47701107], [f5427de9], [310d9d8b])
  • Allow launching and debugging tests (both Demitasse and Test262 suites) from the VSCode debug panel ([960d9b76], [7f7c19a1], [4ec6568e], [edcc668b])
  • Run the Test262 test suite against this polyfill, for various configurations of the resulting build artifact ([2331468d], [666c69da], [429273ec], [ff937782], [f885253f])
  • Remove various pieces of unused code, and add CI testing to detect unused code in PR review ([67f9f6bb], [63bdfcd1])
  • Drop the dependency on es-abstract ([d24575f2], [ad7e2e3a], [5b1bc5e2])
  • The polyfill's source was ported to TypeScript ([12e4d529], [ac78fd9d], [53f32e0f], [06b806c9], [66fdc765], [50b1c34b], [4724b017], [947a8a5e], [fdbf7e01], [fa60af6a], [da753f2f], [f4db8b0b], [4a38420d])
  • Document the release process for this polyfill ([c55818b6])
ptomato
published 0.2.0 •

ptomato
published 0.1.0 •

ptomato
published 0.0.0 •

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc