Skip to content

Date Time Field

Edit a civil date and wall-clock time without timezone conversion.

Usage

Local schedule

Commit a civil date and wall-clock time without applying a timezone conversion.

Scheduled forAug 22, 2026 · 9:30 AM

Controlled

Let the parent own the current value and apply accepted changes back to the component.

Scheduled forAug 22, 2026 · 9:30 AM

Examples

Cross midnight

Keep a local schedule valid when its end time falls on the next civil day.

Scheduled forAug 22, 2026 · 11:45 PM

API

Vue package: @sectile/vue/temporal/date-time-field

Components
  • DateTimeField

Props

DateTimeFieldProps

defaultValue

Initial value used when the component owns its state.

disabled

Whether interaction is unavailable.

label

Accessible name announced for the control.

modelValue

Current value when state is controlled by the parent.

native

Whether to use the browser native date or time input UI.

policies

Behavior policies that customize validation, movement, or selection.

readonly

Whether the value can be inspected but not changed.

required

Whether the control must contain a valid value before submission.

Other types

DateTimeValue

ts
type DateTimeValue = NonNullable<DateTimeFieldOptions['value']>

DateTimeFieldValueChangeHandler

ts
type DateTimeFieldValueChangeHandler = (value: DateTimeValue | null) => void

Parts

Shared scope: [data-scope="date-time-field"]. Combine it with a part selector to keep styles local to this component.

PartSelectorRoleExtra attributes
input[data-part="input"]Accepts the editable value or draft.

Keyboard interaction

KeyBehavior
Arrow Up / Arrow DownIncrement or decrement the active value segment.
EnterCommit the draft value.
EscapeCancel the draft and restore the accepted value.

Accessibility

The labeled input preserves native text entry while exposing date and time validation as one value.

Released under the MIT License.