Date Picker Changelog
Notable changes to @pglejzer/datepicker-ui, newest first. It is the companion of timepicker-ui, and the date picker docs describe the current API. The package follows Semantic Versioning.
Version 1.0.0
Added
- Three surfaces: a docked popover, a modal dialog and an inline calendar (
ui.inline).ui.displayMode: "auto"picks docked or modal from the viewport size - A range picker in a modal opens full screen on small windows.
ui.fullscreensets the width limit, orfalseturns it off - Selection modes through
calendar.mode:single,rangeandmultiple.calendar.multiple.maxcaps the number of days - Range length limits with
calendar.range.minLengthandcalendar.range.maxLength, and ready-made ranges withcalendar.range.presets - Month and year pickers with
calendar.precision, where the value isYYYY-MMorYYYY - Several months side by side with
calendar.months.calendar.pageBysets whether the arrows move one month or a whole view - Typed input with a switch between the calendar and the text field, controlled by
ui.viewSwitchandui.initialView.ui.maskformats typed digits toui.format ui.endInputturns a range into two page inputs, Start and End- Disabled days through
calendar.minDate,calendar.maxDate,calendar.disabledDates,calendar.enabledDates,calendar.disabledWeekdaysandcalendar.isDateDisabled calendar.decorateDateadds a class, a badge or an accessible label to a day, andcalendar.renderDateputs content such as a price inside the day cellcalendar.validatemarks the field invalid with your own message and never blocks a pick or a commit- The
errorevent carries acode, and for unavailable dates areasonsuch asmin,max,disabledorweekday ui.startViewopens the picker on the day, month or year panel. Grid options:ui.fixedWeeks,ui.outsideDays,ui.weekNumbers,ui.todayButton,ui.clearButtonandui.footer- Themes
basic,m3-green,crane,crane-straight,m2,glassmorphic,pastel,ai,cyberpunkandblueprint, set withui.theme ui.colorSchemeacceptslight,darkandauto.autochecks the background behind the input, then the pagecolor-scheme, then the OScalendar.localedrivesIntlmonth and weekday names, the headline and the input format, andcalendar.weekStartsets the first day. Numbers show in the locale's digits, and right-to-left layouts are supported- The day grid follows the WAI-ARIA date picker pattern with full keyboard support, and a live region announces month and selection changes
- With
prefers-reduced-motion: reduce, slides and resizes give way to short fades - An input with a
namesubmits ISO values through a hidden input. The visible input getsinputandchangeevents on commit, and a form reset restores the initial value - Methods
create,open,close,destroy,getValue,setValue,setOptionsandsetActiveEnd, pluson,onceandoff, whereonandoncereturn an unsubscribe function - Static methods
DatepickerUI.getById,DatepickerUI.getAllInstancesandDatepickerUI.destroyAll - Events
open,close,cancel,confirm,update,error,select:day,select:month,select:year,navigate,range:startandrange:end, each with a matchingcallbacks.on*option - A second entry,
@pglejzer/datepicker-ui/kit, exports the surface hosts, surface-mode rules, color-scheme detection and date text helpers for companion packages - No runtime dependencies, and the package imports safely during server rendering
- ESM, CommonJS, TypeScript declarations and a UMD build for CDNs
Changed
- Check before upgrading: 1.0.0 is a full rewrite, so nothing from 0.0.1 carries over. The README describes the current API.
- Options are grouped into
calendar,ui,labels,behaviorandcallbacks, andsetOptions()updates them at runtime - The picker markup uses
dp-ui__*class names, and custom CSS needs to target them - Styling tokens are
--dp-ui-*custom properties - The CSS ships as
index.css(core and every theme),main.css(core only) and one file per theme, such astheme-m3-green.css