notifications

This commit is contained in:
alma 2025-05-04 12:52:33 +02:00
parent 1aa5b08093
commit d2d2832276

View File

@ -59,7 +59,10 @@ export function Email() {
read: email.flags.seen,
starred: email.flags.flagged,
folder: email.folder
})).slice(0, 5); // Only show the first 5 emails
}))
// Sort emails by date (most recent first)
.sort((a: Email, b: Email) => new Date(b.date).getTime() - new Date(a.date).getTime())
.slice(0, 5); // Only show the first 5 emails
setEmails(transformedEmails);
setMailUrl('/courrier');
@ -78,7 +81,9 @@ export function Email() {
const date = new Date(dateString);
return new Intl.DateTimeFormat('fr-FR', {
month: 'short',
day: 'numeric'
day: 'numeric',
hour: '2-digit',
minute: '2-digit'
}).format(date);
} catch (e) {
return '';