Fix extra 0 added for hour conversion

master
Grant Stankaitis 2021-12-31 18:07:48 -10:00 committed by GitHub
parent 364512266b
commit 03f5daba90
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -61,7 +61,9 @@ function draw() {
// Convert to 12hr time mode // Convert to 12hr time mode
if (is12Hour && hour > 12) { if (is12Hour && hour > 12) {
hour = hour - 12; hour = hour - 12;
hour = "0" + hour; if (hour < 10) {
hour = "0" + hour;
}
} else if (hour == 0) { } else if (hour == 0) {
hour = 12; hour = 12;
} }