Skip to content

Commit

Permalink
Update DateTimePicker.php
Browse files Browse the repository at this point in the history
  • Loading branch information
danharrin committed Dec 21, 2023
1 parent 88e5bb1 commit 9ed34db
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/forms/src/Components/DateTimePicker.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,10 @@ protected function setUp(): void

if (! $state instanceof CarbonInterface) {
try {
$state = Carbon::createFromFormat($component->getFormat(), $state, $component->getTimezone());
$state = Carbon::createFromFormat($component->getFormat(), $state, config('app.timezone'));
} catch (InvalidFormatException $exception) {
try {
$state = Carbon::parse($state, $component->getTimezone());
$state = Carbon::parse($state, config('app.timezone'));
} catch (InvalidFormatException $exception) {
$component->state(null);

Expand All @@ -96,7 +96,7 @@ protected function setUp(): void
}
}

$state->setTimezone($component->getTimezone());
$state = $state->setTimezone($component->getTimezone());

if (! $component->isNative()) {
$component->state((string) $state);
Expand Down

0 comments on commit 9ed34db

Please sign in to comment.