Skip to content

Commit

Permalink
fix: smooth duviri times (#481)
Browse files Browse the repository at this point in the history
  • Loading branch information
TobiTenno authored Nov 28, 2023
1 parent 089fb7d commit 3017c40
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/models/DuviriCycle.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@ const getStageInfo = () => {
const stateDelta = cycleDelta % stateTime;
const untilNext = stateTime - stateDelta;
const expiry = new Date(Date.now() + untilNext * 1000);
expiry.setSeconds(0);
expiry.setMilliseconds(0);
const activation = new Date(expiry.getTime() - stateTime * 1000);
activation.setSeconds(0);
activation.setMilliseconds(0);
return {
state: states[stateInd],
expiry,
Expand Down

0 comments on commit 3017c40

Please sign in to comment.