Emit value changes from <eg-date-select /> when the value is cleared.
The value emitted on clear is 'null'.
Signed-off-by: Bill Erickson <berickxx@gmail.com>
Signed-off-by: Josh Stompro <stompro@stompro.org>
[required]="required"
(blur)="propagateTouch(); onDateEnter()"
[(ngModel)]="current"
+ (ngModelChange)="inputChanged($event)"
(keyup.enter)="onDateEnter()"
(dateSelect)="onDateSelect($event)"/>
<div class="input-group-append">
Number(parts[0]), Number(parts[1]) - 1, Number(parts[2]));
}
+ // onDateSelect() is not called when the value is cleared.
+ // Handle that here.
+ inputChanged(value) {
+ if (value === null) {
+ this.onChangeAsDate.emit(null);
+ this.onChangeAsYmd.emit(null);
+ this.onChangeAsIso.emit(null);
+ this.propagateChange(null);
+ }
+ }
+
reset() {
this.current = {
year: null,