From 87c94406a7aa44bd7e3f5708373afcd51442babd Mon Sep 17 00:00:00 2001 From: tugcekucukoglu Date: Fri, 26 Jan 2024 14:43:39 +0300 Subject: [PATCH] Fixed #5108 - Calendar: 12h time picker changes from 12 am to 12 pm automatically --- components/lib/calendar/Calendar.vue | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/components/lib/calendar/Calendar.vue b/components/lib/calendar/Calendar.vue index 338c4f80b..428c37583 100755 --- a/components/lib/calendar/Calendar.vue +++ b/components/lib/calendar/Calendar.vue @@ -1155,8 +1155,9 @@ export default { let date = new Date(dateMeta.year, dateMeta.month, dateMeta.day); if (this.showTime) { - if (this.hourFormat === '12' && this.pm && this.currentHour != 12) date.setHours(this.currentHour + 12); - else date.setHours(this.currentHour); + if (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);