icu4x icon indicating copy to clipboard operation
icu4x copied to clipboard

`Date::day_of_week` is a bad name

Open robertbastian opened this issue 2 months ago • 2 comments

This method returns a Weekday, i.e. Monday/Tuesday. This is a different concept from "day of week", where Monday can be day 1 or day 2.

We should rename to Date::weekday and deprecate the current method.

robertbastian avatar Nov 07 '25 13:11 robertbastian

I think the name is because CLDR calls it "day of week", similar to "day of month" and "day of year"

https://unicode.org/reports/tr35/tr35-dates.html#dfst-day

But since the type it returns is called Weekday we could call the method weekday too. 🤷

sffc avatar Nov 08 '25 22:11 sffc

CLDR calls this "Day of week name", which is not the same as the other field it calls "local day of week number/name".

robertbastian avatar Nov 10 '25 10:11 robertbastian

Seems like this is at least partially resolved. Robert to determine if this is done and close if so.

Manishearth avatar Dec 19 '25 21:12 Manishearth