Skip to content

Releases: MidnightDesign/calendrics

v0.3.1

Choose a tag to compare

@github-actions github-actions released this 18 Aug 09:12
c8f68f9

0.3.1 (2026-08-18)

Miscellaneous Chores

v0.3.0

Choose a tag to compare

@github-actions github-actions released this 18 Aug 08:59
6aca845

0.3.0 (2026-08-18)

⚠ BREAKING CHANGES

  • Temporal\ is now Calendrics\, including Temporal\Spec\Calendrics\Spec\ and Temporal\Exception\Calendrics\Exception\. The marker interface Temporal\Exception\TemporalException is now Calendrics\Exception\CalendricsException. Require midnight/calendrics in place of midnight/temporal-php.

Features

  • rename the package and root namespace to calendrics (#91) (0ad2c31)

v0.2.1

Choose a tag to compare

@github-actions github-actions released this 17 Aug 13:13
2fd6d0f

0.2.1 (2026-08-17)

Bug Fixes

  • accept basic-format inline offsets in date-time-string time zone ids (#89) (056f2ba)
  • range-check Duration::round()'s relativeTo anchor for every spelling (#82) (9099d86), closes #56
  • resolve era/eraYear relativeTo anchors instead of rejecting them (#84) (80d60f8), closes #58

Miscellaneous Chores

  • adopt release-please for versioning and changelog (#85) (07249e2)

v0.1.0

Choose a tag to compare

@MidnightDesign MidnightDesign released this 19 Apr 13:44
f4709f6

Initial public release.

Added

  • Porcelain API (Temporal\ namespace) — PHP-native facade over the TC39 Temporal spec with strict types, readonly fields, backed enums, and named arguments:
    • PlainDate, PlainTime, PlainDateTime, PlainYearMonth, PlainMonthDay
    • Instant, ZonedDateTime
    • Duration
    • Now (factory for current-time values)
    • Enums: Calendar, Disambiguation, OffsetOption, Overflow, RoundingMode, Unit, plus display-side enums (CalendarDisplay, OffsetDisplay, TimeZoneDisplay, TransitionDirection).
  • Spec layer (Temporal\Spec\ namespace) — TC39-faithful implementation, exercised by the test262 conformance suite.
  • ECMA-402 calendar support — 16 non-ISO calendars (Hebrew, Islamic family, Japanese, Buddhist, Chinese/Dangi, Coptic, Ethiopic family, Persian, ROC, Indian) via `IntlCalendarBridge`, with pure-PHP implementations for Hebrew and Indian.
  • Factory surface per porcelain class — each class exposes a typed constructor (named arguments supported), a `parse(string)` for ISO 8601 strings, and for the five calendar-aware classes (`PlainDate`, `PlainDateTime`, `PlainYearMonth`, `PlainMonthDay`, `ZonedDateTime`) a `fromFields(...)` named-argument factory covering calendar-specific fields (`monthCode`, `era`, `eraYear`).
  • Interop — `toSpec()` / `fromSpec()` on every porcelain class for bridging to the spec layer.
  • Test262 conformance — 6615 passing test262 scripts, 0 failures (~494k assertions).

Deliberate deviations from TC39

The porcelain layer adapts TC39 semantics to PHP-native conventions rather than mirroring the JavaScript API shape 1:1.

  • No polymorphic `from()` method. Use `parse()` for strings and `fromFields()` for calendar fields. The spec layer retains TC39-faithful `from()` for callers who need exact spec semantics.
  • Named arguments, not property bags.
  • Backed enums, not option strings.

Known limitations

  • `Duration::round()` and `Duration::total()` throw `NotYetImplementedException` when balancing across calendar units that require a reference point.
  • The `Temporal\Spec\` namespace is public PSR-4 but documented as internal; a formal BC policy for the seam will land before 1.0.0.

Install: `composer require midnight/temporal-php`

Full changelog: CHANGELOG.md