Fusuma

Components / Date and time

time_picker

A time picker showing hour (0 to 23) and minute (0 to 59).

Try it

This is the Pickers page of the gallery, running in your browser: time_picker is on it, and it is the real widget. Press Run, then use it.

Live: Pickers, where time_picker is usedOpen full size

Also on this pagecalendaraccordionsplit_viewselecttree_item

A time picker showing hour (0 to 23) and minute (0 to 59). on_step makes a message of the part and the direction (-1 or +1); the app moves the time with step_time.

Signature

pub const fn time_picker<M>( hour: u8, minute: u8, on_step: fn(TimePart, i32) -> M, ) -> TimePicker<M>

Example

use fusuma::{TimePart, time_picker};
let view = time_picker(9, 30, |part, dir| (part == TimePart::Hour, dir));
let built = fusuma::doc::built::<(bool, i32), _>(&view);
assert!(built.texts().contains(&"09"));

All components · Source