#755 date picker fixes

fix and issue with opening a date picker after typing incorrect date
This commit is contained in:
Denys Vuika 2016-11-21 15:32:01 +00:00 committed by Mario Romano
parent 7ea09bbde0
commit a3bfd532db

View File

@ -69,7 +69,11 @@ export class DateWidget extends WidgetComponent implements OnInit, AfterViewChec
onDateChanged() {
if (this.field.value) {
this.datePicker.time = moment(this.field.value, this.DATE_FORMAT);
let value = moment(this.field.value, this.DATE_FORMAT);
if (!value.isValid()) {
value = moment();
}
this.datePicker.time = value;
}
this.checkVisibility(this.field);
}