primefaces / primefaces/primereact
Calendar: Can't input time via keybord in a timeOnly control if minDate is in the future
Nobody has claimed this yet.
- Dominant language
- CSS
- Stars
- 8.3k
- Forks
- 1.2k
- PR merge metrics
- No merged PRs in 30d
Description
Describe the bug
Issue: Can't edit input value with keyboard if minDate is in the future. If it's the same day you can enter values in that day, e.g. min today 12:00 you can enter 13:00, but if it's min tomorrow 12:00 you can't enter 13:00.
My usecase: I'd like to use the control for a reservation time selection where the min and max dates are set to the selected date's opening and closing hours.
Reproducer
https://codesandbox.io/s/primereact-demo-forked-m35ntp?file=/src/App.js
PrimeReact version
9.6.0
React version
18.x
Language
ALL
Build / Runtime
Create React App (CRA)
Browser(s)
No response
Steps to reproduce the behavior
- Enter any time with the keyboard in the first field -> it should work as intended
- Try to enter any time in the second field -> it won't accept it
Expected behavior
The component should map the time input to the proper date defined by the min/max props or throw an error if the is an ambiguity like when the min-max range is greater than 24h.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the linked CodeSandbox reproducer and its src/App.js, then trace the PrimeReact timeOnly control behavior when minDate is tomorrow. Reproduce the keyboard-input failure and verify that times within the min/max range are accepted or that an ambiguity is reported as described.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, react
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100