File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -34,6 +34,9 @@ public function between(): EntryCollection|array
3434
3535 public function calendar (): Collection
3636 {
37+ $ currentLocale = CarbonImmutable::getLocale ();
38+ CarbonImmutable::setLocale (Site::current ()->locale ());
39+
3740 $ month = $ this ->params ->get ('month ' , now ()->englishMonth );
3841 $ year = $ this ->params ->get ('year ' , now ()->year );
3942
@@ -46,7 +49,11 @@ public function calendar(): Collection
4649 ->groupBy (fn (Entry $ occurrence ) => $ occurrence ->start ->toDateString ())
4750 ->map (fn (EntryCollection $ occurrences , string $ date ) => $ this ->day (date: $ date , occurrences: $ occurrences ));
4851
49- return $ this ->output ($ this ->makeEmptyDates (from: $ from , to: $ to )->merge ($ occurrences )->values ());
52+ $ days = $ this ->output ($ this ->makeEmptyDates (from: $ from , to: $ to )->merge ($ occurrences )->values ());
53+
54+ CarbonImmutable::setLocale ($ currentLocale );
55+
56+ return $ days ;
5057 }
5158
5259 public function daysOfWeek (): Collection
You can’t perform that action at this time.
0 commit comments