Fix next sunday.

This commit is contained in:
GanyusLeftHorn 2022-06-26 03:05:08 -07:00 committed by Melledy
parent 7cb4c9fee2
commit 54c4f60abb

View File

@ -352,7 +352,10 @@ public class BattlePassManager {
//
public BattlePassSchedule getScheduleProto() {
var nextSundayDate = LocalDate.now().with(TemporalAdjusters.next(DayOfWeek.SUNDAY));
var currentDate = LocalDate.now();
var nextSundayDate = (currentDate.getDayOfWeek() == DayOfWeek.SUNDAY)
? currentDate
: LocalDate.now().with(TemporalAdjusters.next(DayOfWeek.SUNDAY));
var nextSundayTime = LocalDateTime.of(nextSundayDate.getYear(), nextSundayDate.getMonthValue(), nextSundayDate.getDayOfMonth(), 23, 59, 59);
BattlePassSchedule.Builder schedule = BattlePassSchedule.newBuilder()