Skip to content

Releases: briannesbitt/Carbon

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

2.63.0

31 Oct 07:11
ad35dd7
Compare
Choose a tag to compare

Complete commits list: 2.62.1...2.63.0

Summary:

  • Added #2682 Added case 'yr', 'yrs' and 'mos' alias in CarbonInterval string parser β€” @OmnibladeZ
  • Added #2693 Translate ordinal word when parsing
  • Improved #2677 Print original params in Carbon\Traits\Units::addUnit error message β€” @costasovo
  • Fixed #2689 Update SL language ("2 years ago" translation) β€” @Mihc3
  • Fixed #2683 Allow lowercase macro-format per-language customization
  • Fixed #2665 Prevent floor overflow
  • Fixed #2667 Prevent ceil precision loss
  • Fixed #2669 Harmonize toStringFormat config
  • Fixed #2670 Distinguish months and months_standalone in Latvian
  • Fixed #2681 Fix float unit tests
  • Fixed #2687 Fix weekday setter
  • Fixed #2688 Fix PHPStan macro arguments check
  • Fixed #2684 Update Laravel compatibility GH workflow

New Contributors

2.62.1

02 Sep 07:49
01bc4cd
Compare
Choose a tag to compare

Complete commits list: 2.62.0...2.62.1

Summary:

What's Changed