Date Picker
Renders a date picker, time picker, or both. The input associated to each control acts as a facade, the final value is stored in an underlying hidden input, called a data locker.
Examples
Date Picker
Time Picker
Date & Time Picker
Locale and timezone handling
The date picker handles timezone and locale preferences automatically. Locale preferences will provide the date format for the region. The timezone setting is used to convert the chosen value to a uniform timezone, commonly UTC. These features are not enabled by default and require adding <meta />
tags to the page.
When a date is selected, it will be converted from the backend-timezone
to the app-timezone
for normalized storage.
NOTE: Locale values are supplied by the Moment.js library.
Supported data attributes
data-control="datepicker"
- enables the plugin on an elementdata-format="YYYY-MM-DD"
- display formatdata-min-date="value"
- minimum date to allowdata-max-date="value"
- maximum date to allowdata-year-range="10"
- range of years to display
JavaScript API
Copyright © 2025 Winter CMS