feat(datetime): render timestamps in the user's profile timezone #205
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/mapps-208-display-profile-timezone"
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?
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