@khorshid-js/dom
v0.1.0
Published
Beautiful, themeable vanilla-JS date picker UI (Jalali & Gregorian) built on @khorshid-js/core.
Maintainers
Readme
@khorshid-js/dom
The vanilla-JS date picker UI for Khorshid, with Jalali, Gregorian and Hijri calendars. It is built on @khorshid-js/core and needs no framework.
npm install @khorshid-js/domimport { createDatePicker } from '@khorshid-js/dom';
import '@khorshid-js/dom/styles.css';
// On an <input>: a masked field with a popup (a bottom sheet on small screens).
const picker = createDatePicker('#birthday', { locale: 'fa-IR' });
picker.on('change', ({ value }) => console.log(value.date?.iso));
// On any other element: an always-visible calendar.
createDatePicker('#calendar', { mode: 'range', months: 2, locale: 'en-US-gregorian' });@khorshid-js/core is a regular dependency and is imported, not bundled. To load the package from a plain <script type="module"> without a bundler, map @khorshid-js/core with an import map. For a script tag with no setup at all, use @khorshid-js/element.
Most apps should install khorshid, which bundles every layer behind one import. Use the scoped packages when you want only some of them.
MIT
