Skip to content

Commit cf9c852

Browse files
committed
fix: Adjust voting period dates in the API, update associated error messages, and enable HTML rendering for UI alerts.
1 parent 573d25d commit cf9c852

2 files changed

Lines changed: 8 additions & 8 deletions

File tree

api/src/controllers/vote.controller.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ class VoteController {
1515
) { }
1616

1717
// Voting starts on March 23, 2026 at 12:00 AM EDT
18-
public static readonly VOTING_START_DATE = new Date('2026-03-22T12:00:00-04:00');
18+
public static readonly VOTING_START_DATE = new Date('2026-03-21T12:00:00-04:00');
1919
// Voting ends on March 30, 2026 at 11:59 PM EDT
20-
public static readonly VOTING_END_DATE = new Date('2026-03-30T23:59:59-04:00');
20+
public static readonly VOTING_END_DATE = new Date('2026-03-29T23:59:59-04:00');
2121
// created date for new members to be eligible to vote
2222
public static readonly REQUIRED_MEMBER_IMMIGRATION_DATE = new Date('2025-10-01T23:59:59-04:00');
2323

@@ -35,7 +35,7 @@ class VoteController {
3535
const now = new Date();
3636
if (now <= VoteController.VOTING_START_DATE || now >= VoteController.VOTING_END_DATE) {
3737
return res.status(403).json({
38-
error: 'Voting will open on March 23, 2026 and will close on March 30, 2026',
38+
error: 'Voting will open on March 22, 2026 and will close on March 29, 2026',
3939
});
4040
}
4141

@@ -96,13 +96,13 @@ class VoteController {
9696
const now = new Date();
9797
if (now <= VoteController.VOTING_START_DATE) {
9898
return res.status(403).json({
99-
error: 'Voting will open on March 23, 2026',
99+
error: 'Voting will open on March 22, 2026',
100100
});
101101
}
102102

103103
if (now >= VoteController.VOTING_END_DATE) {
104104
return res.status(403).json({
105-
error: 'Voting closed on March 30, 2026',
105+
error: 'Voting closed on March 29, 2026',
106106
});
107107
}
108108

@@ -123,7 +123,7 @@ class VoteController {
123123
if (new Date(immigrationDate) > VoteController.REQUIRED_MEMBER_IMMIGRATION_DATE) {
124124
return res.status(403).json({
125125
error: 'You must be a citizen of Cybertown prior to October 1, 2025 to vote. ' +
126-
`Your immigration date is ${immigrationDate}.`,
126+
`<br>Your immigration date is ${immigrationDate}.`,
127127
});
128128
}
129129

spa/src/pages/MayorElection.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@
2323
</div>
2424

2525
<div class="vote-section">
26-
<span v-if="error" class="text-red-500">{{ error }}</span>
27-
<span v-if="success" class="text-green-500">{{ success }}</span>
26+
<span v-if="error" class="text-red-500 text-center" v-html="error"></span>
27+
<span v-if="success" class="text-green-500 text-center" v-html="success"></span>
2828
<span v-if="!error && !success">
2929
<h3 class="vote-title">Cast Your Vote</h3>
3030
<div class="vote-controls">

0 commit comments

Comments
 (0)