mirror of
https://github.com/louislam/uptime-kuma.git
synced 2025-08-02 19:46:26 -04:00
Fix Same As Server Timezone
do not save correctly
This commit is contained in:
parent
72c16c3aa2
commit
f0beccf6bf
2 changed files with 7 additions and 6 deletions
|
@ -47,7 +47,8 @@ class Maintenance extends BeanModel {
|
|||
cron: this.cron,
|
||||
duration: this.duration,
|
||||
durationMinutes: parseInt(this.duration / 60),
|
||||
timezone: await this.getTimezone(),
|
||||
timezone: await this.getTimezone(), // Only valid timezone
|
||||
timezoneOption: this.timezone, // Mainly for dropdown menu, because there is a option "SAME_AS_SERVER"
|
||||
timezoneOffset: await this.getTimezoneOffset(),
|
||||
status: await this.getStatus(),
|
||||
};
|
||||
|
@ -153,7 +154,7 @@ class Maintenance extends BeanModel {
|
|||
bean.description = obj.description;
|
||||
bean.strategy = obj.strategy;
|
||||
bean.interval_day = obj.intervalDay;
|
||||
bean.timezone = obj.timezone;
|
||||
bean.timezone = obj.timezoneOption;
|
||||
bean.active = obj.active;
|
||||
|
||||
if (obj.dateRange[0]) {
|
||||
|
@ -316,7 +317,7 @@ class Maintenance extends BeanModel {
|
|||
}
|
||||
|
||||
async getTimezone() {
|
||||
if (!this.timezone) {
|
||||
if (!this.timezone || this.timezone === "SAME_AS_SERVER") {
|
||||
return await UptimeKumaServer.getInstance().getTimezone();
|
||||
}
|
||||
return this.timezone;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue