File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -271,7 +271,9 @@ protected function makeContentGenerationClosures($pages, $request)
271271 $ oldCarbonFormat = $ this ->getToStringFormat ();
272272
273273 if ($ this ->shouldSetCarbonFormat ($ page )) {
274- Carbon::setToStringFormat (Statamic::dateFormat ());
274+ Date::setToStringFormat (function (Carbon $ date ) {
275+ return $ date ->setTimezone (Statamic::displayTimezone ())->format (Statamic::dateFormat ());
276+ });
275277 }
276278
277279 $ this ->updateCurrentSite ($ page ->site ());
@@ -489,7 +491,7 @@ protected function shouldRejectPage($page, $outputError = false)
489491 *
490492 * @throws \ReflectionException
491493 */
492- protected function getToStringFormat (): ? string
494+ protected function getToStringFormat (): string | \ Closure | null
493495 {
494496 $ reflection = new ReflectionClass ($ date = Date::now ());
495497
You can’t perform that action at this time.
0 commit comments