Skip to content

Date Time Input

@astryxdesign/core v0.7.1 · DateTimeInput

DateTimeInput Props ​

NameTypeDefaultDescription
v-modelstring | nullnullYYYY-MM-DDTHH:MM. Null until both parts exist.
labelstring—Required accessible name of the pair.
placeholderstring—Placeholder for the date field.
hourFormat'12h' | '24h''12h'Display format of the time. The model stays ISO.
presentation'popover' | 'bottom-sheet' | 'native' | 'adaptive-bottom-sheet' | 'adaptive-native' | 'text-input'—How both halves open. bottom-sheet, and adaptive-bottom-sheet on a coarse pointer, use one bottom sheet with Date and Time tabs. text-input applies only to the time. Omitted means a popover on a fine pointer and the platform controls on a coarse pointer. An explicit value wins over nativePicker.
isLabelHiddenbooleanfalseHides the label visually while keeping it accessible. labelHidden is the older name; either one hides it.
containerClassstring | object | array—Class for the field container. Has no effect, and warns in development, inside InputGroup and in a horizontal-labels FormLayout.
containerStyleStyleValue—Inline style for the field container. Same targeting as containerClass.
controlClassstring | object | array—Class for the bordered control box. A class written on the component lands here too.
controlStyleStyleValue—Inline style for the bordered control box.
hasClearbooleanfalseClears the date and the time together.
min / maxstring—ISO bounds for the time portion.
size'sm' | 'md' | 'lg''md'Height of both fields.
statusFieldStatusInput—Error, warning, or success for the pair.
statusVariant'attached' | 'detached' | 'tooltip''attached'Where the status message sits.
isDisabledbooleanfalseDisables both fields.
disabledMessagestring—Explains why both fields are disabled. With isDisabled, the message shows in a tooltip on hover or keyboard focus and both halves stay focusable with aria-disabled.
hasSecondsbooleanfalseIncludes seconds in the time half. The model then uses YYYY-MM-DDTHH:MM:SS. The system time control cannot express seconds, so the Astryx time field is kept.
timeIncrement1 | 5 | 10 | 15 | 301Minute step for the arrow keys in the time half. A non-default value keeps the Astryx time field.
timeOptionInterval5 | 10 | 15 | 30 | 60—Minute cadence of preset times. Setting it opens a list of times under the clock icon, trimmed to the min and max time of day, and keeps the Astryx time field even in native modes.
timeLabelstringTime / 时间Accessible name of the time half.
timePlaceholderstringSelect a timePlaceholder of the time half when no time is set.
dateConstraintsArray<(date: Date) => boolean>—On the date half, a day is disabled when any function returns false.
numberOfMonths1 | 2—Months shown side by side in the date calendar.
weekStartsOn0-6 | 'sun' | 'mon' | ...—First day of the week in the date calendar.
nativePicker'touch' | 'always' | 'never'—Older surface name, passed to both the date and the time.
isLoadingbooleanfalseNeither field can be edited.
changeAction(value) => void | Promise<void>—Runs once both the date and the time exist. A promise keeps the pair busy. Clearing runs it too.
isOptionalboolean—Marks the label as optional.
isRequiredboolean—Marks the pair required.
labelTooltipstring—Hint shown from the info icon at the end of the label.