summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Fischer <martin@push-f.com>2022-10-08 07:50:49 +0200
committerMartin Fischer <martin@push-f.com>2022-10-08 07:50:49 +0200
commite79b2892cdb093bc157b5b631eaf0e0af700b7b4 (patch)
tree3b63361300ac78b5fa3028e6d9d8524322a80232
parentf8b420057e07a17456a10db714aa1b7d0faf8098 (diff)
display when a vote has ended
-rw-r--r--Vote.php7
-rw-r--r--i18n/en.json3
2 files changed, 6 insertions, 4 deletions
diff --git a/Vote.php b/Vote.php
index 1d1c302..b27cb5b 100644
--- a/Vote.php
+++ b/Vote.php
@@ -42,11 +42,12 @@ class VoteHooks {
$endDate->setTime(23, 59);
$now = new Datetime();
+ $tz = date_default_timezone_get();
+
if ($now > $endDate) {
- $voteClosed = 'The voting period has ended.';
+ $voteClosed = $msg('vote-ended', $endDate->format('jS F Y, H:i') . " ($tz)");
} else {
- $tz = date_default_timezone_get();
- $text .= $msg('vote-end', $endDate->format('jS F Y, H:i') . " ($tz)");
+ $text .= $msg('vote-will-end', $endDate->format('jS F Y, H:i') . " ($tz)");
$parser->getOutput()->updateCacheExpiry($endDate->getTimestamp() - $now->getTimestamp());
}
}
diff --git a/i18n/en.json b/i18n/en.json
index 0a69dc8..3be3c6f 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -21,7 +21,8 @@
"vote-already-no": "You already voted to oppose.",
"vote-already-abstain": "You already chose to abstain.",
"vote-change": "Change your vote from $1 to $2.",
- "vote-end": "This vote will end on $1.",
+ "vote-will-end": "This vote will end on $1.",
+ "vote-ended": "The voting period has ended on $1.",
"vote-cancelled": "The vote has been cancelled.",
"pages-with-open-votes-category": "Pages with open votes",
"pages-with-vote-errors-category": "Pages with vote errors"