From a5819c492e5eed495c332f0221fd134af24b60cb Mon Sep 17 00:00:00 2001 From: Henri Bergius Date: Thu, 27 Dec 2018 15:31:50 +0100 Subject: [PATCH] Handle past-time --- countdown/index.html | 3 +++ 1 file changed, 3 insertions(+) diff --git a/countdown/index.html b/countdown/index.html index d0d0f09..aefc365 100644 --- a/countdown/index.html +++ b/countdown/index.html @@ -50,6 +50,9 @@ }; function prettyPrintTime(value) { var sec_num = parseInt(value, 10); + if (sec_num < 0) { + return '00:00'; + } var hours = Math.floor(sec_num / 3600); var minutes = Math.floor((sec_num - (hours * 3600)) / 60); var seconds = sec_num - (hours * 3600) - (minutes * 60);