All notable changes to this project are documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
[0.2.0]
Added
Periods.compare/2— compares two Periods of any units and returns:lt | :eq | :gt. Works directly withEnum.sort/2(e.g.Enum.sort(periods, Periods)).Periods.multiply/2— scales a Period's amount by an integer.Periods.negate/1— flips the sign of a Period's amount.Periods.abs/1— returns a Period with the absolute value of its amount.Periods.new!/2— raising variant ofnew/2(mirrors the existingnew/2).Inspectimplementation forPeriods.Period— renders as#Periods.Period<10 day>.String.Charsimplementation forPeriods.Period— enables string interpolation.Periods.Ecto.IntervalType— stores a Period as a native PostgreSQLinterval, enabling database-side date math. (Periods.Ecto.MapTypeis still available for JSON storage that preserves the exact unit.)
Changed
- Dropped the
decimaldependency. All conversions operate on integer amounts, so the internalDecimal.div_int/2calls were equivalent toKernel.div/2. tzis now a:dev/:test-only dependency. Timezone-awarediff/3uses whatever:time_zone_databasethe host application configures, so consuming apps no longer pull the full IANA dataset transitively.ectorequirement simplified to~> 3.0.
Fixed
- README referenced the config key
:default_value; the correct key is:default_unit. - Corrected the
new!documentation examples (the old example called a non-existent arity and named the wrong error type).