igniteui-angular icon indicating copy to clipboard operation
igniteui-angular copied to clipboard

The igxDatePicker changes the time portion of a provided date

Open npaunov opened this issue 8 years ago • 2 comments

Description

The igxDatePicker sets the time portion of it's value to 12:00.

  • igniteui-angular version: 6.1.4
  • browser: N/A

Steps to reproduce

  1. Open the Dev Samples
  2. Go to DatePicker -> Date Picker with retemplated input group.
  3. Observe the time, which displays the current hour and minutes.
  4. Change the Date.

Result

The time is reset to 12:00.

Expected result

The time should not be reset.

npaunov avatar Sep 05 '18 08:09 npaunov

Since JavaScript does not support Date only object, we use 12:00 as a default time portion in our code. Our igxDatePicker operates with the date only and does not guarantee the passed time portion will remain the same after manipulation. I agree altering the time portion can be considered a side effect, but then again, when getting the value from our picker, only the date portion should be taken into account. After all, it's called igxDatePicker. @rkaraivanov could decide whether we should implement this enhancement or close this issue as not a bug.

tiliev avatar Oct 01 '18 06:10 tiliev

@tiliev there was the same issue with the igxTimePicker #2470, which did not keep the Date, and is now fixed. If you have the igxTimePicker and the igxDatePicker in the same application, you should be able to bind the date/ time between them without altering it.

npaunov avatar Oct 01 '18 08:10 npaunov