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

@@ -91,6 +91,8 @@ if [ $? -ne 0 ]; then
update-locale en_US.UTF-8 update-locale en_US.UTF-8
fi fi
localectl set-locale LC_TIME=en_US.UTF-8
# Setup USB stick automount # Setup USB stick automount
diff ./installer/config/11-automount.rules /etc/udev/rules.d/11-automount.rules >/dev/null diff ./installer/config/11-automount.rules /etc/udev/rules.d/11-automount.rules >/dev/null
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then

View File

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