From 20eb53a16d75d32dc78284d097152e60a771d039 Mon Sep 17 00:00:00 2001 From: alex Date: Wed, 30 Oct 2024 18:46:11 -0400 Subject: [PATCH 1/3] 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 e0adcb0cdc..8bac791e96 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() { From 4f9b65ffaa52738e1fdfe715cf20f00cb379a159 Mon Sep 17 00:00:00 2001 From: alex Date: Wed, 30 Oct 2024 18:54:16 -0400 Subject: [PATCH 2/3] simplified no longer necessary else statement --- packages/primevue/src/datepicker/DatePicker.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/primevue/src/datepicker/DatePicker.vue b/packages/primevue/src/datepicker/DatePicker.vue index 8bac791e96..756344470c 100755 --- a/packages/primevue/src/datepicker/DatePicker.vue +++ b/packages/primevue/src/datepicker/DatePicker.vue @@ -998,7 +998,6 @@ export default { this.pm = currentHour > 11; if (currentHour >= 12) currentHour = currentHour == 12 ? 12 : currentHour - 12; - else currentHour = currentHour == 0 ? 0 : currentHour; } this.currentHour = Math.floor(currentHour / this.stepHour) * this.stepHour; @@ -1586,6 +1585,7 @@ export default { newHour = newHour <= 0 ? 12 + newHour : newHour; } + 1; if (this.validateTime(newHour, this.currentMinute, this.currentSecond, newPM)) { this.currentHour = newHour; From 594d470691964698ddbc94dfdca0814b7fc14be4 Mon Sep 17 00:00:00 2001 From: Alex Grimes <66704965+Alex-Grimes@users.noreply.github.com> Date: Thu, 31 Oct 2024 08:35:44 -0400 Subject: [PATCH 3/3] removed accidental 1 from line 1588 --- packages/primevue/src/datepicker/DatePicker.vue | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/primevue/src/datepicker/DatePicker.vue b/packages/primevue/src/datepicker/DatePicker.vue index 756344470c..78eae56a0b 100755 --- a/packages/primevue/src/datepicker/DatePicker.vue +++ b/packages/primevue/src/datepicker/DatePicker.vue @@ -1585,7 +1585,6 @@ export default { newHour = newHour <= 0 ? 12 + newHour : newHour; } - 1; if (this.validateTime(newHour, this.currentMinute, this.currentSecond, newPM)) { this.currentHour = newHour;