Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Calendar component always shows 'AM'. Will not toggle or recognize incoming PM values. #2643

Closed
wesgrant opened this issue Apr 28, 2017 · 2 comments

Comments

@wesgrant
Copy link

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:
    <p-calendar [showTime]="true" [hourFormat]="12" [dataType]="string" [(ngModel)]="date">
    ... 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 =

@sudheerj
Copy link
Contributor

sudheerj commented May 9, 2017

It was fixed here #2693

Please comment out for any concerns.

@sudheerj sudheerj closed this as completed May 9, 2017
@AstRonin
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants