File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11# Changelog
22
3+ ## v5.6.2 - 2025-04-22
4+
5+ ### 🐛 Fixed
6+
7+ - [ 5.x] Add support for PHP 8.4 & Laravel 12 [ @edalzell ] ( https://github.com/edalzell ) (#112 )
8+ - Default first day of week to Sunday [ @edalzell ] ( https://github.com/edalzell ) (#113 )
9+
310## v5.6.1 - 2025-03-03
411
512### 🐛 Fixed
Original file line number Diff line number Diff line change @@ -56,15 +56,18 @@ private function bootCarbon(): self
5656 {
5757 Carbon::setLocale (Site::current ()->locale ());
5858
59- $ weekStartDay = Carbon::getTranslator ()->trans (id: 'first_day_of_week ' , locale: Site::current ()->locale ());
60-
6159 /*
6260 Using these deprecated methods because I couldn't figure out another way to
6361 have the weekstart set based on the current locale.
6462
6563 When the next version of Carbon is released, it should be set properly: https://github.com/briannesbitt/Carbon/issues/2539#issuecomment-1037257768
6664
6765 */
66+
67+ if (is_string ($ weekStartDay = Carbon::getTranslator ()->trans (id: 'first_day_of_week ' , locale: Site::current ()->locale ()))) {
68+ $ weekStartDay = 0 ;
69+ }
70+
6871 Carbon::setWeekStartsAt (day: $ weekStartDay );
6972 Carbon::setWeekEndsAt (day: ($ weekStartDay + 6 ) % 7 );
7073
You can’t perform that action at this time.
0 commit comments