Skip to content

fix(Dotcom.ServicePatterns): better date handling#3196

Open
thecristen wants to merge 1 commit into
mainfrom
cbj/fix/service-picker
Open

fix(Dotcom.ServicePatterns): better date handling#3196
thecristen wants to merge 1 commit into
mainfrom
cbj/fix/service-picker

Conversation

@thecristen
Copy link
Copy Markdown
Collaborator

Scope

Slack thread

The schedule picker was showing Sunday (modified service) as concluding on May 31 instead of on June 7.

Implementation

The service in question: https://api-dev-blue.mbtace.com/services/PRIV20262-hpa26sp7-Sunday-01

While the service's end_date was May 31, it also had an added_date of June 7.

{
  "added_dates": ["2026-06-07"],
  "added_dates_notes": [null],
  "description": "Sunday schedule (modified service)",
  "end_date": "2026-05-31",
  "rating_description": "Spring",
  "rating_end_date": "2026-06-13",
  "rating_start_date": "2026-04-05",
  "removed_dates": [],
  "removed_dates_notes": [],
  "schedule_name": "Sunday (modified service)",
  "schedule_type": "Sunday",
  "schedule_typicality": 4,
  "start_date": "2026-05-24",
  "valid_days": [1, 7]
}

Instead of using service start/end dates, this PR more consistently uses all dates (as added_dates may and will fall outside of the supposed start/end range). This impacts

  • the displayed text for planned disruptions
  • how we determine which services are identical (having the same dates)
  • how we identify whether a service is entirely in the past

Screenshots

Before After
image image
image image

How to test

Visit the 716 route (and probably others, but this one was clear) and view departures from any stop with data from api-dev-blue.

Sunday service should not be labelled as ending May 31.

Instead of using service start/end dates, use all dates (as added_dates may and will fall outside of the supposed start/end range). This impacts the displayed text for planned disruptions, impacts how we determine which services are identical (having the same dates), and impact how we identify whether a service is entirely in the past.
@thecristen thecristen requested a review from a team as a code owner May 19, 2026 22:46
@thecristen thecristen requested a review from jlucytan May 19, 2026 22:46
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