diff --git a/app.js b/app.js index 59e0f5a..eeb339e 100644 --- a/app.js +++ b/app.js @@ -25,7 +25,7 @@ hbs.registerHelper("json", function (obj) { }); hbs.registerHelper("timestamp", function (timestamp) { - var dateObj = new Date(timestamp.seconds * 1000); + var dateObj = new Date(timestamp * 1000); const day = dateObj.getUTCDate(); const month = dateObj.getUTCMonth() + 1; const year = dateObj.getUTCFullYear(); diff --git a/routes/index.js b/routes/index.js index b64861e..a59a2dd 100644 --- a/routes/index.js +++ b/routes/index.js @@ -174,14 +174,14 @@ function getBlockTimes(last100Headers, algo) { // This happens if there are no blocks for a specific algorithm in last100headers return blocktimes; } - let lastBlockTime = parseInt(last100Headers[i].timestamp.seconds); + let lastBlockTime = parseInt(last100Headers[i].timestamp); i++; while (i < last100Headers.length && blocktimes.length < 60) { if (!algo || last100Headers[i].pow.pow_algo === algo) { blocktimes.push( - (lastBlockTime - parseInt(last100Headers[i].timestamp.seconds)) / 60 + (lastBlockTime - parseInt(last100Headers[i].timestamp)) / 60 ); - lastBlockTime = parseInt(last100Headers[i].timestamp.seconds); + lastBlockTime = parseInt(last100Headers[i].timestamp); } else { blocktimes.push(0); }