Skip to content

Commit

Permalink
fix(DatePicker): set hour on 24h mode on date select, fixes primeface…
Browse files Browse the repository at this point in the history
…s#5596

This commit is a copy of PR primefaces#5607 for the v4 branch. Since the component was renamed, the fix from the master branch was not applied to the new component.
  • Loading branch information
m-meier authored May 8, 2024
1 parent 1305a23 commit 7f7b909
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions components/lib/datepicker/DatePicker.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 7f7b909

Please sign in to comment.