From f5578a46defef6dbee67c6f94cfaa9aee8e3b621 Mon Sep 17 00:00:00 2001 From: thristov78 Date: Wed, 17 Apr 2024 18:14:36 +0300 Subject: [PATCH] Fixed #5596 - Calendar: Hours are set to 00 when clicking the "Today" button When the "Today" button is clicked, the hours field is set to 00 instead of the current hour. The minutes field is populated correctly. --- components/lib/calendar/Calendar.vue | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/components/lib/calendar/Calendar.vue b/components/lib/calendar/Calendar.vue index d63588b2e..6d7bb7b45 100755 --- a/components/lib/calendar/Calendar.vue +++ b/components/lib/calendar/Calendar.vue @@ -1162,9 +1162,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);