I am using the k3-pagesdisplay-section plugin to list pages in a section. This list can be sorted via a query field in the blueprint. So far the sorting works fine:
query: page.children.sortby('mydate', 'asc')
However, now I would like to alter this query to filter out all the pages whose mydate is in the future. While I find an example of filtering past dates in the reference, it uses a custom function. I don’t know how to transfer this to a query.
Ok, now I am majorly confused, how do I do this?
I tried this, but obviously it does not work. How can I pass on the $mydate var to the inner function?
Yes, hardcoded it works. However, that would mean I would need to write a method for each specific date field (I have multiple ones). I think the issue is in forwarding the $mydate argument into the inner function.