Commit b6c92972 authored by Ayhan Sipahi's avatar Ayhan Sipahi

FIX, rfix #5453, p100 #5453, fixes GH-107 date picker disabled behavior...

FIX, rfix #5453, p100 #5453, fixes GH-107 date picker disabled behavior changed date picker null handled
parent 6bc64990
......@@ -18,7 +18,7 @@
id="{{form.key.slice(-1)[0]}}"
ng-model-options="form.ngModelOptions"
ng-model="$$value$$"
ng-disabled="form.is_disabled()"
readonly
schema-validate="form"
name="{{form.key.slice(-1)[0]}}"
aria-describedby="{{form.key.slice(-1)[0] + 'Status'}}"
......
......@@ -739,10 +739,6 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
return deferred.promise;
}
},
disabled: false,
is_disabled: function () {
return this.disabled;
},
status: {opened: false},
open: function ($event) {
this.disabled = true;
......@@ -755,8 +751,8 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
},
format: 'dd.MM.yyyy',
onSelect: function () {
this.disabled = false;
scope.model[k] = angular.copy(generator.dateformatter(scope.model[k]));
return false;
}
};
}
......@@ -984,7 +980,7 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
*/
generator.dateformatter = function (formObject) {
var ndate = new Date(formObject);
if (isNaN(ndate)) {
if (isNaN(ndate) || formObject === null) {
return '';
} else {
var newdatearray = Moment(ndate).format('DD.MM.YYYY');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment