Skip to content

Commit

Permalink
Fixed primefaces#7799 typing 1200AM to 1259AM into calendar input sav…
Browse files Browse the repository at this point in the history
…es as PM
  • Loading branch information
Ryan Lijewski committed Jul 17, 2019
1 parent e2f4a13 commit d76d575
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/app/components/calendar/calendar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1859,8 +1859,13 @@ export class Calendar implements OnInit,OnDestroy,ControlValueAccessor {
throw "Invalid time";
}
else {
if (this.hourFormat == '12' && h !== 12 && this.pm) {
h+= 12;
if (this.hourFormat == '12') {
if (h !== 12 && this.pm) {
h += 12;
}
else if (!this.pm && h === 12) {
h -= 12;
}
}

return {hour: h, minute: m, second: s};
Expand Down

0 comments on commit d76d575

Please sign in to comment.