Added second voting
This commit is contained in:
@@ -76,7 +76,7 @@ public class VotingController {
|
||||
|
||||
@RequestMapping("/")
|
||||
public String WelcomeSite() {
|
||||
LocalDate finishDate = LocalDate.of(2021, Month.JANUARY,8);
|
||||
LocalDate finishDate = LocalDate.of(2021, Month.JANUARY,17);
|
||||
LocalDate now = LocalDate.now();
|
||||
|
||||
if(now.isAfter(finishDate)){
|
||||
|
||||
@@ -8,15 +8,38 @@
|
||||
</head>
|
||||
|
||||
<body class="center-screen">
|
||||
<div class="centered">
|
||||
<h1>Du hast schon abgestimmt!</h1>
|
||||
<button id="backButton" class="submitButton">Zurück zum Anfang</button>
|
||||
</div>
|
||||
<div class="centered">
|
||||
<h1>Du hast schon abgestimmt!</h1>
|
||||
<h2 id="time_remain">Nächste Abstimmung in: </h2>
|
||||
<button id="backButton" class="submitButton">Zurück zum Anfang</button>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
<script>
|
||||
document.getElementById("backButton").onclick = function() {
|
||||
location.href = "/";
|
||||
};
|
||||
|
||||
const zeroPad = (num, places) => String(num).padStart(places, '0')
|
||||
|
||||
// We can set endTime to whatever we want here (e.g. Midnight today )
|
||||
// Use moment().endOf('day') to do this.
|
||||
var dateFuture = new Date(2021, 00, 17, 0, 0);
|
||||
|
||||
// Show time remaining now.
|
||||
showTimeRemaining();
|
||||
|
||||
// Set a timer to update the displayed clock every 1000 milliseconds.
|
||||
setInterval(showTimeRemaining, 1000);
|
||||
|
||||
function showTimeRemaining() {
|
||||
var dateNow = Date.now();
|
||||
var days = zeroPad(Math.floor((dateFuture - dateNow) / (1000 * 60 * 60 * 24)), 2);
|
||||
var hours = zeroPad(Math.floor(((dateFuture - dateNow) - days * 1000 * 60 * 60 * 24) / (1000 * 60 * 60)), 2);
|
||||
var mins = zeroPad(Math.floor(((dateFuture - dateNow) - days * 1000 * 60 * 60 * 24 - hours * 1000 * 60 * 60) / (1000 * 60)), 2);
|
||||
var secs = zeroPad(Math.floor(((dateFuture - dateNow) - days * 1000 * 60 * 60 * 24 - hours * 1000 * 60 * 60 - mins * 1000 * 60) / 1000), 2);
|
||||
document.getElementById("time_remain").innerHTML = "Nächste Abstimmung in: " + days + "D " + hours + ":" + mins + ":" + secs;
|
||||
console.log("Nächste Abstimmung in: " + days + "D " + hours + ":" + mins + ":" + secs);
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
|
||||
|
||||
@@ -9,8 +9,8 @@
|
||||
|
||||
<body class="center-screen">
|
||||
<div class="centered">
|
||||
<h1>Das Voting wurde beendet!</h1>
|
||||
<h2>Informationen zu Votings sind der Adolfinumwebsite zu entnehmen</h2>
|
||||
<h1>Du scheinst zu spät zu sein!</h1>
|
||||
<h2>Momentan findet kein Voting statt</h2>
|
||||
<button id="backButton" class="submitButton">Zur Adolfinum Seite</button>
|
||||
</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user