pub fn get_shift_info(
date: NaiveDate,
config: &ShiftCycleConfig,
team_phase_offset: u32,
) -> ShiftInfoExpand description
Get full shift info (date, day of cycle, cycle index, shift type) in one call.
Returns ShiftInfo which includes everything you typically need:
use shift_algorithm::cycle::default_config;
use shift_algorithm::get_shift_info;
use chrono::NaiveDate;
let config = default_config();
let today = NaiveDate::from_ymd_opt(2026, 5, 22).unwrap();
let info = get_shift_info(today, &config, 0);
println!("{} · 第 {}/{} 天",
info.shift_type.full_label(),
info.day_of_cycle,
config.cycle_length,
);
assert_eq!(info.date, today);
assert!(info.day_of_cycle >= 1);
assert!(info.day_of_cycle <= 42);
assert_eq!(info.cycle_index + 1, info.day_of_cycle);