From 7f7b909ca5d010219330251516d18b391213b831 Mon Sep 17 00:00:00 2001 From: Michael Meier Date: Wed, 8 May 2024 15:08:25 +0200 Subject: [PATCH 1/3] 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); From 7e29b953f40df928b61f4730aebcbc8b17320176 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?O=C4=9Fuzhan?= Date: Thu, 2 May 2024 23:06:18 +0300 Subject: [PATCH 2/3] focus blink fix --- components/lib/datepicker/DatePicker.vue | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/components/lib/datepicker/DatePicker.vue b/components/lib/datepicker/DatePicker.vue index 3990c124b..d66b0bbf0 100755 --- a/components/lib/datepicker/DatePicker.vue +++ b/components/lib/datepicker/DatePicker.vue @@ -1155,11 +1155,11 @@ export default { } if (this.isSingleSelection() && (!this.showTime || this.hideOnDateTimeSelect)) { + if (this.input) { + this.input.focus(); + } + setTimeout(() => { - if (this.input) { - this.input.focus(); - } - this.overlayVisible = false; }, 150); } From 803e9f4ea17ca83484e199fe4872505ae3cef07a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?O=C4=9Fuzhan?= Date: Mon, 6 May 2024 11:38:33 +0000 Subject: [PATCH 3/3] lint: format --- components/lib/datepicker/DatePicker.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/lib/datepicker/DatePicker.vue b/components/lib/datepicker/DatePicker.vue index d66b0bbf0..1591493c6 100755 --- a/components/lib/datepicker/DatePicker.vue +++ b/components/lib/datepicker/DatePicker.vue @@ -1158,7 +1158,7 @@ export default { if (this.input) { this.input.focus(); } - + setTimeout(() => { this.overlayVisible = false; }, 150);