bug with filter giving wrong dates fixed
gitea/salix/test This commit looks good Details

This commit is contained in:
Gerard 2019-03-05 14:08:00 +01:00
parent 4fe4c7886b
commit f5262954bc
1 changed files with 7 additions and 3 deletions

View File

@ -9,9 +9,13 @@ dateTime.$inject = ['$filter'];
export default function dateTime($filter) {
return function(input, format) {
let value = new Date(input);
let offset = value.getTimezoneOffset() * 60000;
value.setTime(value.getTime() + offset);
let value;
if (input) {
value = new Date(input);
let offset = value.getTimezoneOffset() * 60000;
value.setTime(value.getTime() + offset);
}
return $filter('date')(value, format);
};
}