primeng icon indicating copy to clipboard operation
primeng copied to clipboard

p-calendar AM/PM stepper does not work correctly when the hour is set to 12.

Open ThanksGhage opened this issue 9 years ago • 13 comments

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/Qi2Nw2imLpDUF8NJinYw?p=preview

Current behavior If you create a Calendar with hourFormat set to '12' and currentHour is set to 12, then toggle the AM/PM stepper the input box and the resulting date object will not change. Regardless of the state of the AM/PM stepper, the input box and the resulting date object will become PM if the current hour is changed to 12.

Expected behavior The AM/PM stepper should affect the input box and the resulting time object regardless of what the current hour is.

Minimal reproduction of the problem with instructions http://plnkr.co/edit/i0BZP3IDxQsB2CuDFqWo?p=preview

What is the motivation / use case for changing the behavior? This bug renders certain times unreachable through the time picker.

Please tell us about your environment: Mac OS X El Capitan WebStorm Webpack 2.2.0

  • Angular version: Angular 4.0.0

  • PrimeNG version: 4.2.0-rc.1

  • Browser: All

  • Language: All

ThanksGhage avatar Aug 31 '17 14:08 ThanksGhage

Having same issue on primeng 4.1.0-rc.2

ocasallas avatar Sep 12 '17 20:09 ocasallas

I was using 4.1.3, updated to 4.2.0 today, still having the same issue.

drunkendaddy avatar Sep 15 '17 05:09 drunkendaddy

Having same issue on primeng 4.1.3

IbrahimElkhatib avatar Sep 18 '17 07:09 IbrahimElkhatib

Having the same issue on primeng 4.2.1. This effectively does not allow users to select certain times.

CNitschelm avatar Sep 21 '17 23:09 CNitschelm

Also happens to me on 4.2.1.

miguelleite avatar Sep 22 '17 08:09 miguelleite

Fixed this last week. Hoping it can get pulled soon.

CNitschelm avatar Oct 17 '17 14:10 CNitschelm

4.2.2 plnkr (Issue 1): http://plnkr.co/edit/BTGG7n?p=preview

CNitschelm avatar Oct 25 '17 15:10 CNitschelm

Is there a workaround for this while we wait for the fix to be released?

JonKruger avatar Oct 25 '17 16:10 JonKruger

Just FYI the release for this seems to be set for 10/30, so it will not be too long before you can upgrade.

CNitschelm avatar Oct 25 '17 17:10 CNitschelm

@cagataycivici Thanks for pulling this in, but RC1 for 4.3.0 does not correctly address this issue. If the hour is 00 and 12 hour time is selected, the time should still appear as 12, never 00. 12 hour time does not use 00 for hours, ever.

I.E: 24 hour time: 23:59 -> 00:00 12 hour time: 11:59 PM -> 12:00 AM

Additionally, when you type in "12:XX AM" where XX are digits, it switches it to PM, but it should be AM.

CNitschelm avatar Oct 26 '17 17:10 CNitschelm

Plunker for 4.3.0 rc1 with updated demos http://plnkr.co/edit/hUfvzi7KbY93wQf3snH9?p=preview

CNitschelm avatar Oct 26 '17 17:10 CNitschelm

I agree with @CNitschelm, this regression is just as much of an issue as the AM/PM. Any idea when that will be fixed?

JonKruger avatar Oct 30 '17 16:10 JonKruger

All: Here is the new issue. https://github.com/primefaces/primeng/issues/4312

CNitschelm avatar Oct 30 '17 16:10 CNitschelm