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.
pull/5702/head
Michael Meier 2024-05-08 15:08:25 +02:00 committed by GitHub
parent 1305a23abf
commit 7f7b909ca5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 3 deletions

View File

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