Primeng: Calendar TimeOnly incorrect hourformat

Created on 4 May 2017  路  11Comments  路  Source: primefaces/primeng

When we use calendar time picker with time only option and hourformat="12" then it displays popup with incorrect AM/PM display.It always display AM in time picker popup as below.

<p-calendar [(ngModel)]="date8" [timeOnly]="true" [hourFormat]="12"></p-calendar>

image

defect

Most helpful comment

Just wondering, as this issue still says closed, but has never been fixed. Is someone looking into this?

All 11 comments

I'm seeing the same behavior in 4.0.1. Did this fix not make it into the release?

Are you able to replicate the issue on showcase? It worked for me. Please provide plunker example.

Same here, issue still present. I just updated and it is still not displaying PM.

I just threw this into a basic plunker. Same issue appears there:
http://plnkr.co/edit/omUctyZwccEM8mGnKaXM?p=preview

Same behavior for me. AM/PM switch invokes only on hours step from 12 to 01. The rest steps display only AM. But the value of calendar is correct.
My version of primeNG is 4.0.1.

Same behavior as @EugeneBugor described

The above issue is related to AM/PM format for time picker popup. This issue is not related to AM/PM display in input field(DatePicker and TimePicker).

Please create a separate issue with the details.

@sudheerj , added a new issue related to my problem https://github.com/primefaces/primeng/issues

Just wondering, as this issue still says closed, but has never been fixed. Is someone looking into this?

@Mrtcndkn Tested on 4.2.1, same issue is present.

<p-calendar [showTime]="true" [hourFormat]="12" [(ngModel)]="startDate" placeholder="Start Date" [minDate]="oneYearAgo" [maxDate]="today" [showIcon]="true" [readonlyInput]="true"></p-calendar>

Can we reopen?

I am facing the same issue. At output += date.getHours() > 11 ? ' PM' : ' AM'; why are we not considering the user selected AM/PM value. Rather we are taking it from system time. This is where the issue comes.

Issue should be re-opened.

During selection:
image

Output:
image

Was this page helpful?
0 / 5 - 0 ratings