refactor CR Joan

This commit is contained in:
Carlos Jimenez 2018-08-29 08:15:49 +02:00
parent 5d6a8f773c
commit 1b51ab7e6d
1 changed files with 3 additions and 1 deletions

View File

@ -9,7 +9,9 @@ dateTime.$inject = ['$filter'];
export default function dateTime($filter) {
return function(input, format) {
return $filter('date')(new Date(input), format);
let value = typeof input === 'string' ? new Date(input) : input;
return $filter('date')(value, format);
};
}
ngModule.filter('dateTime', dateTime);