feat(tray): display recent note date as detail

This commit is contained in:
Elian Doran 2025-02-01 13:23:14 +02:00
parent 495fce7594
commit 50514e2418
No known key found for this signature in database

View File

@ -126,11 +126,18 @@ function updateTrayMenu() {
LIMIT 10 LIMIT 10
`); `);
const menuItems: Electron.MenuItemConstructorOptions[] = []; const menuItems: Electron.MenuItemConstructorOptions[] = [];
const formatter = new Intl.DateTimeFormat(undefined, {
dateStyle: "medium",
timeStyle: "short"
});
for (const recentNote of recentNotes) { for (const recentNote of recentNotes) {
const date = new Date(recentNote.utcDateCreated);
menuItems.push({ menuItems.push({
label: becca_service.getNoteTitle(recentNote.noteId), label: becca_service.getNoteTitle(recentNote.noteId),
type: "normal", type: "normal",
sublabel: formatter.format(date),
click: () => openInSameTab(recentNote) click: () => openInSameTab(recentNote)
}) })
} }