BlueGit

ict rusty-teams

fix(app): English post-time labels after rebase onto English UI

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

metis Daniel Däschle · pushed by metis

Authored 2026-10-07 · 7 weeks ago

Hash
185bf2c8d674a4bded9e8fd174b33b449a0e453d
Parent
67a71411
1 file changed +7 −7
crates/app/src/format.rs +7 −7
@@ -89,13 +89,13 @@ pub fn post_time_label(time: DateTime<Utc>, today: NaiveDate, offset: FixedOffse
89 89 if days_ago <= 0 {
90 90 clock.to_string()
91 91 } else if days_ago == 1 {
92 format!("Gestern {clock}")
92 format!("Yesterday {clock}")
93 93 } else if days_ago <= WEEKDAY_WINDOW_DAYS {
94 94 format!("{} {clock}", weekday_label(local.weekday()))
95 95 } else if day.year() == today.year() {
96 format!("{} {clock}", local.format("%d.%m."))
96 format!("{} {clock}", local.format("%b %-d"))
97 97 } else {
98 format!("{} {clock}", local.format("%d.%m.%y"))
98 format!("{} {clock}", local.format("%b %-d, %Y"))
99 99 }
100 100 }
101 101
@@ -211,12 +211,12 @@ mod tests {
211 211 #[test]
212 212 fn post_time_adds_the_day_when_not_today() {
213 213 assert_eq!(post_time_label(utc(7, 13), today(), zero()), "13:05");
214 assert_eq!(post_time_label(utc(6, 9), today(), zero()), "Gestern 09:05");
215 assert_eq!(post_time_label(utc(5, 13), today(), zero()), "Mo 13:05");
214 assert_eq!(post_time_label(utc(6, 9), today(), zero()), "Yesterday 09:05");
215 assert_eq!(post_time_label(utc(5, 13), today(), zero()), "Mon 13:05");
216 216 let september = Utc.with_ymd_and_hms(2026, 9, 30, 8, 42, 0).unwrap();
217 assert_eq!(post_time_label(september, today(), zero()), "30.09. 08:42");
217 assert_eq!(post_time_label(september, today(), zero()), "Sep 30 08:42");
218 218 let last_year = Utc.with_ymd_and_hms(2020, 5, 22, 8, 42, 0).unwrap();
219 assert_eq!(post_time_label(last_year, today(), zero()), "22.05.20 08:42");
219 assert_eq!(post_time_label(last_year, today(), zero()), "May 22, 2020 08:42");
220 220 }
221 221
222 222 #[test]
@@ -89,13 +89,13 @@ pub fn post_time_label(time: DateTime<Utc>, today: NaiveDate, offset: FixedOffse
89 if days_ago <= 0 {
89 if days_ago <= 0 {
90 clock.to_string()
90 clock.to_string()
91 } else if days_ago == 1 {
91 } else if days_ago == 1 {
92 format!("Gestern {clock}")
92 format!("Yesterday {clock}")
93 } else if days_ago <= WEEKDAY_WINDOW_DAYS {
93 } else if days_ago <= WEEKDAY_WINDOW_DAYS {
94 format!("{} {clock}", weekday_label(local.weekday()))
94 format!("{} {clock}", weekday_label(local.weekday()))
95 } else if day.year() == today.year() {
95 } else if day.year() == today.year() {
96 format!("{} {clock}", local.format("%d.%m."))
96 format!("{} {clock}", local.format("%b %-d"))
97 } else {
97 } else {
98 format!("{} {clock}", local.format("%d.%m.%y"))
98 format!("{} {clock}", local.format("%b %-d, %Y"))
99 }
99 }
100}
100}
101
101
@@ -211,12 +211,12 @@ mod tests {
211 #[test]
211 #[test]
212 fn post_time_adds_the_day_when_not_today() {
212 fn post_time_adds_the_day_when_not_today() {
213 assert_eq!(post_time_label(utc(7, 13), today(), zero()), "13:05");
213 assert_eq!(post_time_label(utc(7, 13), today(), zero()), "13:05");
214 assert_eq!(post_time_label(utc(6, 9), today(), zero()), "Gestern 09:05");
214 assert_eq!(post_time_label(utc(6, 9), today(), zero()), "Yesterday 09:05");
215 assert_eq!(post_time_label(utc(5, 13), today(), zero()), "Mo 13:05");
215 assert_eq!(post_time_label(utc(5, 13), today(), zero()), "Mon 13:05");
216 let september = Utc.with_ymd_and_hms(2026, 9, 30, 8, 42, 0).unwrap();
216 let september = Utc.with_ymd_and_hms(2026, 9, 30, 8, 42, 0).unwrap();
217 assert_eq!(post_time_label(september, today(), zero()), "30.09. 08:42");
217 assert_eq!(post_time_label(september, today(), zero()), "Sep 30 08:42");
218 let last_year = Utc.with_ymd_and_hms(2020, 5, 22, 8, 42, 0).unwrap();
218 let last_year = Utc.with_ymd_and_hms(2020, 5, 22, 8, 42, 0).unwrap();
219 assert_eq!(post_time_label(last_year, today(), zero()), "22.05.20 08:42");
219 assert_eq!(post_time_label(last_year, today(), zero()), "May 22, 2020 08:42");
220 }
220 }
221
221
222 #[test]
222 #[test]