Skip to content

DatePicker

A date picker supporting four types — single date, date range, month, and datetime — with keyboard operation and Intl.DateTimeFormat formatting.

Basic Selection

Basic usage (type=date)

Click the input to open the date panel; click a date to select it and close.

Date Range

Date range (type=daterange)

A double-month grid: pick the start first, then the end; submits a JSON array ["start","end"]. Hovering previews the range.

Month Selection

Month (type=month)

Datetime

Datetime (type=datetime)

Pick the date and hour/minute/second, then click "确定" to submit.

Disabled Range

min / max limits

Out-of-range dates are not selectable.

Custom Format

Custom format

The format supports yyyy/MM/dd/HH/mm/ss tokens.

Controlled & Events

Controlled + oas-change event

Disabled

Disabled

API

Attributes

AttributeDescriptionTypeDefault
disabledDisabledboolean
formatDisplay format tokens (yyyy/MM/dd/HH/mm/ss)string
maxSelectable range (ISO dates)string
minSelectable range (ISO dates)string
placeholderPlaceholder text
typeType: date / daterange / month / datetimestringdate
valueCurrent value: yyyy-MM-dd / yyyy-MM / yyyy-MM-ddTHH:mm:ss / JSON range arraystring

Events

EventDescription
oas-changeValue change, detail: { value } (string array for daterange)

Keyboard: Enter / to open, /// to move within the grid, Enter to select, Esc to close.