fix(qiddiyacity): parse "Weekdays/Weekends" wording in website schedule#262
Merged
Merged
Conversation
The site's megaMenu now labels its two schedule strings "Weekdays: 4 PM - 12 AM"
/ "Weekends: 4 PM - 12 AM" rather than day ranges. The parser only understood
day names ("Wed to Fri", "Saturdays"), so it produced an empty weekly map and
the calendar fell back to today-only.
Handle the literal Weekdays/Weekends wording (Saudi week: weekend Fri/Sat,
weekdays Sun-Thu), keep existing day-range parsing, and lift the logic into an
exported pure buildWeeklyScheduleFromMegaMenu() with tests for both formats.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Six Flags Qiddiya City's calendar stopped populating. The website
megaMenunowlabels its two schedule strings "Weekdays: 4 PM - 12 AM" / "Weekends: 4 PM - 12 AM"
instead of day ranges.
getWebsiteSchedule()'s parser only understood day names("Wed to Fri", "Saturdays"), so the current wording parsed to an empty weekly map
and the calendar fell back to today-only (which is blank whenever the park is
pre-open, i.e.
isOpen:false).Fix
Weekdays/Weekendswording using the Saudi work week(weekend = Fri/Sat, weekdays = Sun–Thu).
buildWeeklyScheduleFromMegaMenu(lws)so it's unit-testable without network/cache.Tests
Added
buildWeeklyScheduleFromMegaMenutests covering the current Weekdays/Weekendsformat, legacy day-range format, closed-day removal, and empty input. Full suite:
1495 tests pass. Verified end-to-end against live data: schedule now yields 5
open days/week (Sun/Wed/Thu/Fri/Sat, 16:00→00:00), Mon/Tue dropped as closed, with
correct midnight rollover and Asia/Riyadh offset.
🤖 Generated with Claude Code