Function yonsei_flexible::calc::calc_total_exceed
source · Examples found in repository?
src/calc.rs (line 15)
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
pub fn calc_work_time(interval: Interval) -> HMS {
if interval.start_time < HMS::new(6, 0, 0) {
panic!("start time must be after 6:00");
}
if interval.end_time >= HMS::new(24, 0, 0) {
panic!("end time must be before 24:00");
}
let mut work_time = interval.end_time - interval.start_time;
let (total_exceed, _, _) = calc_total_exceed(interval);
work_time = work_time - total_exceed;
if work_time > HMS::new(12, 0, 0) {
work_time = HMS::new(12, 0, 0);
}
work_time
}