Skip to content

About

A simple date library built on Temporal

Resources

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 by the platform not the library
  • Immutability - Prevents pitfalls from JS date math that modifies antecedents
  • 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 (ranges, tokens, relative, 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

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages