@dashforge/calendar-core
v1.0.0
Published
Headless calendar engine — date math, month-grid model and the useCalendar hook. Zero runtime dependencies. Shared by the Dashforge MUI and Tailwind calendar suites.
Maintainers
Readme
@dashforge/calendar-core
Headless calendar engine for Dashforge — the UI-agnostic logic layer behind the date / time / range picker suites.
It ships pure date math, the month-grid view-model, and the
useCalendar React hook. It renders nothing and styles nothing: the
@dashforge/ui (MUI) and @dashforge/tw (Tailwind) calendar suites build their
own presentation layers on top of this single source of truth.
Design contract
- Zero runtime dependencies. Date math is hand-rolled;
Dateis used only transiently and always in UTC, so results are timezone-independent. Localization uses the built-inIntlAPI. - Headless. No JSX, no styling, no DOM coupling.
useCalendarreturns a data view-model (weeks) plus action callbacks. - ISO string model. Dates are
YYYY-MM-DDstrings. Min/max comparisons rely on the fact that such strings sort chronologically under lexicographic order.
Surface
core/— pure functions:toISODate/parseISODate,getDaysInMonth,addDays/addMonths,compareISODate,buildMonthGrid,Intl-backed locale helpers, time-string parsing, keyboard key resolution.react/— theuseCalendarhook.
This package is part of the shared logic layer; it is not tied to either UI ecosystem.
