From a88af7b158b843ec9885f32bbf73bf43e34dba18 Mon Sep 17 00:00:00 2001 From: Edwin Heij Date: Fri, 8 Nov 2024 16:53:34 +0100 Subject: [PATCH] Update FilterDateTimePicker.php (#1762) ```Filter::datetimepicker()``` has no difference with ```Filter::datepicker()``` With this change there is a time option with Flatpickr Actually, you should also 'disable' the ```enableTime``` option in ```config/livewire-powergrid.php``` to let these two differ from each other. To also enable seconds with the datetimepicker you can use: ``` Filter::datetimepicker('created_at')->params(['enableSeconds' => true]) ``` --- src/Components/Filters/FilterDateTimePicker.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Components/Filters/FilterDateTimePicker.php b/src/Components/Filters/FilterDateTimePicker.php index 2e699ceb8..c7d569842 100644 --- a/src/Components/Filters/FilterDateTimePicker.php +++ b/src/Components/Filters/FilterDateTimePicker.php @@ -7,11 +7,13 @@ class FilterDateTimePicker extends FilterBase { public string $key = 'datetime'; - public array $params = []; + public array $params = [ + 'enableTime' => true, + ]; public function params(array $params): FilterDateTimePicker { - $this->params = $params; + $this->params = array_merge($this->params, $params); return $this; }