Skip to content

Commit

Permalink
Remove redundant variable in isPeriodBetweenStartAndEnd
Browse files Browse the repository at this point in the history
Signed-off-by: Giovanni Baratta <[email protected]>
  • Loading branch information
giovannibaratta committed May 19, 2024
1 parent c4c3506 commit ef4eff1
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/utils/date.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,9 @@ export function isPeriodBetweenStartAndEnd(period: Period, start: Period, end: P
const isAfterStart = period.year > start.year || (period.year === start.year && period.month > start.month)
const isBeforeEnd = period.year < end.year || (period.year === end.year && period.month < end.month)

const isBetweenStartAndEnd = (isAfterStart && isBeforeEnd) ||
return (isAfterStart && isBeforeEnd) ||
(isSameAsStart && includeStart) ||
(isSameAsEnd && includeEnd)

return isBetweenStartAndEnd
}

export const dateToPeriod = (date: Date): Period => {
Expand Down

0 comments on commit ef4eff1

Please sign in to comment.