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

fix: #15005 Calendar time-picker errors when changing time before date #15044

Conversation

jmuzina
Copy link
Contributor

@jmuzina jmuzina commented Mar 14, 2024

This fixes issue #15005 using the current date when setting a time before picking a date.

Objective

Fix #15005, allows users to pick a time before specifying a date in calendars with showTime enabled.

Solution

Modified the implementation of calendar.validateTime() to set the date value to the current date when validating a time without picking a date first. Previously, Calendar.value was undefined when trying to access it as an array here, causing the error mentioned in #15005.

Discussion

  • This is my first PR here, so please bear with me as I get used to this :)
  • This currently works by defaulting to the current date... so it could be a band-aid/temp solution?
    • What is the most intuitive way for the calendar to behave when the user selects a time without a date first?
    • Is it acceptable that a user could open the calendar, page back a few months without selecting a date, then pick a time and have the active date value be set to the current date instead?

Copy link

vercel bot commented Mar 14, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
primeng ⬜️ Ignored (Inspect) Visit Preview Mar 14, 2024 3:25am

@cetincakiroglu cetincakiroglu merged commit 6866559 into primefaces:master Mar 14, 2024
2 checks passed
@cetincakiroglu
Copy link
Contributor

Ho,

Thanks for the effort and support!

@cetincakiroglu cetincakiroglu added the good first issue *** Welcome to PrimeNG Family! *** Good issue! label Mar 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue *** Welcome to PrimeNG Family! *** Good issue!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Calendar: Error on time selection in with range mode
2 participants