fix(calendar): bucket dates/times in the user's profile timezone (PMS-360) #271
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/PMS-360-calendar-profile-tz"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Fixes PMS-360. Calendar / Dispatch / Today parsed input, bucketed appointments into day cells, positioned them on the time grid, and computed "today" using the browser's local timezone (
chrono::Local), while records render in the user's profile timezone - so the same moment could appear on different days across screens.This switches all of calendar.rs to the profile timezone via the existing
user_timezone()(Tz) helper, and addsuser_today()/user_local_date()to utils/datetime.rs.Supersedes #232 (which fixed only the "today" marker and was built on a now-diverged
user_timezone() -> StringAPI).Verified in the dev container: fmt,
cargo check --target wasm32, clippy-D warnings, andcargo test(146 passed).#PMS-360
Calendar, Dispatch, and the "Today" marker parsed input, bucketed appointments into day cells, positioned them on the time grid, and computed "today" using the browser's local timezone (chrono `Local`), while records (Time Entries / Timesheet) render in the user's profile timezone. So the same moment could land on different days depending on the screen ("same hour, two days"). Switch all of calendar.rs from `Local` to the user's profile timezone via the existing `user_timezone()` (Tz) helper: input parsing (`from_local_datetime`), day bucketing and hour positioning (`with_timezone`), the clock label, and "today" now all use the profile zone, consistent with how records are rendered (mapps-208). Add `user_today()` and `user_local_date()` helpers to utils/datetime.rs. Supersedes PR #232, which fixed only the "today" marker and was built on a diverged `user_timezone() -> String` API that predates main's Tz-based datetime work. Verified in the dev container: cargo fmt, cargo check --target wasm32-unknown-unknown, cargo clippy --all-targets -D warnings, cargo test (146 passed). #PMS-360