Description
The date range passed in through the value property is mutated especially the time parts. In some cases it's reset to midnight.
It's possible to work around the issue by e.g. passing the string representation of the date (toISOString) into the component. That seems to avoid the problematic code section.
Framework
Angular
Angular Version
21.1.5
Ignite UI for Angular Version
21.0.12
Component / Area
Date Range Picker
Browser
Chrome
Operating System
macOS
Command Not Working
Steps to Reproduce
- Use the date range picker in combination with the
IgxDateTimePicker for the input field.
- Change the time by manually editing the time in the input field (we are using the version of the date range picker where the "from" and "to" parts are two separate input fields).
- Open the date range picker again and select a new date range.
Actual Result
The time is reset to midnight.
Expected Result
The passed in date should not be mutated/the behavior should be similar as when passing a string as a value.
Reproduction URL
No response
Attachments
AI found the following flow leading to the mutation:
Flow
- Client passes value
date-range-picker.component.ts:552–556
- Picker stores it via
updateValue
date-range-picker.component.ts:1015–1019
- Later, when the calendar is initialized/opened
_initializeCalendarContainer()
date-range-picker.component.ts:1317–1335
- That calls
_setCalendarActiveDate()
date-range-picker.component.ts:1395–1398
_setCalendarActiveDate() uses this.activeDate
activeDate getter does
date-range-picker.component.ts:476–479
const dateValue = DateTimeUtil.isValidDate(this._firstDefinedInRange)
? new Date(this._firstDefinedInRange.setHours(0, 0, 0, 0))
: null;
Description
The date range passed in through the
valueproperty is mutated especially the time parts. In some cases it's reset to midnight.It's possible to work around the issue by e.g. passing the string representation of the date (
toISOString) into the component. That seems to avoid the problematic code section.Framework
Angular
Angular Version
21.1.5
Ignite UI for Angular Version
21.0.12
Component / Area
Date Range Picker
Browser
Chrome
Operating System
macOS
Command Not Working
Steps to Reproduce
IgxDateTimePickerfor the input field.Actual Result
The time is reset to midnight.
Expected Result
The passed in date should not be mutated/the behavior should be similar as when passing a
stringas a value.Reproduction URL
No response
Attachments
AI found the following flow leading to the mutation:
Flow
date-range-picker.component.ts:552–556updateValuedate-range-picker.component.ts:1015–1019_initializeCalendarContainer()date-range-picker.component.ts:1317–1335_setCalendarActiveDate()date-range-picker.component.ts:1395–1398_setCalendarActiveDate()usesthis.activeDateactiveDategetter doesdate-range-picker.component.ts:476–479