Skip to content

feat: Add date query parameter support for web interface#1413

Open
krapcys1-maker wants to merge 1 commit intobaires:masterfrom
krapcys1-maker:fix/date-query-param-1079
Open

feat: Add date query parameter support for web interface#1413
krapcys1-maker wants to merge 1 commit intobaires:masterfrom
krapcys1-maker:fix/date-query-param-1079

Conversation

@krapcys1-maker
Copy link

Summary

  • Added support for ?date=YYYY-MM-DD query parameter in the web interface
  • Changed from getStaticProps to getServerSideProps to access URL query params at request time
  • Preserved date parameter when user changes timezone

Problem

The API correctly handles the date parameter (/api?date=2023-11-08), but the web interface ignores it (/?date=2023-11-08 shows today's date instead).

Solution

  • Use getServerSideProps instead of getStaticProps to read query params
  • Parse date and tz parameters from the URL
  • Create Time object with custom date when provided
  • Handle invalid dates gracefully (fallback to current date)

Example Usage

https://shouldideploy.today/?date=2023-11-08
https://shouldideploy.today/?date=2023-11-08&tz=America/New_York

Testing

  • All existing tests pass (npm test)
  • TypeScript compiles without errors
  • Build succeeds
  • Manual testing:
    • /?date=2023-11-08 → Shows Wednesday (can deploy)
    • /?date=2023-12-25 → Shows Christmas (don't deploy)
    • /?date=2023-12-29 → Shows Friday (don't deploy)

Fixes #1079


🤖 Generated with Claude Code

The web interface now handles the `date` query parameter from the URL,
making it consistent with the API behavior.

Changes:
- Changed from getStaticProps to getServerSideProps to access query params
- Added support for ?date=YYYY-MM-DD parameter
- Preserved date parameter when changing timezone
- Added error handling for invalid dates/timezones

Example usage:
- https://shouldideploy.today/?date=2023-11-08
- https://shouldideploy.today/?date=2023-11-08&tz=America/New_York

Fixes baires#1079

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@vercel
Copy link

vercel bot commented Jan 27, 2026

@krapcys1-maker is attempting to deploy a commit to the Alexis' projects Team on Vercel.

A member of the Team first needs to authorize it.

@krapcys1-maker
Copy link
Author

All tests and coverage pass successfully (49/49).
The failing checks (coverage-report and Vercel preview) are due to fork PR permission restrictions and require maintainer approval to run.
No code issues on my side — happy to address any feedback.

Copy link
Owner

@baires baires left a comment

Choose a reason for hiding this comment

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

We need new tests. Current test pass they dont cover:

date query parameter parsing
invalid date handling
tz + date params combination
state preservation when changing tz + date

also fix the type mismatch in the IPage int

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.

Can't browse the site using a different date

2 participants