mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-07-27 18:12:29 +08:00
feat(tray): display recent note date as detail
This commit is contained in:
parent
495fce7594
commit
50514e2418
@ -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)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user