diff options
author | Martin Fischer <martin@push-f.com> | 2022-10-08 07:50:49 +0200 |
---|---|---|
committer | Martin Fischer <martin@push-f.com> | 2022-10-08 07:50:49 +0200 |
commit | e79b2892cdb093bc157b5b631eaf0e0af700b7b4 (patch) | |
tree | 3b63361300ac78b5fa3028e6d9d8524322a80232 /Vote.php | |
parent | f8b420057e07a17456a10db714aa1b7d0faf8098 (diff) |
display when a vote has ended
Diffstat (limited to 'Vote.php')
-rw-r--r-- | Vote.php | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -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()); } } |