mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-05-23 17:19:37 +02:00
Use long month date format (#26666)
GitOrigin-RevId: 8a52bca6e13087f43d14ed1caffb7709ccee4e02
This commit is contained in:
@@ -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)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -614,8 +614,13 @@ describe('<UserNotifications />', 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)
|
||||
)
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user