Fixed #5108 - Calendar: 12h time picker changes from 12 am to 12 pm automatically

pull/5161/head
tugcekucukoglu 2024-01-26 14:43:39 +03:00
parent b2bc41fcda
commit 87c94406a7
1 changed files with 3 additions and 2 deletions

View File

@ -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);