cast timestamp to number

This commit is contained in:
Thomas Rupprecht 2022-12-10 15:28:13 +01:00 committed by Igor Scheller
parent 5da586bc2c
commit 61cff64d96
1 changed files with 1 additions and 1 deletions

View File

@ -75,7 +75,7 @@ function formatFromNow(timestamp) {
*/ */
ready(() => { ready(() => {
document.querySelectorAll('[data-countdown-ts]').forEach((element) => { document.querySelectorAll('[data-countdown-ts]').forEach((element) => {
const timestamp = element.dataset.countdownTs; const timestamp = Number(element.dataset.countdownTs);
const template = element.innerHTML; const template = element.innerHTML;
element.innerHTML = template.replace('%c', formatFromNow(timestamp)); element.innerHTML = template.replace('%c', formatFromNow(timestamp));
setInterval(() => { setInterval(() => {