@@ -352,7 +352,8 @@ export class IgxTimePickerComponent extends PickerBaseDirective
352352 }
353353 if ( DateTimeUtil . isValidDate ( this . value ) ) {
354354 // TODO: Update w/ clear behavior
355- return this . value . getHours ( ) !== 0 || this . value . getMinutes ( ) !== 0 || this . value . getSeconds ( ) !== 0 ;
355+ return this . value . getHours ( ) !== 0 || this . value . getMinutes ( ) !== 0 ||
356+ this . value . getSeconds ( ) !== 0 || this . value . getMilliseconds ( ) !== 0 ;
356357 }
357358 return ! ! this . dateTimeEditor . value ;
358359 }
@@ -455,7 +456,8 @@ export class IgxTimePickerComponent extends PickerBaseDirective
455456 private _resourceStrings = getCurrentResourceStrings ( TimePickerResourceStringsEN ) ;
456457 private _okButtonLabel = null ;
457458 private _cancelButtonLabel = null ;
458- private _itemsDelta : Pick < DatePartDeltas , 'hours' | 'minutes' | 'seconds' > = { hours : 1 , minutes : 1 , seconds : 1 } ;
459+ private _itemsDelta : Pick < DatePartDeltas , 'hours' | 'minutes' | 'seconds' | 'fractionalSeconds' > =
460+ { hours : 1 , minutes : 1 , seconds : 1 , fractionalSeconds : 1 } ;
459461
460462 private _statusChanges$ : Subscription ;
461463 private _ngControl : NgControl = null ;
@@ -596,11 +598,11 @@ export class IgxTimePickerComponent extends PickerBaseDirective
596598 * ```
597599 */
598600 @Input ( )
599- public set itemsDelta ( value : Pick < DatePartDeltas , 'hours' | 'minutes' | 'seconds' > ) {
601+ public set itemsDelta ( value : Pick < DatePartDeltas , 'hours' | 'minutes' | 'seconds' | 'fractionalSeconds' > ) {
600602 Object . assign ( this . _itemsDelta , value ) ;
601603 }
602604
603- public get itemsDelta ( ) : Pick < DatePartDeltas , 'hours' | 'minutes' | 'seconds' > {
605+ public get itemsDelta ( ) : Pick < DatePartDeltas , 'hours' | 'minutes' | 'seconds' | 'fractionalSeconds' > {
604606 return this . _itemsDelta ;
605607 }
606608
@@ -653,6 +655,7 @@ export class IgxTimePickerComponent extends PickerBaseDirective
653655 hour : '2-digit' ,
654656 minute : '2-digit' ,
655657 second : '2-digit' ,
658+ fractionalSecondDigits : 3
656659 } ) ;
657660 }
658661
@@ -664,7 +667,7 @@ export class IgxTimePickerComponent extends PickerBaseDirective
664667 const date = this . parseToDate ( value ) ;
665668 if ( date ) {
666669 this . _dateValue = new Date ( ) ;
667- this . _dateValue . setHours ( date . getHours ( ) , date . getMinutes ( ) , date . getSeconds ( ) ) ;
670+ this . _dateValue . setHours ( date . getHours ( ) , date . getMinutes ( ) , date . getSeconds ( ) , date . getMilliseconds ( ) ) ;
668671 this . setSelectedValue ( this . _dateValue ) ;
669672 } else {
670673 this . setSelectedValue ( null ) ;
@@ -824,10 +827,10 @@ export class IgxTimePickerComponent extends PickerBaseDirective
824827
825828 if ( DateTimeUtil . isValidDate ( this . value ) ) {
826829 const oldValue = new Date ( this . value ) ;
827- this . value . setHours ( 0 , 0 , 0 ) ;
830+ this . value . setHours ( 0 , 0 , 0 , 0 ) ;
828831 if ( this . value . getTime ( ) !== oldValue . getTime ( ) ) {
829832 this . emitValueChange ( oldValue , this . value ) ;
830- this . _dateValue . setHours ( 0 , 0 , 0 ) ;
833+ this . _dateValue . setHours ( 0 , 0 , 0 , 0 ) ;
831834 this . dateTimeEditor . value = new Date ( this . value ) ;
832835 this . setSelectedValue ( this . _dateValue ) ;
833836 }
@@ -1211,7 +1214,7 @@ export class IgxTimePickerComponent extends PickerBaseDirective
12111214 this . value = newValue ? new Date ( newValue ) : newValue ;
12121215 } else if ( isDate ( this . value ) ) {
12131216 const date = new Date ( this . value ) ;
1214- date . setHours ( newValue ?. getHours ( ) || 0 , newValue ?. getMinutes ( ) || 0 , newValue ?. getSeconds ( ) || 0 ) ;
1217+ date . setHours ( newValue ?. getHours ( ) || 0 , newValue ?. getMinutes ( ) || 0 , newValue ?. getSeconds ( ) || 0 , newValue ?. getMilliseconds ( ) || 0 ) ;
12151218 this . value = date ;
12161219 } else {
12171220 this . value = newValue ? this . toISOString ( newValue ) : newValue ;
@@ -1220,7 +1223,7 @@ export class IgxTimePickerComponent extends PickerBaseDirective
12201223
12211224 private updateEditorValue ( ) : void {
12221225 const date = this . dateTimeEditor . value ? new Date ( this . dateTimeEditor . value ) : new Date ( ) ;
1223- date . setHours ( this . _selectedDate . getHours ( ) , this . _selectedDate . getMinutes ( ) , this . _selectedDate . getSeconds ( ) ) ;
1226+ date . setHours ( this . _selectedDate . getHours ( ) , this . _selectedDate . getMinutes ( ) , this . _selectedDate . getSeconds ( ) , this . _selectedDate . getMilliseconds ( ) ) ;
12241227 this . dateTimeEditor . value = date ;
12251228 }
12261229
0 commit comments