I used '(60 - date.getSeconds ()) * 1000);' the data refresh function method, and while it worked, it “drifted” over time (14 seconds later than I changed it!)
Since the data needed to be updated in a minute (and this obviously was not, since we have a clock on one page!), Here is the solution I found:
setInterval(function () { if(moment().format('ss') === "00"){ console.log('we are at the 0 - update the data!'); refresh_data(); } }, 1000);
This, of course, uses the .js moment to find the time “0”, and it certainly does what the OP asked for - it works per minute - every time!
CFP Support
source share