From c1ca26f35a3b151b7958b12882d718e11141d7e5 Mon Sep 17 00:00:00 2001 From: Sascha Beele Date: Fri, 1 May 2020 18:52:47 +0200 Subject: [PATCH] Revert changes in date-time-picker.component --- .../date-time-picker/date-time-picker.component.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/main/webapp/app/shared/date-time-picker/date-time-picker.component.ts b/src/main/webapp/app/shared/date-time-picker/date-time-picker.component.ts index 4a3d1fb94532..5394004784c2 100644 --- a/src/main/webapp/app/shared/date-time-picker/date-time-picker.component.ts +++ b/src/main/webapp/app/shared/date-time-picker/date-time-picker.component.ts @@ -1,6 +1,7 @@ import { Component, ElementRef, EventEmitter, forwardRef, Input, Output, ViewChild } from '@angular/core'; import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms'; import { isMoment, Moment } from 'moment'; +import * as moment from 'moment'; @Component({ selector: 'jhi-date-time-picker', @@ -46,7 +47,8 @@ export class FormDateTimePickerComponent implements ControlValueAccessor { @Input() max: Moment; // Dates after this date are not selectable. @Output() valueChange = new EventEmitter(); - _onChange = () => {}; + // eslint-disable-next-line @typescript-eslint/no-unused-vars + _onChange = (val: Moment) => {}; valueChanged() { this.valueChange.emit(); @@ -60,13 +62,14 @@ export class FormDateTimePickerComponent implements ControlValueAccessor { this.value = value; } } - registerOnTouched() {} + // eslint-disable-next-line @typescript-eslint/no-unused-vars + registerOnTouched(fn: any) {} registerOnChange(fn: any) { this._onChange = fn; } updateField(newValue: Moment) { this.value = newValue; - this._onChange(); + this._onChange(moment(this.value)); this.valueChanged(); } }