fix: replace deprecated call to time::util::days_in_year_month

This commit is contained in:
ThetaDev 2024-12-13 04:04:43 +01:00
parent 45388090c4
commit 85ca573926

View file

@ -13,7 +13,7 @@ pub fn shift_months(date: Date, months: i32) -> Date {
}
let month = Month::try_from(month as u8).unwrap();
let month_days = time::util::days_in_year_month(year, month);
let month_days = month.length(year);
day = day.min(month_days);
Date::from_calendar_date(year, month, day).unwrap()