mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-08-10 18:39:22 +08:00
Sort the backup files by date & time
This commit is contained in:
parent
22b768e5e8
commit
32a4a9c072
@ -98,6 +98,13 @@ export default class BackupOptions extends OptionsWidget {
|
|||||||
backupFiles = [{filePath: t('backup.no_backup_yet'), mtime: ''}];
|
backupFiles = [{filePath: t('backup.no_backup_yet'), mtime: ''}];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Sort the backup files by modification date & time in a desceding order
|
||||||
|
backupFiles.sort((a, b) => {
|
||||||
|
if (a.mtime < b.mtime) return 1;
|
||||||
|
if (a.mtime > b.mtime) return -1;
|
||||||
|
return 0;
|
||||||
|
});
|
||||||
|
|
||||||
const dateTimeFormatter = new Intl.DateTimeFormat(navigator.language, {
|
const dateTimeFormatter = new Intl.DateTimeFormat(navigator.language, {
|
||||||
dateStyle: "medium",
|
dateStyle: "medium",
|
||||||
timeStyle: "medium"
|
timeStyle: "medium"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user