RailForLess / railforless

Amtrak fare-scraping service
https://railforless.us/
53 stars 2 forks source link

Same-day trips and Date Range selector #2

Closed andrewbunk closed 5 months ago

andrewbunk commented 8 months ago

Hello,

I've attempted to find same-day trips on the Northeast Corridor (a very normal task), but it does not return results.

Relatedly, results did eventually show after I changed the end date to the next day. But these results were not for what was in the date range selector.

Additionally, when I selected One-way trip, the date range selector should likely change to a normal date picker.

Love your work, this is good stuff!

pmadison commented 8 months ago

Tagging on here - I do day trips from WAS to NYP ( Acela 2150 + 2173 ). Would be very grateful for this feature in the tool.

kdipippo commented 8 months ago

+1 as another Northeast Corridor rider, where the results only allow for queries in the next month but not further. Tried booting the project locally and learned that the server logic that provides the data for the pricing is not exposed in the repo, as the URL for the backend query returns https://undefined.railsave.rs/wake when console.log()ed. https://github.com/tikkisean/rail-for-less/blob/9d4a2054622175b264cb2607c9a5d722b3e6fe49/src/Form.js#L143

obehrens commented 8 months ago

Hello,

I've attempted to find same-day trips on the Northeast Corridor (a very normal task), but it does not return results.

Relatedly, results did eventually show after I changed the end date to the next day. But these results were not for what was in the date range selector.

Additionally, when I selected One-way trip, the date range selector should likely change to a normal date picker.

Love your work, this is good stuff!

I agree with the last part - I think the date picker in general needs a bit of work. It's confusing to have two separate pickers showing the exact same thing, but with different functions - perhaps you could either consolidate the date picker into one calendar, showing the date range, or you could keep it as two, but only show one selector on each? So, on the first calendar, you would pick your start date, and on the second, you'd pick your end date, but the date range wouldn't appear on either. Currently, it's a bit confusing before you figure out how it works, and I think it could use a makeover.

tikkisean commented 7 months ago

Hey all, I finally got around to addressing these issues in the latest update. Regarding the same-day trip issue I discovered the dates stored from the UI were in UTC but Amtrak's dates in the results were in local time, causing a slight discrepancy in their parsing. I now convert the dates stored in the UI to match the local time Amtrak dates, and use different dayjs functions which compare dates down to the day rather than a particular time to ensure any dates in the selected range will appear. This appears to be working as I'm noticing on some NEC trips I saw nearly double the options as I did before. I have also redesigned the date picker incorporating @obehrens' suggestions. Hopefully these fixes solved your problems, I will keep this issue open for the time being in case anyone points out something I missed.