Date Picker
Calendar interface for selecting and formatting dates. Uses Calendar for date selection and Popover for the popup.
Installation
Install the component
templui add datepickerAdd the JavaScript to your layout
@datepicker.Script() @calendar.Script() @popover.Script()Call this template in your base layout file (e.g., in the <head> section).
Examples
With Label
Custom Placeholder
Selected Date
Disabled
Formats
With Time
Form
Select a date from the calendar.
Select a valid date
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 | | |