Skip to content

Commit

Permalink
add dynamic offset for time
Browse files Browse the repository at this point in the history
  • Loading branch information
ae2079 committed Nov 16, 2024
1 parent 58f7f5f commit 7854350
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/scripts/runFundingPotService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,15 @@ async function generateBatchFile(batchNumber: number) {
round.startDate = round.beginDate;
}

const now = new Date();
const offsetSecs = now.getTimezoneOffset() * 60;

const batchConfig = {
TIMEFRAME: {
FROM_TIMESTAMP: Math.floor(new Date(round.startDate).getTime() / 1000), // Convert to timestamp
TO_TIMESTAMP: Math.floor(new Date(round.endDate).getTime() / 1000),
FROM_TIMESTAMP:
Math.floor(new Date(round.startDate).getTime() / 1000) - offsetSecs, // Convert to timestamp
TO_TIMESTAMP:
Math.floor(new Date(round.endDate).getTime() / 1000) - offsetSecs,
},
VESTING_DETAILS: getStreamDetails(isEarlyAccess),
LIMITS: {
Expand Down

0 comments on commit 7854350

Please sign in to comment.