Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(study-rooms): specify and serve UCI timezone for slots (#85)
## Description Followup to #75, fixing study room slot times being rendered in Postgres's local timezone. We simply set the timezone on the connection acquired by the scraper to `America/Los_Angeles`. ## Related Issue Resolves #84. We both specify the intended behavior from #75 in the example and actually fulfill it. ## Motivation and Context ## How Has This Been Tested? Tested by setting Postgres's timezone to `America/New_York`, running the scraper, then testing the API request. ## Screenshots (if appropriate): Despite forcing Postgres's global timezone to change, the timezone is correct since we set it on the session which takes precedence over the global setting: ![Screenshot_20250115_110206](https://github.com/user-attachments/assets/97c1badd-5c8a-44af-9b1c-8daddf03421e) We know this is effective because setting a different timezone for the scraper's SQL session uses that timezone instead: ![Screenshot_20250115_110404](https://github.com/user-attachments/assets/371a8cda-3751-461b-b2b0-69092e441b55) So if we force `America/Los_Angeles` on the scraper session, it will give the correct offset regardless of Postgres or system timezone. ## Types of changes - [x] Bug fix (non-breaking change which fixes an issue) - [ ] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to change) ## Checklist: - [ ] My code involves a change to the database schema. - [ ] My code requires a change to the documentation.
- Loading branch information