From 20eb53a16d75d32dc78284d097152e60a771d039 Mon Sep 17 00:00:00 2001 From: alex Date: Wed, 30 Oct 2024 18:46:11 -0400 Subject: [PATCH] modified datePicker to work correctly with 12am --- packages/primevue/src/datepicker/DatePicker.vue | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/primevue/src/datepicker/DatePicker.vue b/packages/primevue/src/datepicker/DatePicker.vue index e0adcb0cd..8bac791e9 100755 --- a/packages/primevue/src/datepicker/DatePicker.vue +++ b/packages/primevue/src/datepicker/DatePicker.vue @@ -998,7 +998,7 @@ export default { this.pm = currentHour > 11; 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; @@ -2925,6 +2925,9 @@ export default { return yearPickerValues; }, formattedCurrentHour() { + if (this.currentHour == 0) { + return this.currentHour + 12; + } return this.currentHour < 10 ? '0' + this.currentHour : this.currentHour; }, formattedCurrentMinute() {