DatePicker / Calendar: no time-of-day support (datetime picker)
Summary
DatePicker / Calendar can only represent a date. There is no way to pick or display a time of day, so applications that edit DATETIME / TIMESTAMP-like values have to hand-roll the time part and keep it in sync with CalendarState.
Environment
gpui-kit/gpui-component/gpui-base0.6.1 (latest on crates.io as of 2026-09)gpui-pre0.3.5- Windows (x86_64-pc-windows-gnu)
Current behavior / evidence
gpui_base::calendar::DateisSingle(Option<NaiveDate>) | Range(Option<NaiveDate>, Option<NaiveDate>)— the controlled value ischrono::NaiveDateonly.gpui_component::timeonly exposescalendaranddate_picker; there is noTimePickerand noNaiveTimeusage anywhere in the crate.DatePickerState::date_formatdefaults to"%Y/%m/%d"; there is no time format / precision option.
Use case
A database management GUI. When the user edits a MySQL DATETIME / TIMESTAMP cell, the picker must set YYYY-MM-DD HH:MM:SS. DatePicker can pick the day but not the time, and Calendar has no time affordance, so we currently compose Calendar with our own time spinner + validation.
Possible solutions (any one would unblock this)
- Add a standalone
TimePicker(hour / minute / second, 12/24h, stepper and/or text input) that apps can compose with the existingCalendar. - Add optional time support to
DatePickerState— e.g. aNaiveDateTime-basedDatevariant, pluswith_time/time_format/ precision options and time columns in the popup. - At minimum, document that the picker is date-only and that time is expected to be supplied by the app.
Note from the workaround
When composing Calendar inside an app-drawn popup, the calendar root uses track_focus, so a mouse-down moves focus to the calendar and blurs whatever input the app is editing (in our case an in-cell editor that commits on blur). We had to add capture_any_mouse_down(|_, window, _| window.prevent_default()) on the popup to keep focus in the editor. A future TimePicker would ideally not steal focus from its trigger by design.
Source: longbridge/gpui-component