fix(today): base "time till next class" on Singapore time - #4442
fix(today): base "time till next class" on Singapore time#4442TheMythologist wants to merge 5 commits into
Conversation
The Today view computed the next-lesson countdown by placing the lesson start time on the viewer's local calendar day while comparing against the true current instant. Since lesson times are in Singapore time, overseas students saw a countdown that was off by their timezone offset. Derive "now" from the SGT wall-clock (via toSingaporeTime) when reasoning about today, and anchor the lesson start time to that same reference so the displayed duration reflects the real time until the next class. No-op for viewers already on Singapore time. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub. 2 Skipped Deployments
|
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #4442 +/- ##
==========================================
+ Coverage 54.52% 58.53% +4.01%
==========================================
Files 274 316 +42
Lines 6076 7296 +1220
Branches 1455 1794 +339
==========================================
+ Hits 3313 4271 +958
- Misses 2763 3025 +262 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Determine "today" and each subsequent day column from the SGT wall-clock so the day grouping, the day marked as today, and the "time till next class" countdown all agree. Previously grouping used the viewer's local date while the countdown used SGT, so a viewer whose local date trailed Singapore's saw the wrong day as today and a wrong countdown. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
We should probably fix greptile's comments in this samePR while we're at it? |
mapStateToProps chose the semester/week timetable from the viewer's local date, while the Today view groups days in Singapore time. An overseas viewer whose local date trailed Singapore's could be served the previous semester's timetable even as the day list showed the new semester's lessons. Derive the week info from the SGT wall-clock so both agree. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
You're right - fixed in 361be69 |
The Today view computed the next-lesson countdown by placing the lesson start time on the viewer's local calendar day while comparing against the true current instant. Since lesson times are in Singapore time, overseas students saw a countdown that was off by their timezone offset.
Derive "now" from the SGT wall-clock (via
toSingaporeTime) when reasoning about today, and anchor the lesson start time to that same reference so the displayed duration reflects the real time until the next class. No-op for viewers already on Singapore time.Part of #3338