Hello. Thank you for contacting the Toolset support.
As I understand - you want to add frontend filter for month and year and compare the selected month and year with the publish date. If this is correct:
- There is no such feature to add month or year frontend filter.
What I've done is create URL Parameters for:
Starting month
Starting Year
End Month
End Year
With a filter, after or on starting month / year and before or on end month / year.
I've added an html GET-form to the filter section of the view, with the action (url of the page) loading the same page again.
The select boxes in the form have the same name as the url parameters. This way when sumitting the form, the url parameters will be added to the url. So the page reloads with the selected/ submitted parameters.
To make sure the select boxes show the selected value, i've added some javasvript.
document.addEventListener("DOMContentLoaded", function () {
const params = new URLSearchParams(window.location.search);
const fields = ['smon', 'syr', 'emon', 'eyr', 'wpv_sort_orderby', 'wpv_sort_order'];
console.log("Select elements found on the page:");
console.log(document.querySelectorAll("select"));
fields.forEach(function(name) {
const value = params.get(name);
const select = document.getElementById(name);