Skip to content

Commit

Permalink
fix: date adds seconds
Browse files Browse the repository at this point in the history
  • Loading branch information
R-K-H committed Oct 14, 2024
1 parent 1cd71f6 commit 4eb444d
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 4eb444d

Please sign in to comment.