Skip to content

Commit

Permalink
Merge pull request #2143 from GiganticMinecraft/fix/gachaEventHolding…
Browse files Browse the repository at this point in the history
…FirstDay

fix: ガチャイベントの開催日時に初日と最終日が含まれていなかった不具合を修正
  • Loading branch information
Lucky3028 authored Jul 2, 2023
2 parents 2f294a8 + c9489b3 commit 2c7669f
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,10 @@ case class GachaEvent(eventName: GachaEventName, startDate: LocalDate, endDate:
*/
def isHolding: Boolean = {
val now = LocalDate.now()
val isAfterStartDateOrFirstDay = now.equals(startDate) || now.isAfter(startDate)
val isBeforeEndDateOrEndDay = now.equals(endDate) || now.isBefore(endDate)

now.isAfter(startDate) && now.isBefore(endDate)
isAfterStartDateOrFirstDay && isBeforeEndDateOrEndDay
}

}

0 comments on commit 2c7669f

Please sign in to comment.