Skip to content

Live dining hall hours from UMD's published schedule - #42

Open
aleczzhang wants to merge 5 commits into
mainfrom
feature/live-hours
Open

aleczzhang wants to merge 5 commits into
mainfrom
feature/live-hours

Conversation

@aleczzhang

@aleczzhang aleczzhang commented Oct 11, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Dining hall hours were hardcoded to one week ("4/27–5/3"), so the app showed halls as open on breaks (e.g. Yahentamitsi during fall break, Oct 10–12). This serves UMD Dining's published day-by-day hours and uses them in the app.

Backend

  • hours.py fetches the public Google Sheet that dining.umd.edu/hours/open-now reads, parses each hall × meal × date, and caches it (refreshes at most hourly; keeps the last good copy if Google fails, retries after 5 min).
  • GET /api/hours?start=YYYY-MM-DD&days=N (defaults: today on campus, 14 days; max 60). [] for a date = closed all day; a missing date = unknown. 503 only if the sheet has never loaded.
  • Unclear cells ("TBD", blanks, times without am/pm) are treated as unknown, not guessed.

App

  • HallHoursService fetches 21 days, caches to UserDefaults for offline, refreshes when the hall picker appears (at most hourly).
  • Hall cards use live hours when the day is covered, otherwise fall back to the existing hardcoded schedule.
  • Closed cards now say "Opens Tue at 4 PM" / "Opens tomorrow at 7 AM" by looking ahead up to 7 days.

Notes

  • Merging deploys the API (deploy-api.yml); the app falls back to the hardcoded hours until /api/hours is live.
  • Times use the device's calendar, same as before, so a device outside Eastern time is off.
  • Known follow-up: a midnight close would be labelled "12 PM" by the existing time formatter (no hall closes at midnight in the current sheet).
  • Merge this before fix/empty-state-swipe-dining-hall-jump; their HomeView.swift changes don't conflict.

Testing

  • Backend: 30 new tests in tests/test_hours.py; full suite 179 passed; ruff clean.
  • App: 13 new tests (HallHoursTests); full app suite passed.
  • Checked against the live sheet: Yahentamitsi closed Oct 10–12, dinner-only Oct 13.

Copilot AI balanced review requested due to automatic review settings October 11, 2026 14:41

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

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