-
Notifications
You must be signed in to change notification settings - Fork 2
feat: Extend registration and problem statement deadlines to Jan 2nd 3PM #23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -37,8 +37,8 @@ export default function Profile() { | |||||||||||||||||||||||||||||||||||||
| const [joinTeamCode, setJoinTeamCode] = useState(""); | ||||||||||||||||||||||||||||||||||||||
| const [joining, setJoining] = useState(false); | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| // 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'); | ||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||
| 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); | |
| }; | |
| }, []); |
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -33,12 +33,23 @@ const MyForm: React.FC = () => { | |||||||||
| const [popUp, setPopUp] = useState(false); | ||||||||||
| const [agreedToRules, setAgreedToRules] = useState(false); | ||||||||||
| 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'); | ||||||||||
|
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'); | |
| // Check if registration is still open (until Jan 2nd, 3PM 2026, UTC) | |
| const isRegistrationOpen = new Date() < new Date('2026-01-02T15:00:00Z'); |
Copilot
AI
Jan 2, 2026
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.