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: Error on time selection in with range mode #15005

Closed
ilFortu opened this issue Mar 11, 2024 · 0 comments · Fixed by #15044
Closed

Calendar: Error on time selection in with range mode #15005

ilFortu opened this issue Mar 11, 2024 · 0 comments · Fixed by #15044
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Milestone

Comments

@ilFortu
Copy link

ilFortu commented Mar 11, 2024

Describe the bug

Having selectionMode="range" and [showTime]="true" when the user first selects the time (before selecting a date) the below errors are triggered

TypeError: Cannot read properties of undefined (reading '1') at Calendar.validateTime (http://localhost:4205/main.js:174059:25) at Calendar.decrementHour (http://localhost:4205/main.js:174168:14) at Calendar.repeat (http://localhost:4205/main.js:174141:66) at Calendar.onTimePickerElementMouseDown (http://localhost:4205/main.js:174116:12) at Calendar_div_3_div_5_Template_button_mousedown_8_listener (http://localhost:4205/main.js:171981:81) at executeListenerWithErrorHandling (http://localhost:4205/main.js:113756:12) at wrapListenerIn_markDirtyAndPreventDefault (http://localhost:4205/main.js:113787:18) at HTMLButtonElement.<anonymous> (http://localhost:4205/main.js:138185:112) at l.invokeTask (https://cdn.jsdelivr.net/npm/[email protected]/fesm2015/zone.min.js:6:7058) at http://localhost:4205/main.js:107945:49

TypeError: Cannot read properties of undefined (reading '1') at Calendar.updateTime (http://localhost:4205/main.js:174209:25) at Calendar.onTimePickerElementMouseUp (http://localhost:4205/main.js:174123:12) at Calendar_div_3_div_5_Template_button_mouseup_8_listener (http://localhost:4205/main.js:171985:81) at executeListenerWithErrorHandling (http://localhost:4205/main.js:113756:12) at wrapListenerIn_markDirtyAndPreventDefault (http://localhost:4205/main.js:113787:18) at HTMLButtonElement.<anonymous> (http://localhost:4205/main.js:138185:112) at l.invokeTask (https://cdn.jsdelivr.net/npm/[email protected]/fesm2015/zone.min.js:6:7058) at http://localhost:4205/main.js:107945:49 at AsyncStackTaggingZoneSpec.onInvokeTask (http://localhost:4205/main.js:107945:30) at l.invokeTask (https://cdn.jsdelivr.net/npm/[email protected]/fesm2015/zone.min.js:6:6979)

Environment

the issue can be replicated here https://stackblitz.com/edit/o4jgxn?file=src%2Fapp%2Fdemo%2Fcalendar-range-demo.html

Reproducer

No response

Angular version

17.2.2

PrimeNG version

17.10.0

Build / Runtime

Angular CLI App

Language

TypeScript

Node version (for AoT issues node --version)

20.0.0

Browser(s)

any

Steps to reproduce the behavior

  • Select the time before to choose a date

Expected behavior

if a date is not selected, it should use the current date

@ilFortu ilFortu added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Mar 11, 2024
@cetincakiroglu cetincakiroglu 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 Mar 14, 2024
@cetincakiroglu cetincakiroglu added this to the 17.11.0 milestone Mar 14, 2024
cetincakiroglu added a commit that referenced this issue Mar 14, 2024
…r-times

fix: #15005 Calendar time-picker errors when changing time before date
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

Successfully merging a pull request may close this issue.

2 participants