fix: handle empty date in human time format

This commit is contained in:
tdurieux
2021-08-20 16:12:49 +02:00
parent 6b568905d3
commit 4d5e48b04c

View File

@@ -107,6 +107,9 @@ angular
})
.filter("humanTime", function () {
return function humanTime(seconds) {
if (!seconds) {
return "never";
}
if (seconds instanceof Date)
seconds = Math.round((Date.now() - seconds) / 1000);
if (typeof seconds == "string")