Fusuma

Components / Date and time

step_time

The time after a step: part moved by delta (hours by one, minutes by MINUTE_STEP), wrapping round (23 to 0, and 55 to 0 without moving the hour).

The time after a step: part moved by delta (hours by one, minutes by MINUTE_STEP), wrapping round (23 to 0, and 55 to 0 without moving the hour).

Signature

pub const fn step_time(hour: u8, minute: u8, part: TimePart, delta: i32) -> (u8, u8)

Example

use fusuma::{TimePart, step_time};
assert_eq!(step_time(9, 30, TimePart::Hour, 1), (10, 30));
assert_eq!(step_time(23, 30, TimePart::Hour, 1), (0, 30));
assert_eq!(step_time(9, 55, TimePart::Minute, 1), (9, 0));

All components · Source