IgniteUI / ignite-ui

Ignite UI for jQuery by Infragistics
https://bit.ly/2kuu1fT
Other
477 stars 83 forks source link

In igDateEditor with the intput and display format of HH:mm:ss.fff, millisecond part becomes 0 in display text and in value when the focus is blurred. #2016

Closed norikois closed 4 years ago

norikois commented 4 years ago

Description

In igDateEditor with the intput and display format of HH:mm:ss.fff, millisecond part becomes 0 in text and in value when the focus is blurred.

Steps to reproduce

  1. Open the attached sample in IE11.
  2. Type any value, for example, 12:34:56.789, in igDateEditor and click "OK" button.

Result

When the focus moves to the button, the display text of the millisecond part in the igDateEditor becomes 000. And it is also 0 in the value as shown in the alert window.

Expected result

The millisecond part should be 789 both in display text and in value.

Attachments

CAS-32292-Sample1 (2).zip

Some Additional Notes

It would be greatly appreciated if there is a workaround for v17.2.

damyanpetev commented 4 years ago

The value is parsed from the mask correctly and converted to a Date with the correct milliseconds, however at the point of updating the actual editor value for some reason we do an additional conversion. As a bonus, the conversion is done using the Date constructor to parse the value or keep it if it's already a date. However, in ES5 (read IE11) that "keep" is done through string conversion and is only accurate to the seconds (see https://stackoverflow.com/a/32364944). Issue is in the editors _getDateObjectFromValue method.