diff --git a/platypush/backend/http/webapp/src/utils/DateTime.vue b/platypush/backend/http/webapp/src/utils/DateTime.vue index 05b7393076..e76a965c06 100644 --- a/platypush/backend/http/webapp/src/utils/DateTime.vue +++ b/platypush/backend/http/webapp/src/utils/DateTime.vue @@ -3,6 +3,8 @@ export default { name: "DateTime", methods: { formatDate(date, year=false) { + if (date == null) + return null if (typeof date === 'number') date = new Date(date * 1000) else if (typeof date === 'string') @@ -12,6 +14,8 @@ export default { }, formatTime(date, seconds=true) { + if (date == null) + return null if (typeof date === 'number') date = new Date(date * 1000) if (typeof date === 'string') @@ -21,6 +25,9 @@ export default { }, formatDateTime(date, year=false, seconds=true, skipTimeIfMidnight=false) { + if (date == null) + return null + const now = new Date() if (typeof date === 'number') @@ -37,6 +44,9 @@ export default { }, formatDuration(duration, seconds=true) { + if (duration == null) + return null + if (duration == null) return ''