Datepicker

A reusable validation component for date selection with integrated error handling and extensive customization options.

Examples

Basic usage

Please select a date

Properties

Name Type Required Description
@validationField string Yes The field name in the changeset for validation.
@changeset ImmerChangeset Yes The changeset object for form validation.
@multipleDatesSeparator string No The separator to use when multiple dates are selected. Defaults to ' - '.
@label string No The label for the input field.
@onChange function No The action to be called when the date changes.
@onClose function No The action to be called when the datepicker closes.
@disabled boolean No Whether the input field is disabled.
@mandatory boolean No To indicate if input is mandatory.
@placeholder string No The placeholder text for the input field.
@clearButton boolean No Whether to show a button to clear the input field.
@todayButton boolean No Whether to show a button to select today's date.
@closeButton boolean No Whether to show a button to close the datepicker.
@minDate Date No The minimum selectable date.
@maxDate Date No The maximum selectable date.
@keepOpen boolean No Whether to keep the datepicker open after selection.
@daysOfWeekDisabled Array<number> No An array of day numbers to disable (0-6, where 0 is Sunday).
@disabledDates Array<Date> No An array of dates to disable.
@viewMode string No The initial view mode of the date picker. Can be 'clock', 'calendar', 'months', 'years', or 'decades'.
@locale string No The locale to be used for date formatting.
@dateFormat string No The format for displaying the selected date.
@promptTimeOnDateChange boolean No Whether to prompt the time when the date changes.
@noCalendar boolean No Whether to hide the calendar.
@enableTime boolean No Whether to show the time picker.
@stepping number No The stepping of the time picker.
@enableSecond boolean No Whether to show the second picker.
@disabledTimeIntervals Array No An array of time intervals to disable.
@disabledHours Array<number> No An array of hours to disable.
@enabledHours Array<number> No An array of hours to enable.