Fix a couple issues with time management
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user