Date Picker

View in Lexicon

Date and Time pickers let users select a date and time for a form.

installyarn add @clayui/date-picker
versionNPM Version
useimport DatePicker from '@clayui/date-picker';
This requires custom javascript.

Example

The DropDown content of the DatePicker consists of Header, Body and Footer. Footer: You can add elements that complement the Date Picker like the Time Picker.

Snippet

Snippet

Date Picker

Snippet

Date Picker Field

Add the class focus to the input-group-item to show the focus border.

Snippet

Date Picker Date Range

The class c-selected must be added to date-picker-col for all dates in the range.

The modifier class c-selected-start must be added to date-picker-col for the first date in the range.

The class c-selected-end must be added to date-picker-col for the last date in the range.

Snippet

Date Picker Old Markup

In Clay CSS versions 3.24.1 and below, Date Picker days and dates weren’t wrapped in an extra element date-picker-col. We added the wrapping element for highlighting a range of dates. See #3986. This old pattern is still supported, but we recommend updating your markup.

Snippet

Browser Default Input Date

Check the browser support for input[type="date"] before deciding if it’s a good fit for your application.

Snippet

Time Picker

This requires external javascript to change values of nested inputs and increment/decrement buttons. We use input type=“text” because it gives us better cross browser support for formatting numbers and text.

Time Picker 12H

:

Snippet

Time Picker 12H With Time Zone

:
(GMT+01:00)

Time Picker 12H With Time Zone and Icon

:
(GMT+01:00)

Snippet

Time Picker 24H

:

Snippet

Time Picker With Seconds and Clear

::
::

Snippet

Time Picker Focus State

Add the class focus to form-control.

:

Snippet

Time Picker Disabled State

Add the class disabled to form-control and the attribute disabled to all nested inputs and buttons. The label can also be styled in a disabled state with the class disabled.

:

Snippet

Browser Default Input Time

Check the browser support for input[type="time"] before deciding if it’s a good fit for your application.

(GMT+01:00)

Snippet

Edit this page on GitHub

Contributors

Matuzalém Teles

Last edited May 12, 2025 at 10:22:46 PM