Skip to content

Posts 0.4.0: Scheduled posts go out at the time the editor typed

Posts 0.4.0 fixes scheduled posts on sites whose editors are not on UTC: a post set to go out at 09:00 is now published at 09:00 in the editor’s own timezone, also across a daylight saving change.

Scheduling follows the editor’s timezone

The Scheduled Publish Time field in the post editor is a date and a clock time with no zone. The module read it with the editor’s profile timezone, but only understood a plain number of hours. A named zone such as Europe/Tallinn counted as no shift at all, so a post scheduled for 09:00 went out at 09:00 UTC, three hours late in Estonian summer. A numeric offset worked, but stayed the same all year, so a schedule on the other side of a daylight saving change landed an hour off. The site-wide timezone setting was never used, so an editor with no timezone in their profile got UTC.

Now the time is read in the editor’s profile timezone, else the site’s timezone setting, else UTC, and daylight saving is applied for the date typed. An empty profile value counts as not set. Showing a saved schedule in the field works the same way back. A value that cannot be read gives a form error instead of a wrong time.

The post remembers its timezone

Each post now stores the timezone its schedule was typed in, next to the scheduled time. The server sets it; a value sent in with the form is ignored. Posts saved before this release have none.

Upgrading

Posts 0.4 needs PhoenixKit 2.16 or later, which adds the timezone column to the posts table. This is a hard requirement: with an older core every read of the posts table fails and the Posts admin shows nothing. Update core, run mix phoenix_kit.update so its migrations add the column, then update this module. Posts already scheduled keep the moment they were saved with. The editor now shows that moment in your own timezone, so a schedule saved three hours off is easy to spot and retype.

Full release notes: Posts 0.4.0

0.4.0 · 6 September 2026

Fixed

  • A post scheduled by an editor in a named timezone was published in UTC. The editor read and wrote its datetime-local field with Integer.parse/1 on the editor’s profile timezone. An IANA id (Europe/Tallinn) parses as :error and fell through to “no shift”, so a post scheduled for 09:00 went out at 09:00 UTC — three hours late in Estonian summer. A legacy numeric offset fared better but was still a fixed ±N hours, so a schedule typed across a daylight-saving boundary landed an hour off; and the site-wide time_zone setting was never consulted, so an editor with a blank profile silently got UTC rather than the site’s zone.

    Both directions now go through core’s Utils.Date.parse_datetime_local/2 and format_datetime_local/2 in the new Web.ScheduleInput, which resolve the wall clock through TimeZone.from_wall/2 on the date typed — so DST is applied per instant, a legacy offset still works, and the zone follows core’s rule: the editor’s profile, else the site setting, else UTC. A blank profile value counts as unset. Input that does not parse is left for the changeset to reject instead of becoming a silent UTC instant (#18).

Added

  • A post records the timezone its schedule was typed in. Post.time_zone (an IANA id or a legacy offset, validated with Utils.TimeZone.valid?/1 and bounded at the column’s 64 characters) is set by the server next to a schedule the editor actually typed; any time_zone arriving in the form params is dropped first. Nil on rows written before core V185 (#18).

Changed

  • The phoenix_kit floor is now ~> 2.16, and it is a hard one. Core’s V185 adds phoenix_kit_posts.time_zone, which Post maps. Ecto names every field of a schema in every SELECT, so on an older core this is not a feature that degrades — every read and write of the table comes back 42703 undefined_column, and this module’s context rescues turn that into a plausible nothing: an empty Posts admin and a scheduled sweep that publishes nothing. 2.16 also clears Utils.TimeZone.valid?/1 and from_wall/2 (core 2.13.9), which the changeset and the schedule input call on every save. test/core_pin_conformance_test.exs moves with the pin and records why.
  • Dependency updates: phoenix_kit 2.16.0.

Posts 0.4.0. Install or update: {:phoenix_kit_posts, "~> 0.4"}, then mix deps.get && mix phoenix_kit.update. Full history: CHANGELOG.