Skip to content

Commit

Permalink
Update FilterDateTimePicker.php (#1762)
Browse files Browse the repository at this point in the history
```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])
```
  • Loading branch information
edwinheij authored Nov 8, 2024
1 parent 3ab657a commit a88af7b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/Components/Filters/FilterDateTimePicker.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit a88af7b

Please sign in to comment.