Date Time Picker
Dropdown calendar with hour, minute, and second inputs, in 12 or 24-hour cycles.
Basic
Label and help text
description renders above the field; help_text renders below it.
We will send a confirmation email immediately after booking.
Pre-selected value
Pass a NaiveDateTime or DateTime. Strings in ISO 8601 are accepted too.
Sizes
Disabled
Required selection
Set allow_deselect={false} to keep the value sticky once a date and time are picked.
Clearable
Set clearable to render a reset button inside the field. It only appears once a value is present, and clearing resets both the date and the time, dispatching a change event so phx-change bindings are notified.
Error state
Please pick a time in the future
Leading icon
Use :inner_prefix to place an icon inside the toggle border.
12-hour and 24-hour
hour_cycle controls the time interface. h12 shows an AM/PM selector; h23 uses a 24-hour clock.
Custom display format
Pass a strftime pattern to control how the selected value renders in the toggle.
Min and max
Constrain the selectable range. Calendar navigation buttons disable past the boundaries; the time inputs remain free.
Weekdays only
Use the :weekends shortcut to disable Saturdays and Sundays. Other shortcuts and tuple patterns work the same as on date_picker.
Select navigation
Month and year dropdowns jump across long horizons in one click.
Preset shortcuts
Render a sidebar of one-click jumps next to the calendar. The active preset highlights when it matches the current selection.
Confirm mode
Set close="confirm" to show Cancel and Apply buttons. The value commits only on Apply, so date and time can be tweaked together before saving.
German locale
locale drives weekday and month names plus defaults for week start and hour cycle. German pulls in h23 and a Monday week start automatically.
Form integration
Changes: %{}