This commit is contained in:
nobody 2024-08-23 22:12:20 +02:00 committed by murmeldin
parent 7c8c13a609
commit 233a263b89
5 changed files with 19 additions and 18 deletions

View file

@ -89,7 +89,7 @@ fn nth_weekday_of_month(year: i32, month: u32, week_day: Weekday, nth: i32) -> O
}
while date.month() == month {
dates.push(date);
date = date + Duration::weeks(1);
date += Duration::weeks(1);
}
// get the right one
let index = if nth < 0 { dates.len() as i32 + nth } else { nth - 1 } as usize;