feat(datetime): render timestamps in the user's profile timezone #205

Merged
vas2000-work merged 1 commit from feat/mapps-208-display-profile-timezone into main 2026-06-16 23:48:57 +02:00
Owner

Timestamps rendered through format_user_datetime previously converted the UTC instant via chrono::Local, so deployments where the browser zone resolved to UTC showed Zulu time and the profile timezone setting never took effect. Resolve the active user's IANA timezone (users.timezone, validated in PMS-325) off the AuthContext via a new user_timezone() helper and convert the instant into that zone instead. The no-format-preference fallback is now pinned to the same zone (Intl timeZone option on wasm, strftime with the zone abbreviation off-target) so the profile setting applies on every screen, not just for users with a custom format string. Timezone resolution falls back to UTC when there is no signed-in user or the stored zone is not a valid IANA name.

Adds the chrono-tz dependency for IANA zone parsing, makes the token renderer generic over TimeZone, and guards user_timezone() with Runtime::try_current() so the pure host-side render paths (unit tests, preset previews) do not require a live Dioxus runtime.

#MAPPS-208

Co-Authored-By: Claude Opus 4.8 (1M context) noreply@anthropic.com

Timestamps rendered through format_user_datetime previously converted the UTC instant via chrono::Local, so deployments where the browser zone resolved to UTC showed Zulu time and the profile timezone setting never took effect. Resolve the active user's IANA timezone (users.timezone, validated in PMS-325) off the AuthContext via a new user_timezone() helper and convert the instant into that zone instead. The no-format-preference fallback is now pinned to the same zone (Intl timeZone option on wasm, strftime with the zone abbreviation off-target) so the profile setting applies on every screen, not just for users with a custom format string. Timezone resolution falls back to UTC when there is no signed-in user or the stored zone is not a valid IANA name. Adds the chrono-tz dependency for IANA zone parsing, makes the token renderer generic over TimeZone, and guards user_timezone() with Runtime::try_current() so the pure host-side render paths (unit tests, preset previews) do not require a live Dioxus runtime. #MAPPS-208 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
feat(datetime): render timestamps in the user's profile timezone
All checks were successful
Check / clippy + fmt + tests (pull_request) Successful in 1m5s
Create release / Create release from merged PR (pull_request) Has been skipped
91c9db2cb1
Timestamps rendered through format_user_datetime previously converted the UTC instant via chrono::Local, so deployments where the browser zone resolved to UTC showed Zulu time and the profile timezone setting never took effect. Resolve the active user's IANA timezone (users.timezone, validated in PMS-325) off the AuthContext via a new user_timezone() helper and convert the instant into that zone instead. The no-format-preference fallback is now pinned to the same zone (Intl timeZone option on wasm, strftime with the zone abbreviation off-target) so the profile setting applies on every screen, not just for users with a custom format string. Timezone resolution falls back to UTC when there is no signed-in user or the stored zone is not a valid IANA name.

Adds the chrono-tz dependency for IANA zone parsing, makes the token renderer generic over TimeZone, and guards user_timezone() with Runtime::try_current() so the pure host-side render paths (unit tests, preset previews) do not require a live Dioxus runtime.

#MAPPS-208

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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!205
No description provided.