Releases: cakephp/chronos
Chronos 2.4.0
Major Changes
Date
was renamed toChronosDate
and will be dropped in 3.0MutableDate
andMutableDateTime
were deprecated and will be removed in 3.0- Deprecated several methods no longer supported in 3.0 - see https://book.cakephp.org/chronos/2/en/2-4-upgrade-guide.html
What's Changed
- Start deprecations for 2.next by @markstory in #344
- 2.next - Rename Date to ChronosDate. Deprecate MutableDate and MutableDateTime. by @othercorey in #348
- Change all use of Date to ChronosDate by @othercorey in #350
- 2.next Backport createInterval() by @markstory in #349
- 2.5 - Backport date by @markstory in #363
- 2.5 - More deprecations by @markstory in #367
- 2.5 Remaining deprecations by @markstory in #371
- Make setTimezone deprecation conditional by @markstory in #372
- First draft of 2.4 upgrade guide by @markstory in #375
- 2.4 - Add deprecations for createFromTimestampUTC() by @markstory in #379
- 2.next: fix setISODate by @LordSimal in #392
- 2.next: remove deprecation for setISODate by @LordSimal in #394
- 2.x: adjust CI to not ignore-platform-reqs by @LordSimal in #399
Full Changelog: 2.3.3...2.4.0
Chronos 3.0.0
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
andChronosDate
no longer extendDateTimeImmutable
and no longer implementDateTimeInterface
ChronosInterface
was dropped asChronos
andChronosDate
no longer extend the same base and don't try to share incompatible methods.MutableDateTime
andMutableData
were droppedChronosTime
was added which supports parsing strings and conversion fromChronos
andDateTimeInterface
Chronos 3.0.0-beta3
What's Changed
- Default ChronosTime to server time by @othercorey in #386
- Add ComparisonTrait::isSameMonth()/ComparisonTrait::isSameYear() by @andrii-pukhalevych in #384
- Add timezone to ChronosTime::now() by @othercorey in #389
- Add comparison helpers to ChronosTime by @othercorey in #390
- 3.x: re-add setISODate by @LordSimal in #395
New Contributors
- @andrii-pukhalevych made their first contribution in #384
Full Changelog: 3.0.0-beta2...3.0.0-beta3
Chronos 2.3.3
What's Changed
- Update docs for Date + timezone by @markstory in #388
- Return the false returned by parent::getLastErrors() as default errors array by @zonuexe in #391
New Contributors
Full Changelog: 2.3.2...2.3.3
Chronos 3.0.0-beta2
What's Changed
- Remove carbon migration notes by @othercorey in #369
- Fix up PHPStan by @dereuromark in #374
- Fix up getTimezone() by @dereuromark in #373
- 3.x: new stan setup by @LordSimal in #376
- PHPStan fixes, set level to 8 now by @dereuromark in #378
- Remove not needed legacy API method. by @dereuromark in #342
- Add toNative() helpers by @othercorey in #381
- Add ChronosTime by @othercorey in #380
New Contributors
- @LordSimal made their first contribution in #376
Full Changelog: 3.0.0-beta1...3.0.0-beta2
Chronos 2.4.0-RC2
Chronos 2.4.0 will be backwards compatible with the rest of Chronos 2.x. However, 2.4.0 will introduce deprecations to the mutable classes and many methods in preparation for the changes coming in Chronos 3. The upgrade guide has more information on the upcoming changes and how to update your application.
Chronos 3.0.0-beta1
Chronos 3.0 will be a major release that contains breaking changes. This beta release provides a preview release of what will be coming in the future and unblocks CakePHP 5.0 beta releases.
Summary of Breaking changes
- Removed Mutable datetime and date classes.
ChronosDate
no longer implementsDateTimeInterface
and doesn't share types withChronos
either. This resolves a long standing interface compatibility issue whereDate
andDateTime
objects appeared to be more type compatible than they should be.Chronos
no longer implementsDateTimeInterface
or extendsDateTimeImmutable
. InsteadChronos
is a wrapper around PHP's datetime, and continues to offer a similar interface to the PHP objects.- Removed Carbon compatibility shims. While chronos started out as a fork of Carbon due to lack of maintainship, the Carbon project has new maintainers and we no longer need to encroach on that namespace.
Upgrading
In the future 2.4 will be released with deprecations to help with upgrading to chronos 3.x
Chronos 2.4.0-RC1
Chronos 2.4.0 will be backwards compatible with the rest of Chronos 2.x. However, 2.4.0 will introduce deprecations to the mutable classes and many methods in preparation for the changes coming in Chronos 3. The upgrade guide has more information on the upcoming changes and how to update your application.
Chronos 2.3.2
What's Changed
- Fix: Unexpected Human Interval Values by @MGatner in #323
- Switch human diff to months when interval is 2+ months by @othercorey in #343
Full Changelog: 2.3.1...2.3.2
Chronos 2.3.1
What's Changed
- Fix passing negative value to sub helpers such as subYears(-1) for PHP 8.2