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: Time input doesn't allow PM when typed in #3398

Closed
jgalb opened this issue Dec 13, 2022 · 0 comments · Fixed by #3420
Closed

Calendar: Time input doesn't allow PM when typed in #3398

jgalb opened this issue Dec 13, 2022 · 0 comments · Fixed by #3420
Assignees
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Milestone

Comments

@jgalb
Copy link

jgalb commented Dec 13, 2022

Describe the bug

Using the Calendar component with the time-only flag and 12-hour format, when typing in a time like 10:35 pm, the time always reverts to 10: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 against am values. So typing pm 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

  1. Type a time into a time-only, 12 hour duration Calendar that has a pm at the end. e.g. "04:30 pm"
  2. notice the time picker will change values, but the "am" will stay the same.

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.

@jgalb jgalb added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Dec 13, 2022
@tugcekucukoglu tugcekucukoglu added Type: Bug Issue contains a bug related to a specific component. Something about the component is not working and removed Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible labels Dec 14, 2022
@tugcekucukoglu tugcekucukoglu added this to the 3.22.0 milestone Dec 14, 2022
@tugcekucukoglu tugcekucukoglu self-assigned this Dec 14, 2022
volvachev added a commit to volvachev/primevue that referenced this issue Dec 16, 2022
volvachev added a commit to volvachev/primevue that referenced this issue Dec 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Projects
None yet
2 participants