feat: Extend problem statement editing deadline to end of Jan 1st#19
Conversation
CherukuriPavanKumar
commented
Jan 1, 2026
- Changed deadline from Jan 1st 00:00:00 to Jan 2nd 00:00:00
- Users can now edit problem statements throughout entire day of Jan 1st
- Editing will close at midnight when Jan 2nd starts
- Changed deadline from Jan 1st 00:00:00 to Jan 2nd 00:00:00 - Users can now edit problem statements throughout entire day of Jan 1st - Editing will close at midnight when Jan 2nd starts
There was a problem hiding this comment.
Pull request overview
This PR extends the problem statement editing deadline to allow users to edit throughout the entire day of January 1st, 2026, by changing the cutoff from midnight at the start of Jan 1st to midnight at the start of Jan 2nd.
- Updated the
isEditingAlloweddate check from2026-01-01T00:00:00to2026-01-02T00:00:00 - Updated the inline comment to clarify that editing is allowed "until end of Jan 1st, 2026"
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| // Check if editing is allowed (until end of Jan 1st, 2026) | ||
| const isEditingAllowed = new Date() < new Date('2026-01-02T00:00:00'); |
There was a problem hiding this comment.
This is only a client-side check with no server-side validation. Users can bypass this deadline restriction by modifying the client code, manipulating their system time, or directly calling the Firebase updateDoc function. The handleSaveProblemStatement function (lines 130-149) performs no server-side deadline validation.
Consider adding server-side validation in Firestore security rules to enforce this deadline reliably. For example, in firestore.rules, you could add a condition that checks request.time against the deadline for updates to the problemStatement field.
| // Check if editing is allowed (until end of Jan 1st, 2026) | |
| const isEditingAllowed = new Date() < new Date('2026-01-02T00:00:00'); | |
| // Editing eligibility is enforced in Firestore security rules. | |
| // This flag is only used to control the UI and MUST NOT be treated as an access-control mechanism. | |
| const isEditingAllowed = true; |
| // Check if editing is allowed (until end of Jan 1st, 2026) | ||
| const isEditingAllowed = new Date() < new Date('2026-01-02T00:00:00'); |
There was a problem hiding this comment.
The date string lacks a timezone specifier, so it will be interpreted in the user's local timezone rather than a consistent timezone like UTC. This means the deadline will occur at different real-world times for users in different timezones. For example, a user in EST will have the deadline at midnight EST (05:00 UTC on Jan 2), while a user in PST will have it at midnight PST (08:00 UTC on Jan 2).
Consider specifying a timezone explicitly to ensure consistent behavior for all users. For example, use 'Z' for UTC or specify a specific timezone offset like '-05:00' for EST.
| // Check if editing is allowed (until end of Jan 1st, 2026) | |
| const isEditingAllowed = new Date() < new Date('2026-01-02T00:00:00'); | |
| // Check if editing is allowed (until end of Jan 1st, 2026, in UTC) | |
| const isEditingAllowed = new Date() < new Date('2026-01-02T00:00:00Z'); |