File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
Expand file tree Collapse file tree 1 file changed +5
-2
lines changed 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