Releases: cakephp/chronos
Chronos 2.4.4
What's Changed
- Fix off by one errors in diffFiltered by @markstory in #446
Full Changelog: 2.4.3...2.4.4
Chronos 3.0.4
What's Changed
- Add ChronosTime::endOfDay() by @othercorey in #439
- Add microseconds to Chronos::endOfDay() by @othercorey in #441
Full Changelog: 3.0.3...3.0.4
Chronos 2.4.3
What's Changed
- Add microseconds to Chronos::endOfDay() by @othercorey in #440
- Use ChronosDate in docs by @othercorey in #438
Full Changelog: 2.4.2...2.4.3
Chronos 2.4.2
What's Changed
- Fix "undefined array key" error. by @ADmad in #415
- Use phive to install phpstan by @markstory in #436
- Restore Date::create() compatibility with no params by @markstory in #435
Full Changelog: 2.4.1...2.4.2
Chronos 3.0.3
Chronos 3.0.2
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
- @brenoroosevelt made their first contribution in #421
Full Changelog: 3.0.1...3.0.2
Chronos 2.4.1
What's Changed
- Add missing default for ChronosInterface::now() by @othercorey in #412
Full Changelog: 2.4.0...2.4.1
Chronos 3.0.1
What's Changed
- Re-introduce Chronos::getLastErrors() by @othercorey in #409
Full Changelog: 3.0.0...3.0.1
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