DatePicker

molecules

Calendar date picker with 24h time support. Replaces jQuery UI datepicker.

ARIA Role: dialog

Demo

Demo for DatePicker (molecules)

Calendar date picker with 24h time support. Replaces jQuery UI datepicker.

Props

PropTypeRequiredDefaultDescription
valueDateNoSelected date
onChange(date: Date) => voidYesDate change handler
minDateDateNoMinimum selectable date
maxDateDateNoMaximum selectable date
disabledbooleanNofalseDisabled state
labelstringNoField label
errorstringNoValidation error message

TypeScript Interface

interface DatePickerProps {
  value?: Date;
  onChange: (date: Date) => void;
  minDate?: Date;
  maxDate?: Date;
  disabled?: boolean;
  label?: string;
  error?: string;
}

Assertions (NASA Rule 5)

  • [aria]Input must have aria-haspopup='dialog'(WAI-ARIA APG)
  • [aria]Calendar grid uses role='grid' with role='gridcell' days(WAI-ARIA APG)
  • [keyboard]Arrow keys navigate dates, PageUp/Down change month(WCAG 2.1.1)
  • [validation]min/max must be valid ISO 8601 dates(ISO 8601)

Usage

Import

import { Datepicker } from '@epasslive/design-system'

Basic

<Datepicker />

With Variants

<Datepicker variant="primary" size="md" />