Skip to content

Commit

Permalink
fix: assert >= 14 on num days not given day (#4986)
Browse files Browse the repository at this point in the history
The assert was probably meant to ensure the complete year has at least
14 days, and not that the given day is at least the 14th day of the year

Fixes: #4977
  • Loading branch information
iyzana authored Jun 4, 2024
1 parent 3a64209 commit e83fd9b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion components/datetime/src/input.rs
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ impl ExtractedDateTimeInput {
"iso_weekday",
))?;
// We don't have any calendars with < 14 days per year, and it's unlikely we'll add one
debug_assert!(day_of_year_info.day_of_year >= icu_calendar::week::MIN_UNIT_DAYS);
debug_assert!(day_of_year_info.days_in_year >= icu_calendar::week::MIN_UNIT_DAYS);
debug_assert!(day_of_year_info.days_in_prev_year >= icu_calendar::week::MIN_UNIT_DAYS);
#[allow(clippy::unwrap_used)]
let week_of = calculator
Expand Down

0 comments on commit e83fd9b

Please sign in to comment.