From 56b6dae44742ffadc9a640c86ad40f386b3ed10f Mon Sep 17 00:00:00 2001 From: Adorian Doran Date: Tue, 10 Dec 2024 17:13:58 +0200 Subject: [PATCH] client: refactor --- src/public/app/widgets/type_widgets/options/backup.js | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/public/app/widgets/type_widgets/options/backup.js b/src/public/app/widgets/type_widgets/options/backup.js index 35cd4b829..d6f8648b7 100644 --- a/src/public/app/widgets/type_widgets/options/backup.js +++ b/src/public/app/widgets/type_widgets/options/backup.js @@ -1,7 +1,8 @@ +import { formatDate } from "../../../utils/formatters.js" import { t } from "../../../services/i18n.js"; +import OptionsWidget from "./options_widget.js"; import server from "../../../services/server.js"; import toastService from "../../../services/toast.js"; -import OptionsWidget from "./options_widget.js"; const TPL = `
@@ -115,15 +116,10 @@ export default class BackupOptions extends OptionsWidget { return 0; }); - const dateTimeFormatter = new Intl.DateTimeFormat(navigator.language, { - dateStyle: "medium", - timeStyle: "medium" - }); - for (const {filePath, mtime} of backupFiles) { this.$existingBackupList.append($(` - ${(mtime) ? dateTimeFormatter.format(new Date(mtime)) : "-"} + ${(mtime) ? formatDate(new Date(mtime)) : "-"} ${filePath} `));