Skip to content

Releases: briannesbitt/Carbon

2.71.0

25 Sep 13:15
9827623
Compare
Choose a tag to compare

Complete commits list: 2.70.0...2.71.0

Summary:

New Contributors

2.70.0

07 Sep 16:49
d3298b3
Compare
Choose a tag to compare

Complete commits list: 2.69.0...2.70.0

Summary:

New Contributors

2.69.0

03 Aug 09:10
4308217
Compare
Choose a tag to compare

Complete commits list: 2.68.1...2.69.0

Summary:

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

20 Jun 18:44
4f991ed
Compare
Choose a tag to compare

Complete commits list: 2.68.0...2.68.1

Summary:

  • Fixed bug mutating the parameter of diffInWeekdays() and diffInWeekendDays()

2.68.0

15 Jun 15:16
ae0ae7c
Compare
Choose a tag to compare

Complete commits list: 2.67.0...2.68.0

Summary:

Breaking chances (for edge-case usages):
⚠️ Now mixin methods will respect mutability: for instance if you previously returned $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.

⚠️ Now CarbonPeriodImmutable emit CarbonImmutable objects on iteration, if you rely on receiving Carbon and doing mutation on it, you should call now explicitly first ->toMutable().

⚠️ Now 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

25 May 22:20
c1001b3
Compare
Choose a tag to compare

Complete commits list: 2.66.0...2.67.0

Summary:

New Contributors

2.66.0

29 Jan 21:49
4967128
Compare
Choose a tag to compare

Complete commits list: 2.65.0...2.66.0

Summary:

New Contributors

2.65.0

06 Jan 16:04
09acf64
Compare
Choose a tag to compare

Complete commits list: 2.64.1...2.65.0

Summary:

New Contributors

2.64.1

01 Jan 23:21
f2e5996
Compare
Choose a tag to compare

Complete commits list: 2.64.0...2.64.1

Summary:

What's Changed

  • Fixed #2744 passing $skipparameter as string in diffForHumans()

2.64.0

26 Nov 17:38
8895464
Compare
Choose a tag to compare

Complete commits list: 2.63.0...2.64.0

Summary:

⚠️ 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 instance addMonths(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