Skip to content

Commit

Permalink
fix min period date calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
Balcan committed Dec 23, 2024
1 parent b61b828 commit 3b98443
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ class EventPeriodRepository(private val d2: D2) {
generatePeriod(PeriodType.Daily, currentPeriod.startDate()!!, expiryDays ?: 0)
.startDate()

return if (currentDate.after(previousPeriodLastDay)) {
return if (currentDate.after(previousPeriodLastDay) or (currentDate == previousPeriodLastDay)) {
currentPeriod.startDate()
} else {
generatePeriod(periodType, offset = -1).startDate()
generatePeriod(periodType, currentDate, offset = -1).startDate()
} ?: Date()
}

Expand Down

0 comments on commit 3b98443

Please sign in to comment.