Primeng: Calendar component always shows 'AM'. Will not toggle or recognize incoming PM values.

Created on 28 Apr 2017  路  2Comments  路  Source: primefaces/primeng

I'm submitting a ... (check one with "x")

[x ] bug report => Search github for a similar issue or PR before submitting
[ ] feature request => Please check if request is not on the roadmap already https://github.com/primefaces/primeng/wiki/Roadmap
[ ] support request => Please do not submit support request here, instead see http://forum.primefaces.org/viewforum.php?f=35

Plunkr Case (Bug Reports)
Please fork the plunkr below and create a case demonstrating your bug report. Issues without a plunkr have much less possibility to be reviewed.

http://plnkr.co/edit/dWh4IJoFdiNDdQVMJwSE

http://plnkr.co/edit/3fSfruH9GUtpeAoDuLs0?p=preview

Current behavior

  • In the current version, use a component with a date as such: "12/25/2015 3:00 AM" like this:

    ... then in your component, set the date like this:
    this.date = "12/25/2015 3:00 AM";
  • Open the calendar control by clicking on the input field.
  • Toggle the AM / PM control.
  • The text "AM" in the input field does not change from "AM"
    Note that there is another pull request in the queue that fixes this issue incorrectly by subtracting 12 hours from the date. In my plunkr this shows as a negative time value in the input field.

Expected behavior

I would expect the AM / PM text to toggle with the selection of the AM / PM buttons.

Minimal reproduction of the problem with instructions

What is the motivation / use case for changing the behavior?

Please note that I am also posting a pull request to fix.

Please tell us about your environment:

Windows 10, Visual Studio Code, Chrome

  • Angular version: 4.1.0

    It is also an issue in the current version in plunkr

  • PrimeNG version: 2.0.X

  • Browser: [Chrome 57.0.2987.133 (64-bit) ]

  • Language: [all | TypeScript X.X | ES6/7 | ES5]

  • Node (for AoT issues): node --version =

Most helpful comment

My version of primeNG is 4.0.1, but this bug is still there...
<p-calendar inputStyleClass="form-control" formControlName="requested_time" showTime="showTime" hourFormat="12" timeOnly="true">
Toggle do not change AM to PM in input field

All 2 comments

It was fixed here https://github.com/primefaces/primeng/issues/2693

Please comment out for any concerns.

My version of primeNG is 4.0.1, but this bug is still there...
<p-calendar inputStyleClass="form-control" formControlName="requested_time" showTime="showTime" hourFormat="12" timeOnly="true">
Toggle do not change AM to PM in input field

Was this page helpful?
0 / 5 - 0 ratings

Related issues

just-paja picture just-paja  路  3Comments

pchristou picture pchristou  路  3Comments

SchneMa picture SchneMa  路  3Comments

jisqaqov picture jisqaqov  路  3Comments

jisqaqov picture jisqaqov  路  3Comments