Skip to main content

Module time_edit

Module time_edit 

Source
Expand description

TimeEdit — text input for time-of-day, bound to Signal<Option<Time>>.

Single-line editable time field with strftime-pattern parse/format and optional 12h/24h mode + AM/PM. Same compositional pattern as DateEdit (TextInputField + commit on Enter/blur + step keys), without a popover (desktop convention is no graphical time picker).

§Behaviour

  • Value binding: Signal<Option<Time>>None shows the placeholder.
  • Pattern: 24h default %H:%M; 12h is %I:%M %p. Override via format_pattern. Add seconds with seconds(SecondsMode::Editable).
  • Keyboard (preview-pass on the wrapper):
    • Arrow Up / Down → ±step_minutes
    • PageUp / PageDown → ±60 minutes
    • Shift+ on either → ×10 multiplier (×600 max so values stay sane)

§Accessibility

  • Container — Role::TimeInput with set_value formatted as HH:MM:SS and set_label from .label().
  • Underlying TextInputField keeps Role::TextInput so AT knows it’s editable.
use teksilo_core::signal::Signal;
use teksilo_widgets::time_edit::{TimeEdit, TimeFormat, SecondsMode};

let value = Signal::new(None);
let _field = TimeEdit::new(value)
    .format(TimeFormat::Hour24)
    .seconds(SecondsMode::Hidden);

Structs§

TimeEdit
Single-line editable time-of-day field.

Enums§

SecondsMode
Whether the seconds segment is shown in TimeEdit.
TimeFormat
12h vs 24h time formatting.