Skip to content

Commit

Permalink
No need to get previous period when startDate
Browse files Browse the repository at this point in the history
is included on period API response
  • Loading branch information
kristoferlund committed Aug 11, 2023
1 parent 82ed712 commit 5af9c01
Showing 1 changed file with 1 addition and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,16 +43,8 @@ export function getPeriodDatesConfig(
throw new Error('Period not found');
}

const previousPeriod = getPreviousPeriod(periods, period);
if (!previousPeriod) {
return {
startDate: new Date('2000-01-01').toISOString(), // Ensure there is always a startDate.
endDate: period.endDate,
};
}

return {
startDate: previousPeriod.endDate,
startDate: period.startDate,
endDate: period.endDate,
};
}
Expand Down

0 comments on commit 5af9c01

Please sign in to comment.