minor fixes

This commit is contained in:
sanjayk03-dev
2024-09-09 15:19:43 +05:30
parent ddf89c52d1
commit cead91dcef
2 changed files with 14 additions and 7 deletions

View File

@@ -45,8 +45,8 @@ module.exports = {
time_zones: [],
is_loading_time: false,
selected_date: null,
selected_hours: `${new Date().getHours()}`,
selected_minutes: `${new Date().getMinutes()}`,
selected_hours: this.current_time == null ? "00" : this.current_time.getHours(),
selected_minutes: this.current_time == null ? "00" : this.current_time.getMinutes(),
selected_meridiem: "AM",
};
},
@@ -72,7 +72,7 @@ module.exports = {
hour: "2-digit",
minute: "2-digit",
second: "2-digit",
hour12: this.config.admin.time_format === true,
hour12: this.config.admin.time_format !== true,
};
if (this.current_timezone != "") {
options.timeZone = this.current_timezone;
@@ -265,9 +265,17 @@ module.exports = {
}
},
change_timezone: function () {
change_timezone: async function () {
try {
console.log(this.selected_timezone);
// const response = await api.put("time", { timezone: this.selected_timezone });
// if (response == "ok") {
// alert("Time zone updated successfully.");
// this.fetch_current_time();
// } else {
// throw response;
// }
} catch (error) {
alert("Error updating time zone");
}

View File

@@ -71,8 +71,7 @@ script#admin-general-view-template(type="text/x-template")
.pure-form
select(v-model="selected_timezone")
option(v-for="(index,timezone) in time_zone" :value=timezone) {{ timezone }}
option(v-for="timezone in time_zones" :value=timezone) {{ timezone }}
button.pure-button.pure-button-primary(@click="change_timezone", style="margin:5px") Change Time Zone
h2 Date/Time