diff --git a/server/client.js b/server/client.js index a0c52e1e4..795b3ad48 100644 --- a/server/client.js +++ b/server/client.js @@ -4,7 +4,8 @@ const { TimeLogger } = require("../src/util"); const { R } = require("redbean-node"); const { UptimeKumaServer } = require("./uptime-kuma-server"); -const io = UptimeKumaServer.getInstance().io; +const server = UptimeKumaServer.getInstance(); +const io = server.io; const { setting } = require("./util-server"); const checkVersion = require("./check-version"); @@ -121,7 +122,8 @@ async function sendInfo(socket) { socket.emit("info", { version: checkVersion.version, latestVersion: checkVersion.latestVersion, - primaryBaseURL: await setting("primaryBaseURL") + primaryBaseURL: await setting("primaryBaseURL"), + serverTimezone: await server.getTimezone(), }); } diff --git a/server/model/maintenance.js b/server/model/maintenance.js index 3d0595a75..840267ef5 100644 --- a/server/model/maintenance.js +++ b/server/model/maintenance.js @@ -1,5 +1,5 @@ const { BeanModel } = require("redbean-node/dist/bean-model"); -const { parseTimeObject, parseTimeFromTimeObject, isoToUTCDateTime, utcToISODateTime } = require("../../src/util"); +const { parseTimeObject, parseTimeFromTimeObject, isoToUTCDateTime, utcToISODateTime, SQL_DATETIME_FORMAT, utcToLocal, localToUTC } = require("../../src/util"); const { isArray } = require("chart.js/helpers"); const { timeObjectToUTC, timeObjectToLocal } = require("../util-server"); @@ -15,9 +15,9 @@ class Maintenance extends BeanModel { let dateRange = []; if (this.start_date) { - dateRange.push(utcToISODateTime(this.start_date)); + dateRange.push(utcToLocal(this.start_date)); if (this.end_date) { - dateRange.push(utcToISODateTime(this.end_date)); + dateRange.push(utcToLocal(this.end_date)); } } @@ -92,10 +92,10 @@ class Maintenance extends BeanModel { bean.active = obj.active; if (obj.dateRange[0]) { - bean.start_date = isoToUTCDateTime(obj.dateRange[0]); + bean.start_date = localToUTC(obj.dateRange[0]); if (obj.dateRange[1]) { - bean.end_date = isoToUTCDateTime(obj.dateRange[1]); + bean.end_date = localToUTC(obj.dateRange[1]); } } diff --git a/src/languages/en.js b/src/languages/en.js index 5a959f275..d6a65b042 100644 --- a/src/languages/en.js +++ b/src/languages/en.js @@ -616,7 +616,7 @@ export default { recurringInterval: "Interval", "Recurring": "Recurring", strategyManual: "Active/Inactive Manually", - warningTimezone: "It is using your current Device/PC's timezone.", + warningTimezone: "It is using the server's timezone", weekdayShortMon: "Mon", weekdayShortTue: "Tue", weekdayShortWed: "Wed", diff --git a/src/pages/EditMaintenance.vue b/src/pages/EditMaintenance.vue index be9f7ce4d..946059cb5 100644 --- a/src/pages/EditMaintenance.vue +++ b/src/pages/EditMaintenance.vue @@ -82,7 +82,7 @@