Fix a couple issues with time management

This commit is contained in:
David Carley
2022-09-12 00:13:57 +00:00
parent 55595e5fb8
commit b770901576
2 changed files with 7 additions and 1 deletions

View File

@@ -115,9 +115,13 @@
const YY = year.toString().padStart(2, "0");
const MM = month.toString().padStart(2, "0");
const DD = day.toString().padStart(2, "0");
const hh = hour.toString().padStart(2, "0");
let hh = hour.toString().padStart(2, "0");
const mm = minute.toString().padStart(2, "0");
if (Number(hour) < 12 && !am) {
hh = (hour + 12).toString().padStart(2, "0");
}
await api.PUT("time", {
datetime: `${YY}-${MM}-${DD} ${hh}:${mm}:00`,
timezone: timezones[selectedTimezoneIndex].value,