From f5262954bcb7266735392fde25e57985b9bb71be Mon Sep 17 00:00:00 2001 From: Gerard Date: Tue, 5 Mar 2019 14:08:00 +0100 Subject: [PATCH] bug with filter giving wrong dates fixed --- front/core/filters/dateTime.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/front/core/filters/dateTime.js b/front/core/filters/dateTime.js index de1506ead..fdda69870 100644 --- a/front/core/filters/dateTime.js +++ b/front/core/filters/dateTime.js @@ -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); }; }