packagist nesbot/carbon 2.68.0

latest releases: dev-master, 3.8.2, 3.x-dev...
17 months ago

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.

Don't miss a new carbon release

NewReleases is sending notifications on new releases.