@ecosy/datekit
v0.1.0
Published
A headless, framework-agnostic date engine with immutable day-level operations, lazy calendar grid generation, and quarter-based year navigation
Downloads
14
Maintainers
Readme
@ecosy/datekit
A headless, framework-agnostic date engine with immutable day-level operations, lazy calendar grid generation, and quarter-based year navigation.
Features
- Dateify — Extended
Datesubclass with formatting, timezone, and leap year support - Dayify — Immutable day-level wrapper with pre-computed properties and comparison
- Monthify — Calendar grid generator with adjacent-month padding and week-start config
- Yearify — Year-level manager with quarter access and lazy month generation
Installation
yarn add @ecosy/datekitQuick Start
import { Dateify, Dayify, Monthify, Yearify } from '@ecosy/datekit';
// Date formatting
const date = Dateify.from(2026, 3, 24);
date.format(); // "03/24/2026, 12:00:00 AM"
date.toISODate(); // "2026-03-24"
date.isLeapYear(); // false
// Day operations
const today = new Dayify();
today.isWeekend; // false
today.next(); // tomorrow
// Calendar grid
const cal = new Monthify(2026, 3);
const { weeks } = cal.getCalendar();
// weeks: Dayify[][] (rows of 7)
// Year overview
const year = new Yearify(2026);
year.months; // Monthify[12]
year.getQuarter(1); // [Jan, Feb, Mar]Subpath Imports
import { Dateify } from '@ecosy/datekit/dateify';
import { Monthify } from '@ecosy/datekit/monthify';Documentation
Full API reference and guides: docs.ecosy.io
License
MIT
