Calendar: Error on time selection in with range mode #15005
Labels
Type: Bug
Issue contains a bug related to a specific component. Something about the component is not working
Milestone
Describe the bug
Having
selectionMode="range"
and[showTime]="true"
when the user first selects the time (before selecting a date) the below errors are triggeredTypeError: 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
Expected behavior
if a date is not selected, it should use the current date
The text was updated successfully, but these errors were encountered: