Skip to content

Releases: cakephp/chronos

Chronos 2.4.4

14 Nov 16:30
03208c1
Compare
Choose a tag to compare

What's Changed

Full Changelog: 2.4.3...2.4.4

Chronos 3.0.4

18 Oct 02:31
9cb035a
Compare
Choose a tag to compare

What's Changed

Full Changelog: 3.0.3...3.0.4

Chronos 2.4.3

18 Oct 02:31
96f28dd
Compare
Choose a tag to compare

What's Changed

Full Changelog: 2.4.2...2.4.3

Chronos 2.4.2

12 Oct 14:19
79b58b7
Compare
Choose a tag to compare

What's Changed

Full Changelog: 2.4.1...2.4.2

Chronos 3.0.3

02 Oct 22:10
54164f6
Compare
Choose a tag to compare

What's Changed

Full Changelog: 3.0.2...3.0.3

Chronos 3.0.2

29 Sep 23:19
Compare
Choose a tag to compare

Summary

The Chronos class once again extends DateTimeImmutable and therefore implements DateTimeInterface. ChronosDate and ChronosTime do not. Several parameters were expanded to allow DateTimeInterface instead of requiring only Chronos objects.

After making the original changes in 3.0.0, we realized that the supported PHP versions (8.1+) do not have the original bugs that made extending DateTimeImmutable either problematic or impossible in the future.

ChronosDate is intended to be a separate object and will not extend DateTimeImmutable as it supports mutating time and time zones which is hard to support.

ChronosTime was never meant to extend DateTimeImmutable and is part of the reason why ChronosInterface was removed as it doesn't represent a true shared interface.

An explanation of the reason behind the 3.0 changes can be found here: #410 (comment)

What's Changed

  • Change only Chronos to extend DateTimeImmutable once again by @othercorey in #417
  • Support creating Chronos from ChronosTime by @othercorey in #425
  • Allow passing DatePeriod options to diffFiltered() by @othercorey in #429
  • Allow setting time zone when converting to DateTimeImmutable by @othercorey in #430
  • Add halfOfYear, isFirstHalfOfYear, IsSecondHalfOfYear; improve getter… by @brenoroosevelt in #421
  • Add third Parameter $others to farthest and closest Methods by @brenoroosevelt in #422
  • Align Chronos::getTimezone() return type with DateTimeImmutable by @othercorey in #423
  • Add toDateTimeImmutable() by @othercorey in #424 and #427
  • Fix casting to string for ChronosDate and ChronosTime. by @ADmad in #428
  • Remove ChronosInterface references and clean up ChronosDate and ChronosTime refs by @othercorey in #431

New Contributors

Full Changelog: 3.0.1...3.0.2

Chronos 2.4.1

12 Sep 03:13
dd58390
Compare
Choose a tag to compare

What's Changed

Full Changelog: 2.4.0...2.4.1

Chronos 3.0.1

09 Sep 03:48
a89857a
Compare
Choose a tag to compare

What's Changed

Full Changelog: 3.0.0...3.0.1

Chronos 2.4.0

06 Aug 22:55
Compare
Choose a tag to compare

Major Changes

What's Changed

Full Changelog: 2.3.3...2.4.0

Chronos 3.0.0

06 Aug 22:53
414dbfb
Compare
Choose a tag to compare

Chronos 3 introduces some large changes driven by changes in PHP 8 (and expected change in PHP 9).

The biggest change is Chronos and ChronosDate no longer extend DateTimeImmutable which means they no longer implement DateTimeInterface. This will affect projects that use either of these as type declarations and pass in Chronos objects.

All of the relevant methods from DateTimeImmutable are still available on Chronos and ChronosDate. Some methods that were only relevant for Chronos were dropped from ChronosDate and so on.

If you need to pass a DateTimeImmutable or DateTimeInterface objects to a library, you can use the toNative() helper to get the equivalent DateTimeImmutable object.

Major Changes

  • Chronos and ChronosDate no longer extend DateTimeImmutable and no longer implement DateTimeInterface
  • ChronosInterface was dropped as Chronos and ChronosDate no longer extend the same base and don't try to share incompatible methods.
  • MutableDateTime and MutableData were dropped
  • ChronosTime was added which supports parsing strings and conversion from Chronos and DateTimeInterface