<input type="text" ng-model="user.User.DateOfBirth">
is in my view. user.User.DateOfBirth
is currently in YYYYMMDD
format, but I want it to show as mm/dd/yyyy
format in the view. Is it possible to convert this just for the display?
This also may help you
http://jsfiddle.net/mikeeconroy/Hu9m2/1/
.filter('myFormatDateFilter',function(){
return function(input){
if(angular.isDefined(input)){
if(input.length >= 8){
input = input.slice(0,8);
input = input.slice(4,6) + '/' + input.slice(6,8) + '/' + input.slice(0,4);
}
}
return input;
};
});