-
-
Notifications
You must be signed in to change notification settings - Fork 814
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed date view attribute exception given in lead page
- Loading branch information
1 parent
0f7c722
commit 7c97839
Showing
2 changed files
with
14 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 13 additions & 3 deletions
16
packages/Webkul/Admin/src/Resources/views/components/attributes/view/date.blade.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,21 @@ | ||
@php | ||
if (! empty($value)) { | ||
if ($value instanceof \Carbon\Carbon) { | ||
$value = $value->format('Y-m-d'); | ||
} elseif (is_string($value)) { | ||
$value = \Carbon\Carbon::parse($value)->format('Y-m-d'); | ||
} | ||
} | ||
@endphp | ||
|
||
<x-admin::form.control-group.controls.inline.date | ||
::name="'{{ $attribute->code }}'" | ||
::value="'{{ $value?->format('Y-m-d') }}'" | ||
::name="'{{$attribute->code}}'" | ||
::value="'{{$value}}'" | ||
rules="required" | ||
position="left" | ||
:label="$attribute->name" | ||
::errors="errors" | ||
:placeholder="$attribute->name" | ||
:url="$url" | ||
:allow-edit="$allowEdit" | ||
/> | ||
/> |