Skip to content

[Fix]: Update timetable date picker to support selecting the current date - #3368

Open
lvachon1 wants to merge 2 commits into
mainfrom
lev/fix/timetable_current_date
Open

[Fix]: Update timetable date picker to support selecting the current date#3368
lvachon1 wants to merge 2 commits into
mainfrom
lev/fix/timetable_current_date

Conversation

@lvachon1

Copy link
Copy Markdown
Contributor

Scope

Asana Ticket: Update timetable date picker to support selecting the current date

Implementation

It appears that our problem is that the URL is identical to the one w…e're on, and so the browser treats it as an anchor link (which it is) and scrolls to that anchor (which it's already on). I added a random parameter to the URL to disable this behavior. It works, and is not the first time I've used this trick, but I'm not sure it is the cleanest solution.

Screenshots

Screen.Recording.2026-07-29.at.11.50.12.AM.mov

How to test

http://localhost:4001/schedules/CR-NewBedford/timetable

Confirm that re-selecting the currently selected date closes the calendar and refreshes the page.

…e're on, and so the browser treats it as an anchor link (which it is) and scrolls to that anchor (which it's already on). I added a random parameter to the URL to disable this behavior. It works, and is not the first time I've used this trick, but I'm not sure it is the cleanest solution.
@lvachon1
lvachon1 requested a review from a team as a code owner July 29, 2026 15:51
@lvachon1
lvachon1 requested a review from joshlarson July 29, 2026 15:51
…om character from a to z. This gives a 1:17576 chance of the bug occuring

@thecristen thecristen left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

😵‍💫 Creative and makes me uncomfortable.

I noticed in BuildCalendar.Day.td/1 that it renders the link with the #date-filter anchor, and that removing this seems to make the link behave the way we want (at least when I tried it in Vivaldi just now). I wonder if there's something we could do with that, like removing that anchor if we happen to be looking at the current date, or something like that.

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.

2 participants