From 6a56c64d9ab8d3e45fba3a0f59f00dafd2ea8bf3 Mon Sep 17 00:00:00 2001 From: Rebeka Dekany <50901361+rebekadekany@users.noreply.github.com> Date: Tue, 1 Jul 2025 13:48:29 +0200 Subject: [PATCH] Use long month date format (#26666) GitOrigin-RevId: 8a52bca6e13087f43d14ed1caffb7709ccee4e02 --- .../components/notifications/groups/confirm-email.tsx | 10 ++++++++-- .../project-list/components/notifications.test.tsx | 7 ++++++- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/services/web/frontend/js/features/project-list/components/notifications/groups/confirm-email.tsx b/services/web/frontend/js/features/project-list/components/notifications/groups/confirm-email.tsx index 364e60fd3a..93386ff9a3 100644 --- a/services/web/frontend/js/features/project-list/components/notifications/groups/confirm-email.tsx +++ b/services/web/frontend/js/features/project-list/components/notifications/groups/confirm-email.tsx @@ -73,6 +73,12 @@ const EMAIL_DELETION_SCHEDULE = { '2025-09-03': '2025-03-03', } +const dateOptions: Intl.DateTimeFormatOptions = { + month: 'long', + day: 'numeric', + year: 'numeric', +} + // Emails that remain unconfirmed after 90 days will be removed from the account function getEmailDeletionDate(emailData: UserEmailData, signUpDate: string) { if (emailData.default) return false @@ -95,9 +101,9 @@ function getEmailDeletionDate(emailData: UserEmailData, signUpDate: string) { ) if (currentDate >= notificationStartDate) { if (currentDate > emailDeletionDate) { - return new Date().toLocaleDateString() + return new Date().toLocaleDateString(undefined, dateOptions) } - return emailDeletionDate.toLocaleDateString() + return emailDeletionDate.toLocaleDateString(undefined, dateOptions) } } } diff --git a/services/web/test/frontend/features/project-list/components/notifications.test.tsx b/services/web/test/frontend/features/project-list/components/notifications.test.tsx index 9a845283d7..8813566a2e 100644 --- a/services/web/test/frontend/features/project-list/components/notifications.test.tsx +++ b/services/web/test/frontend/features/project-list/components/notifications.test.tsx @@ -614,8 +614,13 @@ describe('', function () { unconfirmedUserData, signUpDate ) + const dateOptions: Intl.DateTimeFormatOptions = { + month: 'long', + day: 'numeric', + year: 'numeric', + } expect(emailDeletionDate).to.equal( - new Date('2025-09-03').toLocaleDateString() + new Date('2025-09-03').toLocaleDateString(undefined, dateOptions) ) })