icu4x
icu4x copied to clipboard
week_of_month seems to be broken
I added a test in week_of as follows:
// The 1st is a Monday and the week starts on Sundays.
assert_eq!(
simple_week_of(IsoWeekday::Sunday, 26, IsoWeekday::Friday),
4
);
but it returns week 1 instead of 4.
CC @mildgravitas, can you take a look at this?
CC @robertbastian -- please triage this.
@Manishearth could you take a look?
I don't really understand the week_of code! (I did not write it, nor was I the primary reviewer)
I could but it would take a while.
Having a look.
The bug is that this is wrong
https://github.com/unicode-org/icu4x/blob/d686c87ad094f9750f5cf6e42e2287076e590de9/components/calendar/src/week_of.rs#L323-L324