Create directive as below and use in HTML:
Directive:
var app = angular.module("MyApp", []);
var datefrmt = "yyyy-MM-dd";
app.directive('dateFormateModel', function (dateFilter) {
return {
require: 'ngModel',
link:function (scope, elm, attrs, ctrl) {
var dateFormat = datefrmt;
ctrl.$formatters.unshift(function (modelValue) {
return dateFilter(modelValue, dateFormat);
});
}
};
});
HTML:
<div class="propertyValue"><input type="text" ng-model="gc.tempApplicationSettingModel.CreatedDate" date-formate-model class="form-control" /></div>