Datepicker

A date, a range, a week, a month, a quarter or a year, picked from a panel or typed into the field.

Basic

A DatePicker opens a month calendar under the field and fills it with the day you click.

Picker modes

Set picker to week, month, quarter or year to pick a coarser unit than a single day.

Sizes

Set size to small, medium or large to match the height of the fields around the picker.

Variants

Set variant to outlined, filled, text, underlined, borderless or bare to match the other fields in your form. text fills on hover and while focused, and bare draws nothing at all.

Status

Set status to error or warning to flag a date that needs attention.

Disabled

Set disabled to lock the field so it cannot be opened.

Range

DatePicker.RangePicker picks a start and an end date from one panel and highlights the days between them.

Open-ended range

Set allowEmpty on a RangePicker to let either end stay blank, like a filter with only a start or only an end date.

Partly disabled range

Pass disabled a pair on a RangePicker to lock one end while the other stays editable.

Multiple

Pass multiple to collect several separate dates in one field, with maxTagCount="responsive" folding the overflow into a count.

Show time

Add showTime to pick a time along with the date, on a single DatePicker or on both ends of a RangePicker.

Presets

Pass presets to add one-click shortcuts beside the calendar, like Last 7, 30 and 90 days on a RangePicker.

Disabled date

Pass disabledDate a callback that returns true for days that cannot be picked, like weekends for a delivery date.

Linked start and end

Set maxDate on the start field and minDate on the end field from each other's value, so the end never comes before the start.

Need confirm

Set needConfirm to add an OK button to a plain date picker, or needConfirm={false} to commit a date and time without one.

Cell render

Pass cellRender to draw your own calendar cells, like colored dots under days with events, and return info.originNode for the rest.

API Reference

Common API
The props DatePicker and RangePicker both take. Rows marked antuikit in the Version column are added by the kit.
Methods
The methods on the ref of both pickers.
DatePicker
DatePicker's props.
DatePicker[picker=year]
DatePicker's props with picker set to year.
DatePicker[picker=quarter]
DatePicker's props with picker set to quarter.
DatePicker[picker=month]
DatePicker's props with picker set to month.
DatePicker[picker=week]
DatePicker's props with picker set to week.
RangePicker
RangePicker's props. Rows marked antuikit in the Version column are added by the kit.