Rather that having to define a custom format for each call to the date
filter, is there a way to globally define a default format (other than \'medium\'
It's not what you explicitly asked for, use a decorator. it's built in angular and designed to patch services
, directives
, filters
etc ...
in your case, if the date filter is not provided, you should use your custom date format.
app.config(function ($provide) {
$provide.decorator('dateFilter', function ($delegate) {
return function () {
// Check if the date format argument is not provided
if (!arguments[1]) {
arguments[1] = 'dd MMMM @ HH:mm:ss';
}
var value = $delegate.apply(null, arguments);
return value;
};
})
});