Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(study-rooms): specify and serve UCI timezone for slots #85

Merged
merged 2 commits into from
Jan 15, 2025

Conversation

laggycomputer
Copy link
Member

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

We know this is effective because setting a different timezone for the scraper's SQL session uses that timezone instead:

Screenshot_20250115_110404

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

  • 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.

@laggycomputer laggycomputer temporarily deployed to staging-85 January 15, 2025 19:05 — with GitHub Actions Inactive
Copy link
Member

@andrew-wang0 andrew-wang0 left a comment

Choose a reason for hiding this comment

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

LGTM 🫡

@andrew-wang0 andrew-wang0 merged commit 4915f90 into main Jan 15, 2025
1 check passed
@andrew-wang0 andrew-wang0 deleted the study-room-tz-fix branch January 15, 2025 19:11
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.

[Study Room] Study room slot openapi start and end
2 participants