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: When entering the time by hand into timeOnly calendar, values switch to NaN:NaN #5254

Closed
Tyde opened this issue Feb 9, 2024 · 2 comments
Assignees
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Milestone

Comments

@Tyde
Copy link

Tyde commented Feb 9, 2024

Describe the bug

If I have a Calendar with the timeOnly and hourFormat="24" parameter and I enter the time in the format 09:00 directly into the input as text, it fails and switches to NaN:NaN. There is no option to recover from this.

Reproducer taken from the example from the documentaion

Reproducer

https://stackblitz.com/edit/vv7pr3?file=src%2FApp.vue

PrimeVue version

3.48.1

Vue version

3.x

Language

ALL

Build / Runtime

Vite

Browser(s)

No response

Steps to reproduce the behavior

Have a Calendar with a null value
Go into InputText from Calendar
Type 09:00
--> Value switches to NaN:NaN

Expected behavior

The time that was writteen is accepted as the time in the Calendar. AFAIK this has worked in earlier versions

@Tyde Tyde added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Feb 9, 2024
@Tyde
Copy link
Author

Tyde commented Feb 9, 2024

Issue seems to lie here:

date = new Date(this.modelValue);

If the modelValue is not yet defined, it will fall back into an "invalid date" which leads to the NaN:NaN issue

@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 Feb 16, 2024
@tugcekucukoglu tugcekucukoglu added this to the 3.49.0 milestone Feb 16, 2024
@tugcekucukoglu tugcekucukoglu self-assigned this Feb 16, 2024
@jozefnad
Copy link

now, there is issue that date resets if I change timeOnly component

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
Development

No branches or pull requests

3 participants