Dates & Time
Working with dates, times, durations, and time zones in TypeScript.
Modern lightweight
- ★ date-fns — function-per-operation, tree-shakeable. Default for most TS projects.
- ★ Day.js — Moment-compatible API in 2KB. Drop-in if you have legacy Moment code.
- Luxon — IANA time zones first-class; powerful but heavier.
The future
- ★ Temporal API — TC39 stage 3 / shipping in modern engines (V8 behind a flag, available via polyfill
@js-temporal/polyfill). Will eventually replaceDateentirely; worth learning now.
Pickers / calendar UIs
- react-day-picker — used by shadcn/ui's Calendar component. The default React date picker.
- react-aria DateField / DatePicker — accessibility-first.
- react-datepicker — older, mature.
- MUI X Date Pickers — if you're on MUI.
- vaul + react-day-picker — mobile drawer + calendar.
Time zones
@js-temporal/polyfill— full IANA support, stable API.- date-fns-tz — adds time zone support to date-fns.
- Luxon — has it built in.
Date math / scheduling
- rrule.js — RFC 5545 recurrence rules; for "every 3rd Monday" calendaring.
- ical-generator / node-ical — create / parse iCalendar.
- chrono-node — natural language date parsing ("next Tuesday").
Avoid for new code
- Moment.js — in maintenance mode; use Day.js as a drop-in or migrate to date-fns/Luxon/Temporal.
Pick this if…
- Default new project: date-fns (or Temporal polyfill if you want to lean future).
- Time-zone-heavy app: Luxon or Temporal.
- Replacing Moment without a rewrite: Day.js.
- Date picker UI: react-day-picker (especially with shadcn).