From 7f7b909ca5d010219330251516d18b391213b831 Mon Sep 17 00:00:00 2001 From: Michael Meier Date: Wed, 8 May 2024 15:08:25 +0200 Subject: [PATCH] fix(DatePicker): set hour on 24h mode on date select, fixes #5596 This commit is a copy of PR #5607 for the v4 branch. Since the component was renamed, the fix from the master branch was not applied to the new component. --- components/lib/datepicker/DatePicker.vue | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/components/lib/datepicker/DatePicker.vue b/components/lib/datepicker/DatePicker.vue index 8f2f429f8..78115e7e2 100755 --- a/components/lib/datepicker/DatePicker.vue +++ b/components/lib/datepicker/DatePicker.vue @@ -1168,9 +1168,9 @@ export default { let date = new Date(dateMeta.year, dateMeta.month, dateMeta.day); if (this.showTime) { - if (this.hourFormat === '12' && this.currentHour !== 12) { - this.pm ? date.setHours(this.currentHour + 12) : date.setHours(this.currentHour); - } + (this.hourFormat === '12' && this.currentHour !== 12 && this.pm) ? + date.setHours(this.currentHour + 12) : + date.setHours(this.currentHour); date.setMinutes(this.currentMinute); date.setSeconds(this.currentSecond);