Skip to content

Commit 79ceeb1

Browse files
committed
Settings: Apply custom time zone under App Passwords and Services photoprism#4952
Signed-off-by: Michael Mayer <[email protected]>
1 parent e811422 commit 79ceeb1

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

frontend/src/component/settings/apps.vue

+5-4
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,7 @@ export default {
284284
showPassword: false,
285285
minLength: this.$config.get("passwordLength"),
286286
maxLength: 72,
287+
timeZone: this.$config.getTimeZone(),
287288
rtl: this.$isRtl,
288289
action: "",
289290
confirmAction: "",
@@ -365,25 +366,25 @@ export default {
365366
}
366367
367368
if (!Number.isInteger(d)) {
368-
return DateTime.fromISO(d).toLocaleString(DateTime.DATE_SHORT);
369+
return DateTime.fromISO(d, { zone: this.timeZone }).toLocaleString(DateTime.DATE_SHORT);
369370
} else if (d <= 0) {
370371
return "";
371372
}
372373
373-
return DateTime.fromSeconds(d).toLocaleString(DateTime.DATE_SHORT);
374+
return DateTime.fromSeconds(d, { zone: this.timeZone }).toLocaleString(DateTime.DATE_SHORT);
374375
},
375376
formatDateTime(d) {
376377
if (!d) {
377378
return "";
378379
}
379380
380381
if (!Number.isInteger(d)) {
381-
return DateTime.fromISO(d).toLocaleString(DateTime.DATETIME_SHORT);
382+
return DateTime.fromISO(d, { zone: this.timeZone }).toLocaleString(DateTime.DATETIME_SHORT);
382383
} else if (d <= 0) {
383384
return "";
384385
}
385386
386-
return DateTime.fromSeconds(d).toLocaleString(DateTime.DATETIME_SHORT);
387+
return DateTime.fromSeconds(d, { zone: this.timeZone }).toLocaleString(DateTime.DATETIME_SHORT);
387388
},
388389
scopeInfo(s) {
389390
let info = memoizeOne(auth.Scopes)()[s];

frontend/src/page/library/errors.vue

-1
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,6 @@ import * as formats from "options/formats";
151151
import PLoading from "component/loading.vue";
152152
import PActionMenu from "component/action/menu.vue";
153153
import PConfirmDialog from "component/confirm/dialog.vue";
154-
import { TIMESTAMP_LONG_TZ } from "options/formats";
155154
156155
export default {
157156
name: "PPageErrors",

frontend/src/page/settings/services.vue

+2-1
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,7 @@ export default {
165165
isDemo: this.$config.get("demo"),
166166
isPublic: this.$config.get("public"),
167167
config: this.$config.values,
168+
timeZone: this.$config.getTimeZone(),
168169
readonly: this.$config.get("readonly"),
169170
settings: new Settings(this.$config.values.settings),
170171
model: {},
@@ -222,7 +223,7 @@ export default {
222223
223224
const time = d.Time ? d.Time : d;
224225
225-
return DateTime.fromISO(time).toLocaleString(DateTime.DATE_FULL);
226+
return DateTime.fromISO(time, { zone: this.timeZone }).toLocaleString(DateTime.DATE_FULL);
226227
},
227228
load() {
228229
Service.search({ count: 2000 }).then((r) => (this.results = r.models));

0 commit comments

Comments
 (0)