Angular material introduced a new date picker component found here.
I want the date returned by this component to be in the format yyy-mm-dd but I am not su
Using $filter instead of moment.js and in reference to responses from @Ian Poston Framer and @java dev for me the following finally worked for me:
angular
.module('App', ['ngMaterial'])
.run(function($mdDateLocale, $filter) {
$mdDateLocale.formatDate = function(date) {
return $filter('date')(date, "dd-MM-yyyy");
};
})
I couldn't inject $filter into.config because it's not a provider, so I had to do it inside .run with $mdDateLocale.