modified datePicker to work correctly with 12am

pull/6687/head
alex 2024-10-30 18:46:11 -04:00
parent 8dc4b74d35
commit 20eb53a16d
1 changed files with 4 additions and 1 deletions

View File

@ -998,7 +998,7 @@ export default {
this.pm = currentHour > 11; this.pm = currentHour > 11;
if (currentHour >= 12) currentHour = currentHour == 12 ? 12 : currentHour - 12; if (currentHour >= 12) currentHour = currentHour == 12 ? 12 : currentHour - 12;
else currentHour = currentHour == 0 ? 12 : currentHour; else currentHour = currentHour == 0 ? 0 : currentHour;
} }
this.currentHour = Math.floor(currentHour / this.stepHour) * this.stepHour; this.currentHour = Math.floor(currentHour / this.stepHour) * this.stepHour;
@ -2925,6 +2925,9 @@ export default {
return yearPickerValues; return yearPickerValues;
}, },
formattedCurrentHour() { formattedCurrentHour() {
if (this.currentHour == 0) {
return this.currentHour + 12;
}
return this.currentHour < 10 ? '0' + this.currentHour : this.currentHour; return this.currentHour < 10 ? '0' + this.currentHour : this.currentHour;
}, },
formattedCurrentMinute() { formattedCurrentMinute() {