Releases: briannesbitt/Carbon
2.71.0
Complete commits list: 2.70.0...2.71.0
Summary:
- Added #2857
var_export()
support forCarbonInterval
— @hettiger - Fixed #2852 UnknownGetterException error on serialization — @gjespo85
- Fixed #2854 Allow to set options at least one per construction — @kylekatarnls
New Contributors
2.70.0
Complete commits list: 2.69.0...2.70.0
Summary:
- Added #2838 #2839 Allow float in interval units — @kylekatarnls
- Added #2840
T
modifier for translation — @nicko170 - Fixed #2842 Upgrade codecov V1 => V3 and switch to pcov — @Chris53897
- Fixed #2837 Use env var to pass composer cache config in GitHub Actions — @Chris53897
New Contributors
- @Chris53897 made their first contribution in #2837
- @nicko170 made their first contribution in #2840
2.69.0
Complete commits list: 2.68.1...2.69.0
Summary:
- Added #2813 Implement
Psr\Clock\ClockInterface
— @kylekatarnls - Fixed #2823 Make createFromFormat work the same with mocked time — @kylekatarnls
- Fixed #2822 Exclude locale from
getSetting()
if set by default — @kylekatarnls - Fixed #2819 Carbon constructor mutates passed DateTime argument — @kylekatarnls
- Fixed #2829 Fix dual for month in Slovenian language — @alesf
- Fixed #2825 Change before Malay translation to "sebelum" — @kylekatarnls
- Fixed #2155 #2160 Dedupe the diff methods set — @kylekatarnls
Breaking chances (for edge-case usages):
getSetting()
now longer return the locale when it's unchanged default, so you can distinguish between explicit 'en'
which has Sunday as start of week vs. null
which is English but with Monday as start of week. To get the previous behavior you can use:
$settings = array_merge(['locale' => 'en'], $date->getSettings());
2.68.1
Complete commits list: 2.68.0...2.68.1
Summary:
- Fixed bug mutating the parameter of
diffInWeekdays()
anddiffInWeekendDays()
2.68.0
Complete commits list: 2.67.0...2.68.0
Summary:
- Added #2802 Support named arguments for mixins — @kylekatarnls
- Fixed #2806 Fix
CarbonPeriod
method signatures — @axlon - Fixed #2801 Use
CarbonImmutable
when creatingCarbonPeriodImmutable
— @kylekatarnls - Fixed #2799 Fix
diffInWeekdays
anddiffInWeekendDays
with partial days — @kylekatarnls - Fixed #2781 Change
@method shiftTimezone()
return tostatic
— @kylekatarnls - Fixed #2804 Restore type of mixin results using $this — @kylekatarnls
Breaking chances (for edge-case usages):
$this->modify()
or $this->setTimezone()
from within a mixin method, previously you got a copy of the object, now you will get the same object, modified. If you want to maintain the previous behavior, you'll have to explicitly call $date = $this->copy();
at the beginning at mixin methods and then modify and return this copied instance. Alternatively you can use CarbonImmutable
all way long so any modification (via macro, mixin or regular methods) will all create a new instance.
CarbonPeriodImmutable
emit CarbonImmutable
objects on iteration, if you rely on receiving Carbon
and doing mutation on it, you should call now explicitly first ->toMutable()
.
diffInWeekdays
and diffInWeekendDays
returned before rounded-up values which was inconsistent with other diff methods all returning rounded-down value. If you were using those methods with start and end dates not having the same hour/minute/second and were willingly expecting rounded-up values, you should now add + ($start->isSameAs('H:i:s.u', $end) ? 0 : 1)
to get the same result as before.
2.67.0
Complete commits list: 2.66.0...2.67.0
Summary:
- Fixed #2770 PHP 8.3 compatibility — @kylekatarnls
- Fixed #2767 Allow
false
increateFromFormat()
timezone parameter — @kylekatarnls - Fixed #2781 Change
@method shiftTimezone()
return tostatic
— @ondrejmirtes - Updated #2789 en_CH formats — @Seeow
- Improved #2769
withTestNow()
signature — @takaram
New Contributors
2.66.0
Complete commits list: 2.65.0...2.66.0
Summary:
- Added #2761 CarbonPeriodImmutable class — @kylekatarnls
- Added #2760 Eastern Arabic numerals to all locales of the Mashriq countries — @abdullah-alhariri
- Fixed #2762 Handle rounding with cascade factors — @kylekatarnls
- Fixed #2752 is() output when giving a month name only — @kylekatarnls
- Fixed #2753 unit tests — @rgson
- Improved #2754 Enable PHPMD on tests code — @kylekatarnls
New Contributors
- @abdullah-alhariri made their first contribution in #2760
2.65.0
Complete commits list: 2.64.1...2.65.0
Summary:
- Added #2712 getDaysFromStartOfWeek and setDaysFromStartOfWeek methods —@kylekatarnls
- Added #2731 Provide basic completion assistance in PhpStorm —@wbars
- Added #2750 Add
isLongIsoYear()
method —@kylekatarnls - Fixed #2742 Updated Polish translation — @maciek-szn
- Fixed #2740 Fix Serbian pluralization — @kylekatarnls
- Fixed #2729 Add allowed type to create method — @driesvints
- Fixed #2727 Fix docs of milliseconds field (
CarbonInterval
) — @scrummer - Fixed #2718 Fix doc-block — @aivchen
- Fixed #2721 Update PHPDoc for magic methods — @kylekatarnls
- Fixed #2719 Translate escaped word in
createFromLocaleFormat()
— @kylekatarnls - Fixed #2745 Enforce
$skip
array type — @kylekatarnls - Improved #2735 Update Serbian tests — @perisicnikola37
- Improved #2726 Add cast test for
addRealHours()
—@kylekatarnls - Improved #2729 Add allowed type to create method — @driesvints
- Improved #2734 Add PHP 8.3 to GitHub Actions —@kylekatarnls
New Contributors
- @aivchen made their first contribution in #2718
- @scrummer made their first contribution in #2727
- @wbars made their first contribution in #2731
- @perisicnikola37 made their first contribution in #2735
- @maciek-szn made their first contribution in #2742
2.64.1
Complete commits list: 2.64.0...2.64.1
Summary:
What's Changed
- Fixed #2744 passing
$skip
parameter as string indiffForHumans()
2.64.0
Complete commits list: 2.63.0...2.64.0
Summary:
- Added #2712 getDaysFromStartOfWeek and setDaysFromStartOfWeek methods —@kylekatarnls
- Added #2709 Allow named parameters in magic calls —@kylekatarnls
- Improved #2697 diffInMonths calculation — @kylekatarnls
- Fixed #2704 Use static reflection to determine whether class is
CarbonInstance
— @axlon - Fixed #2705 DBAL dependency vulnerability CVE-2021-43608 — @allanlaal
- Fixed #2707 Keep days interval from diff — @kylekatarnls
- Fixed #2711 Fix docblock — @michaelnabil230
⚠️ Breaking change
- To support named parameters in magic calls which is now a standard feature of PHP 8, we had to change the output of passing explicitly
null
in add/sub methods (addMonths, subDays, addSeconds, etc.) For instanceaddMonths(null)
now adds 0 months while it previously added 1 month.addMonths()
still add 1 month. Note that both usages are strongly discouraged, it's highly recommended to always pass a numeric value to those methods explicitly to have unambiguous expectations.
New Contributors
- @axlon made their first contribution in #2704
- @allanlaal made their first contribution in #2705
- @michaelnabil230 made their first contribution in #2711