Add configurable server timezone

This commit is contained in:
Louis Lam
2022-10-09 20:59:58 +08:00
parent b007681e67
commit a36f24d827
7 changed files with 66 additions and 13 deletions

View File

@@ -1,10 +1,10 @@
<template>
<div>
<form class="my-4" @submit.prevent="saveGeneral">
<!-- Timezone -->
<!-- Client side Timezone -->
<div class="mb-4">
<label for="timezone" class="form-label">
{{ $t("Timezone") }}
{{ $t("Display Timezone") }}
</label>
<select id="timezone" v-model="$root.userTimezone" class="form-select">
<option value="auto">
@@ -20,6 +20,22 @@
</select>
</div>
<!-- Server Timezone -->
<div class="mb-4">
<label for="timezone" class="form-label">
{{ $t("Server Timezone") }}
</label>
<select id="timezone" v-model="settings.serverTimezone" class="form-select">
<option
v-for="(timezone, index) in timezoneList"
:key="index"
:value="timezone.value"
>
{{ timezone.name }}
</option>
</select>
</div>
<!-- Search Engine -->
<div class="mb-4">
<label class="form-label">

View File

@@ -101,7 +101,7 @@ class Logger {
}
module = module.toUpperCase();
level = level.toUpperCase();
const now = new Date().toISOString();
const now = dayjs.tz(new Date()).format();
const formattedMessage = (typeof msg === "string") ? `${now} [${module}] ${level}: ${msg}` : msg;
if (level === "INFO") {
console.info(formattedMessage);

View File

@@ -116,7 +116,7 @@ class Logger {
module = module.toUpperCase();
level = level.toUpperCase();
const now = new Date().toISOString();
const now = dayjs.tz(new Date()).format();
const formattedMessage = (typeof msg === "string") ? `${now} [${module}] ${level}: ${msg}` : msg;
if (level === "INFO") {