fix(calendar): bucket dates/times in the user's profile timezone (PMS-360) #271

Merged
vas2000-work merged 1 commit from fix/PMS-360-calendar-profile-tz into main 2026-06-18 00:17:39 +02:00
Owner

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 adds user_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() -> String API).

Verified in the dev container: fmt, cargo check --target wasm32, clippy -D warnings, and cargo test (146 passed).

#PMS-360

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 adds `user_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() -> String` API). Verified in the dev container: fmt, `cargo check --target wasm32`, clippy `-D warnings`, and `cargo test` (146 passed). #PMS-360
fix(calendar): bucket dates and times in the user's profile timezone (PMS-360)
All checks were successful
Check / clippy + fmt + tests (pull_request) Successful in 3m3s
Create release / Create release from merged PR (pull_request) Has been skipped
fd7eb28b0e
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
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
psa-systems/mokosh-apps!271
No description provided.