Searchable not working on date column.
This piece of code seems not to work .Searching by the date does not work .The date format displayed in the table takes this form . Any help or leads ?
11 Replies
try searching using your db datetime format, e.g. if you're using mysql, search by 2023-10-4 ...
Still not really working
You can't really search data columns if I recall correctly. You would just add a date filter in instead?
is your table attached to your own livewire component or to an app resource?
I'm able to search by date on date columns, at least it does work for me when the table is attached to an app resource and using the panel builder, but the date format must match the db date format. This is my boot function in my AdminPanelProvider:
and this is my text column:
If your table is attached to another livewire component then you migh need to do some work first https://filamentphp.com/docs/3.x/tables/adding-a-table-to-a-livewire-component
Maybe you need to cast your paid_date to date (Carbon)
I don't get it, why not add a calendar? That will be a UX Pain?
A filter with a calendar or two calendars (date from/date until) would be a solution of course. But what if you do not want to add such a filter? Is it possible to use the built in search widget or not?
I am not sure it allows it if I am honest as you need to have an exact date / time for that column to search it. Otherwise you are searching numbers etc.
ok, ok, as long as we can customise the search function (using a closure) or we can create filters it shouldn't be a problem, quite powerful, thank mate!