diff --git a/client/core/src/datePicker/datePicker.js b/client/core/src/datePicker/datePicker.js index 79d7d6cd9..43f34d9df 100644 --- a/client/core/src/datePicker/datePicker.js +++ b/client/core/src/datePicker/datePicker.js @@ -37,7 +37,8 @@ class DatePicker extends Component { set model(value) { this._model = value; if (value && !this.modelView) { - let format = this._formatFlat2Angular(this.iniOptions.dateFormat || 'Y-m-d'); + let initialDateFormat = (this.iniOptions && this.iniOptions.dateFormat) ? this.iniOptions.dateFormat : 'Y-m-d'; + let format = this._formatFlat2Angular(initialDateFormat); this.modelView = this.$filter('date')(value, format); } } @@ -83,7 +84,7 @@ class DatePicker extends Component { let model; if (!value) { model = undefined; - } else if (!this.iniOptions.dateFormat || (this.iniOptions.dateFormat && this.iniOptions.dateFormat.startsWith('Y-m-d'))) { + } else if (!this.iniOptions || (this.iniOptions.dateFormat && this.iniOptions.dateFormat.startsWith('Y-m-d'))) { model = value; } else { let formats = this.iniOptions.dateFormat.split(/[ZT.,/ :-]/); diff --git a/client/route/src/create/create.html b/client/route/src/create/create.html index 90430b090..c85ae935c 100644 --- a/client/route/src/create/create.html +++ b/client/route/src/create/create.html @@ -11,7 +11,7 @@ Create Route - +