diff --git a/crates/common/src/notifications/mod.rs b/crates/common/src/notifications/mod.rs index 4088e8a47..8f2faf734 100644 --- a/crates/common/src/notifications/mod.rs +++ b/crates/common/src/notifications/mod.rs @@ -645,7 +645,7 @@ impl Notification { Self::AccountEnabled => "You can sign in to it again.".to_owned(), Self::DeletionScheduled { purge_after } => format!( "It will be deleted for good on {}, with everything SourceOrigin knows about you. Until then, signing in lets you restore it.", - purge_after.format("%-d %B %Y") + purge_after.format("%-d %B %Y UTC") ), Self::AccountRestored => "It is no longer scheduled for deletion.".to_owned(), Self::NewDeviceSignIn => "A browser that had never signed in to your account did. If it was you, there is nothing to do. If it wasn’t, open this notification and select “This wasn’t me”, or sign out everywhere from the link in its email.".to_owned(), diff --git a/crates/ui/src/settings/timeline.rs b/crates/ui/src/settings/timeline.rs index 5a114d162..8ea6b08b1 100644 --- a/crates/ui/src/settings/timeline.rs +++ b/crates/ui/src/settings/timeline.rs @@ -216,7 +216,7 @@ impl HistoryRow<'_> { HistoryEntry::NotificationPreferenceChanged(preference) => preference.change(), HistoryEntry::DeletionScheduled { purge_after } => format!( "Account deletion scheduled for {}", - purge_after.format("%-d %b %Y") + Precision::Day.write(*purge_after) ), HistoryEntry::AccountRestored => "Account restored".to_owned(), HistoryEntry::CompromiseReported { .. } => { @@ -580,3 +580,37 @@ impl<'a> Undo<'a> { } } } + +#[cfg(test)] +mod tests { + //! What history entries say. + use super::*; + use chrono::TimeZone; + + /// A scheduled deletion writes its date as every other date is written: + /// day-first, in UTC. + #[test] + fn a_scheduled_deletion_says_its_date_in_utc() { + let purge_after = Utc + .with_ymd_and_hms(2026, 12, 3, 9, 30, 0) + .single() + .expect("a moment"); + let scheduled = HistoryEntry::DeletionScheduled { purge_after }; + let row = HistoryRow { + id: EventId::new(), + occurred_at: Utc::now(), + entry: &scheduled, + actor: HistoryActor::Account, + reportable: false, + reason: None, + client: None, + ip: None, + device: None, + erased: false, + }; + assert_eq!( + row.describe(&Holdings::default()), + "Account deletion scheduled for 3 Dec 2026 UTC" + ); + } +}