From 4eb444dbed6c5ea656e1d00707525e1fded3b002 Mon Sep 17 00:00:00 2001 From: Kollan House Date: Sun, 13 Oct 2024 18:04:43 -0700 Subject: [PATCH] fix: date adds seconds --- .../src/indexers/autocrat/autocrat-proposal-indexer.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/indexer/src/indexers/autocrat/autocrat-proposal-indexer.ts b/packages/indexer/src/indexers/autocrat/autocrat-proposal-indexer.ts index 69f8897..3d1ba62 100644 --- a/packages/indexer/src/indexers/autocrat/autocrat-proposal-indexer.ts +++ b/packages/indexer/src/indexers/autocrat/autocrat-proposal-indexer.ts @@ -237,13 +237,13 @@ export const AutocratProposalIndexer: IntervalFetchIndexer = { // Setup time to add to the date.. const timeLeftSecondsEstimate = (slotDifference.toNumber() * 400) / 1000 // MS to seconds - const timeLeftMinutesEstimate = timeLeftSecondsEstimate / 60 // MS to seconds to minutes - const timeLeftHoursEstimate = timeLeftMinutesEstimate / 60 + // const timeLeftMinutesEstimate = timeLeftSecondsEstimate / 60 // MS to seconds to minutes + // const timeLeftHoursEstimate = timeLeftMinutesEstimate / 60 const endedAt = new Date(currentTime.toUTCString()); - endedAt.setHours(endedAt.getHours() + timeLeftHoursEstimate); - endedAt.setMinutes(endedAt.getMinutes() + timeLeftMinutesEstimate); - endedAt.setSeconds(endedAt.getSeconds() + timeLeftSecondsEstimate); + // endedAt.setHours(endedAt.getHours() + timeLeftHoursEstimate); + // endedAt.setMinutes(endedAt.getMinutes() + timeLeftMinutesEstimate); + endedAt.setSeconds(endedAt.getSeconds() + timeLeftSecondsEstimate); // setSeconds accepts float and will increase to hours etc. await usingDb((db) => db