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 input does not update view when hourFormat changes #1711

Closed
ThomDevine opened this issue Dec 11, 2020 · 0 comments
Closed

Calendar input does not update view when hourFormat changes #1711

ThomDevine opened this issue Dec 11, 2020 · 0 comments
Assignees
Labels
Type: Bug Issue contains a defect related to a specific component.
Milestone

Comments

@ThomDevine
Copy link

ThomDevine commented Dec 11, 2020

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

[x ] bug report
[ ] feature request
[ ] support request => Please do not submit support request here, instead see https://forum.primefaces.org/viewforum.php?f=57

Codesandbox Case (Bug Reports)
Forked sandbox with instructions to recreate:
https://codesandbox.io/s/primereact-test-forked-vonjm

Current behavior

Changing the hourFormat does not refresh the displayed datetime in the calendar's input unless the date is changed.

Expected behavior

Changing the hourFormat would immediately update the display, e.g. "1:00 PM" would become "13:00"

Minimal reproduction of the problem with instructions

See link above for live demo with instructions. Minimal repro is this:

  1. Display a date in the component.
  2. Programattically change the timeFormat prop from "12" to "24"
    The format change is not updated in the Calendar's input unless the date changes.

Please tell us about your environment:

Windows 10, create-react-app 3.4.3, VS Code

  • React version: 16.12

  • PrimeReact version: 4.2.2
    This is the version we are on, and that's what I put in the sandbox.
    I could not get the sandbox working with 5.0.2 to test that version. Looking at the code, I expect this issue still exists there.

  • Browser: all

  • Language: ES6 (all suspected)

Note
My use case is only concerned with hourFormat. I suspect the following props to have the same behavior though, since they similarly affect the date display in the input:
dateFormat
timeOnly
showSeconds
showMillisec

@mertsincan mertsincan self-assigned this Jan 28, 2021
@mertsincan mertsincan added the Type: Bug Issue contains a defect related to a specific component. label Jan 28, 2021
@mertsincan mertsincan added this to the 6.0.1 milestone Jan 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Issue contains a defect related to a specific component.
Projects
None yet
Development

No branches or pull requests

2 participants