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 51b6ab3780
commit 69ef6ae51e
No known key found for this signature in database
GPG key ID: E319D3C5148D65B6

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()