@khorshid-js/core
v0.1.0
Published
Headless, zero-dependency date picker core with first-class Jalali (Persian) & Gregorian calendar support.
Maintainers
Readme
@khorshid-js/core
The headless engine of Khorshid, a date picker with Jalali (Persian), Gregorian and Hijri calendars. It handles calendars, locales, selection state, formatting and input masking. It has no runtime dependencies and never touches the DOM.
npm install @khorshid-js/coreimport { createPicker } from '@khorshid-js/core';
const picker = createPicker({ locale: 'fa-IR', mode: 'single' });
picker.subscribe(() => {
const grid = picker.getGrid(); // title, weekdays, weeks: DayCell[][]
console.log(grid.title.label); // 'فروردین ۱۴۰۵'
});
picker.on('change', ({ value }) => console.log(value));Each DayCell comes with its label in locale digits and its flags already computed (today, selected, inRange, disabled, and so on), so a UI only has to map cells to elements.
Most apps should install khorshid, which bundles every layer behind one import. Use the scoped packages when you want only some of them.
MIT
