Skip to content

Commit

Permalink
Fix Uninitialized string offset 0 when using date filter (#1211)
Browse files Browse the repository at this point in the history
* Fix Uninitialized string offset 0

When filtering by date, then removing this filter and using the global search, an "Uninitialized string offset 0" error occured.

* Run pint

---------

Co-authored-by: luanfreitasdev <[email protected]>
  • Loading branch information
manuelteuber and luanfreitasdev authored Oct 18, 2023
1 parent e26f828 commit d8fb0ee
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Components/Filters/Builders/DatePicker.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ class DatePicker extends BuilderBase
{
public function builder(EloquentBuilder|QueryBuilder $builder, string $field, int|array|string|null $values): void
{
if (gettype($values) === 'string') {
return;
}

/** @var array $values */
[$startDate, $endDate] = [
0 => Carbon::parse($values[0])->format('Y-m-d'),
Expand Down

0 comments on commit d8fb0ee

Please sign in to comment.