kordwarshuis / cardgame

0 stars 4 forks source link

Tweeps could have "××:yy hrs old - ZZZZ followers" ?! and anti chronological presented #22

Closed henkvancann closed 3 years ago

kordwarshuis commented 3 years ago

Important to realise: ××:yy hrs old means after a certain time interval this should be re-calculated. What should be the interval.

henkvancann commented 3 years ago

2 minutes?

kordwarshuis commented 3 years ago

It goes from 'a few seconds ago' to 'a minute ago', '2 minutes ago' etc, so I have set the Interval to 60 sec:

function reCalculateTimestamp() {        
    setInterval(function() {
        var allTimestamps = document.querySelectorAll('.timestamp');
        allTimestamps.forEach(function(a) {
            a.innerHTML = timestampTweet(a.dataset.createdat);
        });
    }, 60000);
}