Skip to main content

TimePicker

TimePicker is the inline time picker in the authoring widget set.

Its value model is intentionally simple: one hour from 0 to 23 and one minute from 0 to 59. That makes it a good fit for appointment times, reminder times, and schedule filters where the product cares about a local wall-clock time rather than a full timestamp.

Example

use fission::prelude::*;
use std::sync::Arc;

let node = TimePicker {
hour: view.state.start_hour,
minute: view.state.start_minute,
on_change: Some(Arc::new(move |hour, minute| ActionEnvelope {
id: set_start_time_id,
payload: serde_json::to_vec(&SetStartTime { hour, minute }).unwrap(),
})),
}
.build(ctx, view);

The reducer receives both parts together, which makes it easy to keep the state consistent.

Field table

FieldTypeMeaningNotes / default behavior
houru32Current hour value.Expected range is 0..=23.
minuteu32Current minute value.Expected range is 0..=59.
on_changeOption<Arc<dyn Fn(u32, u32) -> ActionEnvelope + Send + Sync>>Closure that creates the action for a changed time.Called with the new hour and minute pair.

Current value model and behavior

The checked-in TimePicker is built from two NumberInput steppers separated by a colon. It is not a free-form text parser. Incrementing and decrementing wrap naturally inside the valid hour and minute ranges.

This is good for predictable state updates, but it also means you should not expect locale-aware 12-hour text entry or seconds support from the current widget.

Product pitfalls to avoid

Keep the source of truth as structured time values, not a formatted display string. Also remember that a local wall-clock time is not the same thing as a timezone-aware instant. If your product schedules jobs globally, connect the picked hour and minute to a real date and timezone in your domain model.

DatePicker, DateRangePicker, NumberInput, and FormControl.