Sort the backup files by date & time

This commit is contained in:
Adorian Doran 2024-11-19 18:07:42 +02:00
parent 22b768e5e8
commit 32a4a9c072

View File

@ -98,6 +98,13 @@ export default class BackupOptions extends OptionsWidget {
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, {
dateStyle: "medium",
timeStyle: "medium"