Date Picker
Calendar interface for selecting and formatting dates. Uses Calendar for date selection and Popover for the popup.
Installation
Load the script once in your layout:
Load the script once in your layout:
Examples
With Label
Custom Placeholder
Selected Date
Range
Disabled
Formats
With Time
Form
Select a date from the calendar.
API Reference
DatePicker
Main date picker component that triggers the popover calendar.
| Name | Type | Default |
|---|---|---|
Unique identifier for the date picker component | | |
Additional CSS classes to apply to the trigger button | | |
Additional HTML attributes to apply to the trigger button | | |
Current selected date value | | |
Display format for the selected date | | |
BCP 47 Locale Tag for language and regional format | | |
Optional start of week passed to Calendar component. When nil, Calendar defaults to Monday. Use calendar.Sunday through calendar.Saturday constants. | | |
Placeholder text when no date is selected | | |
Whether the date picker is disabled | | |
Whether the date picker should display error styling | | |
Name attribute for the hidden input field | | |
Selection mode. Use calendar.SelectionModeRange for two-date range selection. | | |
Range end date (range mode only). | | |
Name attribute for the range end hidden input (range mode only). | | |
Placeholder for the range end date (range mode only). | | |