aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/frontend/tubo/utils.cljs7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/frontend/tubo/utils.cljs b/src/frontend/tubo/utils.cljs
index 58d6172..643031c 100644
--- a/src/frontend/tubo/utils.cljs
+++ b/src/frontend/tubo/utils.cljs
@@ -42,6 +42,7 @@
(defn format-duration
[num]
- (let [duration (js/Date. (* num 1000))
- slice #(.slice % (if (>= (.getUTCHours duration) 1) 11 14) 19)]
- (-> duration (.toISOString) slice)))
+ (let [duration (and (not (js/isNaN num)) (js/Date. (* num 1000)))
+ slice (and duration #(.slice % (if (>= (.getUTCHours duration) 1) 11 14) 19))]
+ (when slice
+ (-> duration (.toISOString) slice))))