feat: Extend registration and problem statement deadlines to Jan 2nd 3PM#23
Conversation
There was a problem hiding this comment.
Pull request overview
This PR extends the registration and problem statement submission deadlines for Techsprint from January 1st to January 2nd, 2026 at 3:00 PM. The changes ensure users cannot register or edit problem statements after this new deadline has passed.
Key Changes:
- Added registration deadline check in the register page that redirects users with an alert if the deadline has passed
- Updated the editing deadline in the profile page to match the new January 2nd 3PM deadline
- Both pages now consistently enforce the same deadline across registration and problem statement editing
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
src/app/register/page.tsx |
Adds new registration deadline check with alert and redirect logic for users attempting to register after January 2nd, 2026 at 3PM |
src/app/profile/page.tsx |
Updates the editing deadline from January 2nd 9AM to January 2nd 3PM to match the extended registration deadline |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| // Check if registration is still open (until Jan 2nd, 3PM 2026) | ||
| const isRegistrationOpen = new Date() < new Date('2026-01-02T15:00:00'); |
There was a problem hiding this comment.
The deadline date '2026-01-02T15:00:00' does not specify a timezone, which means it will be interpreted differently based on each user's local timezone. This could result in inconsistent deadline enforcement across different geographical locations. Consider using a specific timezone (e.g., '2026-01-02T15:00:00Z' for UTC or '2026-01-02T15:00:00-05:00' for EST) to ensure all users experience the same deadline.
| // Check if registration is still open (until Jan 2nd, 3PM 2026) | |
| const isRegistrationOpen = new Date() < new Date('2026-01-02T15:00:00'); | |
| // Check if registration is still open (until Jan 2nd, 3PM 2026, UTC) | |
| const isRegistrationOpen = new Date() < new Date('2026-01-02T15:00:00Z'); |
| // Check if editing is allowed (until Jan 2nd, 3PM 2026) | ||
| const isEditingAllowed = new Date() < new Date('2026-01-02T15:00:00'); |
There was a problem hiding this comment.
The deadline date '2026-01-02T15:00:00' does not specify a timezone, which means it will be interpreted differently based on each user's local timezone. This could result in inconsistent deadline enforcement across different geographical locations. Consider using a specific timezone (e.g., '2026-01-02T15:00:00Z' for UTC or '2026-01-02T15:00:00-05:00' for EST) to ensure all users experience the same deadline.
| // Check if editing is allowed (until Jan 2nd, 3PM 2026) | |
| const isEditingAllowed = new Date() < new Date('2026-01-02T15:00:00'); | |
| // Check if editing is allowed (until Jan 2nd, 3PM 2026, in UTC) | |
| const isEditingAllowed = new Date() < new Date('2026-01-02T15:00:00Z'); |
| const [isCompleteRegistration, setIsCompleteRegistration] = useState(false); | ||
|
|
||
| // Check if registration is still open (until Jan 2nd, 3PM 2026) | ||
| const isRegistrationOpen = new Date() < new Date('2026-01-02T15:00:00'); |
There was a problem hiding this comment.
The isRegistrationOpen constant is evaluated only once when the component mounts. If a user keeps the page open past the deadline (e.g., opens it at 2:59 PM and stays on the page past 3:00 PM), the deadline check won't update. Consider moving this check inside the useEffect or using a state variable that updates periodically to ensure the deadline is enforced even for users who keep the page open.
| // Check if editing is allowed (until Jan 1st, 2026) | ||
| const isEditingAllowed = new Date() < new Date('2026-01-02T09:00:00'); | ||
| // Check if editing is allowed (until Jan 2nd, 3PM 2026) | ||
| const isEditingAllowed = new Date() < new Date('2026-01-02T15:00:00'); |
There was a problem hiding this comment.
The isEditingAllowed constant is evaluated only once when the component mounts. If a user keeps the page open past the deadline (e.g., opens it at 2:59 PM and stays on the page past 3:00 PM), the deadline check won't update. Consider moving this check inside the useEffect or using a state variable that updates periodically to ensure the deadline is enforced even for users who keep the page open.
| const isEditingAllowed = new Date() < new Date('2026-01-02T15:00:00'); | |
| const [isEditingAllowed, setIsEditingAllowed] = useState(() => new Date() < new Date('2026-01-02T15:00:00')); | |
| useEffect(() => { | |
| const deadlineTime = new Date('2026-01-02T15:00:00').getTime(); | |
| const updateEditingAllowed = () => { | |
| setIsEditingAllowed(Date.now() < deadlineTime); | |
| }; | |
| updateEditingAllowed(); | |
| const intervalId = setInterval(updateEditingAllowed, 60_000); | |
| return () => { | |
| clearInterval(intervalId); | |
| }; | |
| }, []); |
No description provided.