hi all, i am trying to filter my collection in this way but the filter really doesn’t work [it shows me always the content]:
$filter_date = date(param('filter_date'));
$collection = $collection->filter(function ($page) use ($filter_date) {
return $page->my_date_field()->toDate('d-m-Y') === $filter_date;
});
The format i am using to expose the param() is the same ‘d-m-Y’ i am using to filter.
I watched this page [but it could not help me]: Filtering compendium | Kirby CMS
Thanks in advance for your help
———
My doubt: is it relevant that i am using a snippet to do this [and not the controller]?