From 0426629a59c712849570d3e29956948ae7725a4a Mon Sep 17 00:00:00 2001 From: lilihx <88191432+Lilihx@users.noreply.github.com> Date: Sat, 11 Sep 2021 20:12:51 +0800 Subject: [PATCH] feat: add ability to select file modified time format (#1536) --- frontend/src/components/files/ListingItem.vue | 3 +++ frontend/src/i18n/en.json | 1 + frontend/src/views/settings/Profile.vue | 9 ++++++++- http/auth.go | 2 ++ settings/defaults.go | 2 ++ users/users.go | 1 + 6 files changed, 17 insertions(+), 1 deletion(-) diff --git a/frontend/src/components/files/ListingItem.vue b/frontend/src/components/files/ListingItem.vue index 337a2d55..642e5454 100644 --- a/frontend/src/components/files/ListingItem.vue +++ b/frontend/src/components/files/ListingItem.vue @@ -106,6 +106,9 @@ export default { return filesize(this.size); }, humanTime: function () { + if (this.user.dateFormat) { + return moment(this.modified).format("L LT"); + } return moment(this.modified).fromNow(); }, dragStart: function () { diff --git a/frontend/src/i18n/en.json b/frontend/src/i18n/en.json index 38d66a12..2f11b7e5 100644 --- a/frontend/src/i18n/en.json +++ b/frontend/src/i18n/en.json @@ -218,6 +218,7 @@ "rules": "Rules", "rulesHelp": "Here you can define a set of allow and disallow rules for this specific user. The blocked files won't show up in the listings and they wont be accessible to the user. We support regex and paths relative to the users scope.\n", "scope": "Scope", + "setDateFormat": "Set exact date format", "settingsUpdated": "Settings updated!", "shareDuration": "Share Duration", "shareManagement": "Share Management", diff --git a/frontend/src/views/settings/Profile.vue b/frontend/src/views/settings/Profile.vue index 3c57791e..82f1b43b 100644 --- a/frontend/src/views/settings/Profile.vue +++ b/frontend/src/views/settings/Profile.vue @@ -15,6 +15,10 @@ {{ $t("settings.singleClick") }}
++ + {{ $t("settings.setDateFormat") }} +