Skip to content

Commit

Permalink
Changes for vote delay daily sites issues
Browse files Browse the repository at this point in the history
  • Loading branch information
BenCodez committed Mar 15, 2024
1 parent d81a113 commit c3df294
Showing 1 changed file with 6 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import java.time.Instant;
import java.time.LocalDateTime;
import java.time.ZoneId;
import java.time.temporal.ChronoUnit;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Date;
Expand Down Expand Up @@ -281,18 +282,16 @@ public boolean canVoteSite(VoteSite voteSite) {
.withMinute(0).withSecond(0);
LocalDateTime resetTimeTomorrow = resetTime.plusHours(24);

if (lastVote.isBefore(resetTimeTomorrow)) {
if (lastVote.isBefore(resetTime)) {
if (now.isAfter(resetTime)) {
return true;
} else {
return false;
}
if (ChronoUnit.HOURS.between(lastVote, resetTime) > voteSite.getVoteDelay()) {
if (now.isAfter(resetTime)) {
return true;
}
} else {
if (now.isAfter(resetTimeTomorrow)) {
return true;
}
}

}
} catch (Exception e) {
e.printStackTrace();
Expand Down

0 comments on commit c3df294

Please sign in to comment.