DateTimePicker puts a date and a time picker side by side with one Date value, as a replacement for <input type="datetime-local">. Picking a date keeps the time and the other way round; min and max limit the time on the boundary day too.

Mission starts

Pick a date and a time

Props

DatePicker

  • labelstring

    Label text.

  • valueDate | null

    Selected date.

  • onChange(date: Date) => void

    Called with the picked date.

  • minDate

    Earliest selectable date.

  • maxDate

    Latest selectable date.

  • placeholderstring
    Default: 'Select date'

    Text when no date is chosen.

  • errorstring

    Error message shown below the control; sets the invalid style.

  • localestring

    Locale for formatting.

  • weekStartsOn0 | 1
    Default: 0

    First day of the week.

DateTimePicker

  • labelReactNode

    Label for the date and time pair.

  • valueDate | null

    Date and time.

  • onChange(date: Date) => void

    Called with a new Date holding the picked date and time.

  • minDate

    Earliest date and time (the time limit applies on that day only).

  • maxDate

    Latest date and time (the time limit applies on that day only).

  • stepnumber
    Default: 900

    Minute granularity of the time list, in seconds.

  • hour12boolean
    Default: false

    12-hour clock with AM / PM.

  • errorstring

    Error message shown below the control; sets the invalid style.

  • datePlaceholderstring
    Default: 'Select date'

    Text when no date is chosen.

  • timePlaceholderstring
    Default: 'Select time'

    Text when no time is chosen.

  • localestring

    Locale for formatting.

  • weekStartsOn0 | 1
    Default: 0

    First day of the week.

Related hooks and theme:useDismissable