@@ -267,13 +267,14 @@ import { dateValueRange, renderDateTime, renderTextFormat, convertFormatToKey, g
267
267
providers : [ { provide : NG_VALUE_ACCESSOR , useExisting : DateTime , multi : true } ] ,
268
268
encapsulation : ViewEncapsulation . None ,
269
269
} )
270
- export class DateTime extends BaseInput < DateTimeData > implements AfterViewInit , ControlValueAccessor , OnDestroy {
270
+ export class DateTime extends BaseInput < DateTimeData | string > implements AfterViewInit , ControlValueAccessor , OnDestroy {
271
271
272
272
_text : string = '' ;
273
273
_min : DateTimeData ;
274
274
_max : DateTimeData ;
275
275
_locale : LocaleData = { } ;
276
276
_picker : Picker ;
277
+ _internalValue : DateTimeData = { } ;
277
278
278
279
/**
279
280
* @input {string} The minimum datetime allowed. Value must be a date string
@@ -439,16 +440,23 @@ export class DateTime extends BaseInput<DateTimeData> implements AfterViewInit,
439
440
/**
440
441
* @hidden
441
442
*/
442
- _inputUpdated ( ) {
443
- this . updateText ( ) ;
443
+ _inputReset ( ) {
444
+ this . _internalValue = { } ;
445
+ }
446
+
447
+ /**
448
+ * @hidden
449
+ */
450
+ _inputCheckHasValue ( val : any ) {
451
+ updateDate ( this . _internalValue , val ) ;
452
+ super . _inputCheckHasValue ( val ) ;
444
453
}
445
454
446
455
/**
447
456
* @hidden
448
457
*/
449
- _inputNormalize ( val : any ) : DateTimeData {
450
- updateDate ( this . _value , val ) ;
451
- return this . _value ;
458
+ _inputUpdated ( ) {
459
+ this . updateText ( ) ;
452
460
}
453
461
454
462
/**
@@ -458,6 +466,14 @@ export class DateTime extends BaseInput<DateTimeData> implements AfterViewInit,
458
466
return true ;
459
467
}
460
468
469
+ /**
470
+ * TODO: REMOVE THIS
471
+ * @hidden
472
+ */
473
+ _inputChangeEvent ( ) : any {
474
+ return this . value ;
475
+ }
476
+
461
477
@HostListener ( 'click' , [ '$event' ] )
462
478
_click ( ev : UIEvent ) {
463
479
// do not continue if the click event came from a form submit
@@ -742,7 +758,7 @@ export class DateTime extends BaseInput<DateTimeData> implements AfterViewInit,
742
758
* @hidden
743
759
*/
744
760
getValue ( ) : DateTimeData {
745
- return this . _value ;
761
+ return this . _internalValue ;
746
762
}
747
763
748
764
/**
0 commit comments