CRM 0.11.0: Interaction times in the viewer's own time zone again
CRM 0.11.0 fixes interaction times for anyone who had picked a time zone in their account: the timeline showed UTC, the composer’s When field was filled in UTC, and a time typed by hand was saved hours off. Each new interaction now also records the zone it was typed in.
Times follow the viewer’s zone
PhoenixKit core now stores a person’s time zone as a name such as Europe/Tallinn. The CRM still read it as a whole number of hours, and a name read as zero. So for every account that had used the time zone picker, the CRM worked in UTC. It now uses the stored zone itself, a named zone or an older fixed offset, for the timeline, the Events tab, the overview and the composer. A named zone follows daylight saving on the date you type, not on today’s offset.
Fewer false warnings in the composer
The composer warns when your device seems to be in a different zone from your account. It compared whole hours, so people on UTC+5:30 or UTC+9:30 saw the warning all the time. It compares minutes now, and it works out the offset for the date in the field, so a repeated or skipped hour around a clock change is read the same way the server reads it.
If the browser sends a When value that cannot be read, saving now fails with “The time could not be read.” instead of quietly using the current time.
The zone is saved with each interaction
Interactions get a time_zone column. The composer fills it on every save, so it is clear later which zone a time was entered in. Interactions saved before this release have no zone, and the ones saved hours off cannot be repaired automatically, because nothing recorded which zone they were typed in.
The overview also stops reading the site’s time zone twice on every load.
Upgrading
Run mix phoenix_kit.update: migration V6 adds the time_zone column to interactions. If people logged interactions with a hand-typed time while the bug was live, check those times; they may be off by their zone’s offset.
Full release notes: CRM 0.11.0
0.11.0 · 6 September 2026
Fixed
- Interaction times are the viewer’s time again (#33). The viewer’s
timezone was turned into an integer number of hours with
Integer.parse/1. Since core moved the setting to IANA identifiers,Integer.parse("Europe/Tallinn")is:error→0, so on every account that had touched the timezone picker the timeline rendered UTC, the composer’s “When” prefill was UTC, and a hand-typed local time was stored hours off.InteractionHelpers.tz_offset/1is replaced byviewer_tz/1, which returns the stored value itself — an IANA id or a legacy fixed offset, never a number — and every conversion now goes through core’s per-instant helpers (shift_to_offset/2,parse_datetime_local/2,format_datetime_local/2), so a named zone follows daylight saving on the date typed rather than on today’s offset. The assign istzthroughout:CRMLive, both show LiveViews,InteractionsComponent,EventsComponent. - Half-hour zones no longer warn on a correct machine (#33). The composer’s “this device is somewhere else” check compared whole hours, so every account on UTC+5:30 (Mumbai, Delhi, Kolkata, Colombo) or UTC+9:30 (Adelaide, Darwin) saw the warning permanently. It compares minutes now.
- An unreadable “When” is a save error, not a silent “now” (#33). A browser
without a real
datetime-localwidget posts free text; the schema’s default would have stamped the save with the current time behind the user’s back. - The
CrmWhenWarningshook resolves the field’s own date (#33). It re-derives the instant from the browser’s timezone database at the date in the field, resolving a repeated or skipped wall clock the way the server does — the first occurrence for a fall-back hour, the jump instant for a spring-forward gap — instead of adding one fixed offset to everything. - The CRM Overview no longer reads the site timezone twice per page load
(#33 review).
CRMLiveresolved the viewer’s zone inmount/3, which runs twice, and the site fallback is an uncached settings query; it now resolves in the connected branch ofhandle_params/3, like both show LiveViews.
Added
- Schema V6 —
phoenix_kit_crm_interactions.time_zone(#33). The zone an interaction’s wall clock was typed in (an IANA id or a legacy offset,varchar(64), nullable), stamped by the composer on save — including the blank-When path that lets the schema defaultoccurred_atto now. When the timezone value moved to IANA ids and the composer turned out to read it as0, the affected rows could not be repaired, because nothing recorded which zone each one was entered in. Rows written before this column arenil.
CRM 0.11.0. Install or update: {:phoenix_kit_crm, "~> 0.11"}, then mix deps.get && mix phoenix_kit.update. Full history: CHANGELOG.