I would like to change format of date input field from dd/mm/yyy to dd.mm.yyyy Is it possible and how and is there any chance to get that datepicker working in another browsers as well?
<body ng-app="myApp">
<div ng-controller="MyCtrl">
<input type="date" ng-model="date" value="{{date}}">
<p>{{date}}</p>
<input type="time" ng-model="time" value="{{time}}">
</div>
you can use custom filter for it as below
<div ng-app="myApp">
<div ng-controller="myCtrl">
<p>{{date | divideByPoint}}</p> // displays as dd.mm.yyyy(21.12.2014)
</div>
</div>
below filter : divideByPoint
var app = angular.module('myApp',[]);
//controller
app.controller('myCtrl',myCtrl);
myCtrl.$inject = ["$scope"];
function myCtrl($scope){
$scope.date = "21/12/2014"
}
//filter
app.filter('divideByPoint',function(){
var pattern = /\//g;
return function(input) {
return input.replace(pattern,'.');
}
})
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.