mirror of
https://github.com/tdurieux/anonymous_github.git
synced 2026-07-06 13:47:59 +02:00
fix: handle empty date in human time format
This commit is contained in:
@@ -107,6 +107,9 @@ angular
|
|||||||
})
|
})
|
||||||
.filter("humanTime", function () {
|
.filter("humanTime", function () {
|
||||||
return function humanTime(seconds) {
|
return function humanTime(seconds) {
|
||||||
|
if (!seconds) {
|
||||||
|
return "never";
|
||||||
|
}
|
||||||
if (seconds instanceof Date)
|
if (seconds instanceof Date)
|
||||||
seconds = Math.round((Date.now() - seconds) / 1000);
|
seconds = Math.round((Date.now() - seconds) / 1000);
|
||||||
if (typeof seconds == "string")
|
if (typeof seconds == "string")
|
||||||
|
|||||||
Reference in New Issue
Block a user