- Category
- Developer Tools
- Rank
- No. 932Tools index
- Pricing
- Open Source
- Type
- TOOL
- Builder
- dmtrkovalenko
- GitHub
- 754 stars
- Latest release
- v3.2.1
- Date
About
Abstraction layer over common JavaScript date libraries — same API whether you swap in Moment, Luxon, date-fns, or Day.js underneath.
What it does
date-io gives date and time UI libraries a typed contract for parsing, formatting, comparison, arithmetic, locale handling, ranges, and calendar views. Each adapter preserves the native date type expected by the consuming project.
Why it's ranked here
The project solves a concrete interoperability problem for component authors who must support several date ecosystems. Its broad contract, locale-aware formatting, timezone support, and alternative-calendar packages make it more substantial than a thin conversion wrapper.
What's good
The contract covers practical picker needs: validation, comparisons, date arithmetic, week and month grids, localized input formats, meridiem labels, and date-time merging. Adapters use optional peer dependencies, so users only bundle the date library they select.
Tradeoffs
Behavior is not perfectly uniform across adapters. Localized output varies by locale and underlying library, and Luxon cannot provide format helper text. Library authors must install, version-lock, and re-export every adapter they promise to support.
How to use it well
Use it when building reusable date or time controls that should respect each consumer's chosen date library and native value type. Register one adapter through application context or dependency injection. It supplies date operations, not the visual controls themselves.
Technical notes+
package.json defines a private Lerna-style workspace over packages/*, with Jest coverage, parallel builds, Rollup, and TypeScript tooling. packages/core/IUtils.d.ts declares the generic DateIOFormats and IUtils contracts, including conditional null handling, locale typing, comparisons, arithmetic, formatting, and calendar-array helpers. packages/core/dev-utils.js centralizes ESM and CommonJS Rollup configuration, externalizes non-relative imports, and targets ES6. packages/dayjs/src/index.ts, packages/hijri/src/index.ts, and packages/luxon/src/index.ts each expose their adapter as the default export; their rollup.config.js files consume the shared build factory.
Observed
- License
- MIT
- Primary language
- TypeScript
- Interface
- JavaScript and TypeScript library packages distributed through npm
- Packaging
- Private workspace root with packages under packages/*
- Adapters documented
- date-fns, Moment, Luxon, Day.js, js-joda, date-fns-jalali, Jalaali, and Hijri
- Build outputs
- Shared Rollup configuration produces ESM and CommonJS modules targeting ES6
- Type surface
- Generic date and locale contract with parsing, formatting, comparison, arithmetic, and calendar helpers
Read from README.md, package.json, packages/core/IUtils.d.ts, packages/core/dev-utils.js, packages/dayjs/rollup.config.js, packages/hijri/rollup.config.js, packages/luxon/rollup.config.js, packages/moment/rollup.config.js, packages/jalaali/rollup.config.js, packages/js-joda/rollup.config.js, packages/date-fns/rollup.config.js, packages/date-fns-jalali/rollup.config.js, packages/dayjs/src/index.ts, packages/hijri/src/index.ts, packages/luxon/src/index.ts.
What it can do
Provide unified date manipulation API
JavaScript code using different date libraries → Consistent API interface regardless of underlying library
Switch between date libraries without code changes
Configuration specifying date library (Moment, Luxon, date-fns, Day.js) → Same functionality with different underlying implementation
Format dates consistently across libraries
Date object and format specification → Formatted date string
Parse date strings uniformly
Date string and optional format pattern → Date object
Perform date calculations with consistent API
Date object and calculation parameters (add/subtract time) → Modified date object
Compare dates across different library implementations
Two date objects → Boolean comparison result
Tags
Tech Stack
Comments (0)
No comments yet
Editorially curated, with community endorsements as a secondary signal. Corrections welcome.
