SagentsLiveDebugger.Timezone
(Sagents LiveDebugger v0.6.0)
Copy Markdown
Helpers for validating IANA timezone strings received from the browser.
The debugger passes the browser's detected timezone (from
Intl.DateTimeFormat().resolvedOptions().timeZone) through the LiveSocket
connect_params as "time_zone". This module ensures that only valid zones
known to the host application's configured Calendar time zone database make
it into socket state, so downstream DateTime.shift_zone/2 calls cannot
crash when rendering event timestamps.
Summary
Functions
Validates a timezone string against the configured Calendar time zone database.
Validates a timezone and falls back to "UTC" on any failure.
Functions
Validates a timezone string against the configured Calendar time zone database.
Returns {:ok, timezone} for recognized zones, {:error, :invalid_timezone}
otherwise (including for nil or non-binary input).
Validates a timezone and falls back to "UTC" on any failure.