Skip to content

About

A simple date library built on Temporal

Resources

Contributing

Stars

1 star

Watchers

0 watching

Forks

Repository files navigation

Native Dates

A thin date library built on the browser's Temporal and Intl APIs

  • Obvious Time Types - Makes Temporals canon of irregular words a simple DateTime, CalendarDate, Time and Duration so things read like English at callsites
  • Browser-Native I18N - Time zones, daylight transitions and calendar math handled exactly as the browser specifies (and committee adjudicated) not the library
  • Immutability - Prevents js pitfalls of accidental date mutations when working with copies
  • Legibility - Natural phrases ('1h 30m', today().plus(2, 'days').at('9am')) and Intl presets
  • Fully Tree Shakeable - ~7kb bt for core, everything arbitary is a plugin (day.js style)

Usage

This library is fully built ontop of Temporal and Intl API so correctness is a standard-committees problem not a GitHub Issue.

The library also makes it incredibly easy to ju-jitsu between DateTime, Time, Duration etc by chaining

standup.in('Asia/Tokyo').as('time');

Browser Compatibility

This library is compatible with latest Chrome, Internet Explorer, Firefox, and Safari Technical Preview.

For those needing Safari support before Spring 2027 (when this lands in baseline) or for other reasons use the included polyfill in @native-dates/polyfill

Packages

Package Description
native-dates The core date library
@native-dates/plugins Plugins like (zones, loose, legacy-date)
@native-dates/polyfill Required for Safari/iOS until Spring 2027. temporal-polyfill only when globalThis.Temporal is absent
@native-dates/core Alias of native-dates

License

ISC

About

A simple date library built on Temporal

Resources

Contributing

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages