From 61cff64d967dd5cc867c45ebf416c1ce00c60032 Mon Sep 17 00:00:00 2001 From: Thomas Rupprecht Date: Sat, 10 Dec 2022 15:28:13 +0100 Subject: [PATCH] cast timestamp to number --- resources/assets/js/countdown.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/assets/js/countdown.js b/resources/assets/js/countdown.js index 2909e566..cf47aaa2 100644 --- a/resources/assets/js/countdown.js +++ b/resources/assets/js/countdown.js @@ -75,7 +75,7 @@ function formatFromNow(timestamp) { */ ready(() => { document.querySelectorAll('[data-countdown-ts]').forEach((element) => { - const timestamp = element.dataset.countdownTs; + const timestamp = Number(element.dataset.countdownTs); const template = element.innerHTML; element.innerHTML = template.replace('%c', formatFromNow(timestamp)); setInterval(() => {