gpui_kit/datetime/mod.rs
1//! Date and time selection over a calendar this crate does not own.
2//!
3//! There is no calendar system, no time zone database, no locale, and no
4//! notion of today anywhere in this module. All of it arrives through
5//! [`DateAdapter`], which the host implements over whatever date library it
6//! already depends on. `docs/datetime.md` says what a host has to supply and
7//! why the seam is here rather than lower down.
8//!
9//! - [`Calendar`] — a month grid, keyboard navigation, blocked days with the
10//! host's reasons, and a today ring only when there is a today.
11//! - [`DateInput`] — a field with that calendar in a popover. Text the adapter
12//! will not read stays in the field and publishes invalid.
13//! - [`RangePicker`] — two ends, where incomplete is a state and an end before
14//! a start is a report rather than a swap.
15//! - [`TimeInput`] — hour, minute, and optionally second, over the host's own
16//! clock.
17
18pub mod adapter;
19pub mod calendar;
20pub mod date_input;
21#[cfg(feature = "fixtures")]
22pub mod fixture;
23pub mod range;
24pub mod time_input;
25
26pub use adapter::{
27 Clock, DateAdapter, Day, MonthCell, MonthGrid, MonthKey, Selectability, SharedDateAdapter,
28 TimeOfDay,
29};
30pub use calendar::{Calendar, CalendarEvent, DayMark};
31pub use date_input::{DateInput, DateInputEvent};
32pub use range::{BlockedDay, BlockedReport, DayRange, RangePicker, RangePickerEvent, RangeState};
33pub use time_input::{Segment as TimeSegment, TimeInput, TimeInputEvent};