Calendar: Time input doesn't allow PM when typed in #3398
Labels
Type: Bug
Issue contains a bug related to a specific component. Something about the component is not working
Milestone
Describe the bug
Using the Calendar component with the
time-only
flag and 12-hour format, when typing in a time like10:35 pm
, the time always reverts to10:35 am
.I have pinpointed the bug to a specific line in the Calendar component code.
https://github.com/primefaces/primevue/blob/master/src/components/calendar/Calendar.vue#L1786 which reads:
this.pm = ampm === this.$primevue.config.locale.am || ampm === this.$primevue.config.locale.am.toLowerCase();
You can see that it is checking whether or not you typed
pm
by comparing it againstam
values. So typingpm
will never work.Reproducer
https://codesandbox.io/s/epic-forest-6d1kys
PrimeVue version
3.21.0
Vue version
3.x
Language
TypeScript
Build / Runtime
Vue CLI App
Browser(s)
No response
Steps to reproduce the behavior
Expected behavior
You should be able to type in am or pm into the time input and have it be reflected in the time picker widget.
The text was updated successfully, but these errors were encountered: