cast timestamp to number
This commit is contained in:
parent
5da586bc2c
commit
61cff64d96
|
@ -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(() => {
|
||||||
|
|
Loading…
Reference in New Issue