refactor CR Joan
This commit is contained in:
parent
5d6a8f773c
commit
1b51ab7e6d
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue