Skip to content

Commit

Permalink
Revert changes in date-time-picker.component
Browse files Browse the repository at this point in the history
  • Loading branch information
sascha11110 committed May 1, 2020
1 parent 09dc483 commit c1ca26f
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -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',
Expand Down Expand Up @@ -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();
Expand All @@ -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();
}
}

0 comments on commit c1ca26f

Please sign in to comment.