Skip to content
This repository has been archived by the owner on Nov 4, 2024. It is now read-only.

Commit

Permalink
fix: updated calculcation to fix startdate (#4210)
Browse files Browse the repository at this point in the history
  • Loading branch information
hasan-ozaynaci authored Apr 28, 2022
1 parent d7b71cf commit e0deb45
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/common/src/utils/timeframe/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export function getDaysForTimeframe(timeframe: TimeframeOption): number {
const date = new Date('1 September 2020');
const today = new Date();
const diffInDays = Math.round(
Math.abs(date.valueOf() - today.valueOf()) / (1000 * DAY_IN_SECONDS)
Math.abs(date.valueOf() - today.valueOf()) / (1000 * DAY_IN_SECONDS) - 1
);
return diffInDays;
}
Expand Down

0 comments on commit e0deb45

Please sign in to comment.