diff --git a/app/Actions/Statistics/LoadEvents.php b/app/Actions/Statistics/LoadEvents.php index 41fa3de3..15214f08 100644 --- a/app/Actions/Statistics/LoadEvents.php +++ b/app/Actions/Statistics/LoadEvents.php @@ -59,13 +59,9 @@ class LoadEvents $exp_away_from = $exp_away - $accuracy; $exp_away_to = $exp_away + $accuracy; - // dd($team_id, $exp_home, $exp_away); + $start = $filter['start_date'] ?? 0; - // "endDate" - // "startDate" - - $start = $filter['startDate'] ?? 0; - $end = $filter['endDate'] ?? 0; + $end = $filter['end_date'] ?? 0; /** * STATTISTIC DATA diff --git a/app/Filament/Pages/Statistic.php b/app/Filament/Pages/Statistic.php index 2bfeab5f..23eff886 100644 --- a/app/Filament/Pages/Statistic.php +++ b/app/Filament/Pages/Statistic.php @@ -17,6 +17,7 @@ use Filament\Pages\Dashboard as BaseDashboard; use Filament\Pages\Dashboard\Concerns\HasFiltersForm; use Filament\Schemas\Components\Section; use Filament\Schemas\Components\Utilities\Get; +use Filament\Schemas\Components\Utilities\Set; use Filament\Schemas\Schema; class Statistic extends BaseDashboard @@ -62,12 +63,24 @@ class Statistic extends BaseDashboard ->preload() ->searchable() ->label('Team'), - DatePicker::make('startDate') + DatePicker::make('start_date') ->native(false) - ->prefixIcon('phosphor-calendar'), - DatePicker::make('endDate') + ->prefixIcon('phosphor-calendar') + ->suffixAction( + Action::make('clear_start') + ->icon('phosphor-x') + ->color('gray') + ->action(fn (Set $set) => $set('start_date', null)) + ), + DatePicker::make('end_date') ->native(false) - ->prefixIcon('phosphor-calendar'), + ->prefixIcon('phosphor-calendar') + ->suffixAction( + Action::make('clear_end') + ->icon('phosphor-x') + ->color('gray') + ->action(fn (Set $set) => $set('end_date', null)) + ), ])->columns(4) ->columnSpanFull(), Section::make()