This commit is contained in:
Greg Burri 2025-04-19 12:17:07 +02:00
parent fdbf2e4f27
commit 475024a97b

View file

@ -207,8 +207,11 @@ impl Tr {
format!("{}-{}", self.lang.code, self.lang.territory)
}
// Return the first day of the week for the current language.
// See https://en.wikipedia.org/wiki/Week#First_day_of_the_week.
pub fn first_day_of_week(&self) -> Weekday {
match (self.lang.code.as_ref(), self.lang.territory.as_ref()) {
// TODO: Add more languages: https://en.wikipedia.org/wiki/Week.
("en", "US") => Weekday::Sun,
_ => Weekday::Mon,
}