Skip to content

Tempo version 0.3.0

Choose a tag to compare

@kipcole9 kipcole9 released this 24 Apr 01:22
· 34 commits to main since this release

Tempo v0.3.0 - April 24th, 2026

Added

  • Tempo.Interval.metadata/1. Named accessor for the :metadata map on an interval. Mirrors from/1, to/1, endpoints/1, and resolution/1 added in v0.2.0, so user-facing code never has to reach into struct fields to read iCal SUMMARY, LOCATION, event UIDs, or any other per-interval data attached by the caller.

Changed

  • Renamed Tempo.compare/2 and Tempo.Interval.compare/2 to Tempo.relation/2 and Tempo.Interval.relation/2. The function returns one of 13 Allen interval-algebra relations (:precedes, :meets, :overlaps, …), not the :lt | :eq | :gt shape stdlib's compare/2 promises. The new name avoids the trap.

  • Renamed Tempo.Sigil to Tempo.Sigils (plural), and moved calendar_from/1 out to Tempo.Sigils.Options. import Tempo.Sigils now brings only sigil_o/2 and sigil_TEMPO/2 into scope — no helper functions leak. The old Tempo.Sigil module remains as a deprecated compatibility shim and will be removed in a future major version.

  • Tempo.Visualizer and Tempo.Visualizer.Standalone now compile only when both :plug and :bandit are available. Previously Plug alone was enough to trigger compilation of Tempo.Visualizer, and Standalone referenced Bandit unguarded — so a downstream application that depended on Tempo without pulling in either library saw "undefined module" warnings during compilation. Both modules still expose stub init/call/start/child_spec/stop functions that raise a single actionable error when called without the deps in place.

Bug Fixes

  • ISO week-date resolution now uses Calendrical.ISOWeek semantics throughout the validation path, regardless of the caller's declared calendar. There is room to be more selective than this (there can be multiple ways to construct a week-based calendar). However there isn't yet a clear way to influence that decision other than through a -u-ca qualifier and that only allows ISO Week calendars.

  • Tempo.to_date/1 now handles ordinal dates ([year, day] — produced by the O designator, the extended YYYY-DDD form, or by enumerating a year-only Tempo as days) and ISO week dates ([year, week, day_of_week]). Previously both shapes returned a Tempo.ConversionError even though the components unambiguously identify a single calendar day. Examples: Tempo.to_date(~o"2020-166") now returns {:ok, ~D[2020-06-14]}; Tempo.to_date(~o"2020-W24-3") returns {:ok, ~D[2020-06-10]}; and ~o"2020Y{1..-1}D" |> Enum.to_list() |> hd() |> Tempo.to_date() returns {:ok, ~D[2020-01-01]}.