I have try use Filter Scopes default value for type: date, not working, but for type:text, it’s working.
label: Inspection Date
default: '2023-02-28" or Carbon::now()
between: Inspdate >= ':after' AND InspDate <= ':before'
label: Inspector Name
default: 'Peter Pan'
conditions: Inspector = :value
Even using function listFilterExtendScopes(%filter), still not working
public function listFilterExtendScopes($filter)
'InspDate' => [
'label' => 'Inspection Date',
'type' => 'date',
'default' => '2023-02-28',
The type: date, I think it’s using \modiles\backend\filterwidgets\Date.php
Any one has solution?
Take a look at the Test plugin for working examples:
The Users page has a Created filter that is an implementation of
I think tommyctwu is right.
There is a bug in the date widget.
Take a look at an example (photo):
1 choose a date
2. there are no records, but there should be
3 look at the last query to the database (I choose date and the query is with the same time) The query range must be empty!!
Filter Scope Definitions
equals: id = :value
equals: user = :value
contains: user like '%:value%'
label: 'Płatne & Darmowe'
emptyOption: 'Status Płatności'
await_pay: 'W trakcie'
cancelled: 'Nie opłacone'
label: 'Złożone pomiędzy:'
between: paid_at >= ':after' AND paid_at <= ':before'
Can you reproduce it using the test plugin above? Using this plugin as a reference, what are the conditions to produce the bug…
However, I was wrong. I had the wrong time zone set, which confused me (+ two hours).
I thought a time range from same day to same day, the query would return the whole day - that’s my mistake.
The widget works correctly.
Thank you .