Skip to content

Conversation

@CherukuriPavanKumar
Copy link
Collaborator

No description provided.

Copilot AI review requested due to automatic review settings January 2, 2026 06:34
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment on lines +37 to +38
// Check if registration is still open (until Jan 2nd, 3PM 2026)
const isRegistrationOpen = new Date() < new Date('2026-01-02T15:00:00');
Copy link

Copilot AI Jan 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
// 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');

Copilot uses AI. Check for mistakes.
Comment on lines +40 to +41
// Check if editing is allowed (until Jan 2nd, 3PM 2026)
const isEditingAllowed = new Date() < new Date('2026-01-02T15:00:00');
Copy link

Copilot AI Jan 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
// 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');

Copilot uses AI. Check for mistakes.
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');
Copy link

Copilot AI Jan 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
// 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');
Copy link

Copilot AI Jan 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
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);
};
}, []);

Copilot uses AI. Check for mistakes.
@ManasMalla ManasMalla merged commit e704739 into main Jan 2, 2026
6 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants