Commit 54c4f60a authored by GanyusLeftHorn's avatar GanyusLeftHorn Committed by Melledy
Browse files

Fix next sunday.

parent 7cb4c9fe
...@@ -352,7 +352,10 @@ public class BattlePassManager { ...@@ -352,7 +352,10 @@ public class BattlePassManager {
// //
public BattlePassSchedule getScheduleProto() { 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); var nextSundayTime = LocalDateTime.of(nextSundayDate.getYear(), nextSundayDate.getMonthValue(), nextSundayDate.getDayOfMonth(), 23, 59, 59);
BattlePassSchedule.Builder schedule = BattlePassSchedule.newBuilder() BattlePassSchedule.Builder schedule = BattlePassSchedule.newBuilder()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment