Attributes v2 List Filter - Date Range

Is it possible to filter list items according to a date range? I can find some documentation and discussion for Attributes V1, but not V2. I have tried using greater than ‘start-date’ and less than ‘end-date’ but no success. The filter does work if the specific date matches, but I have filters for ‘This Weekend’ and ‘This Month’ so need to match anything in between.

Most of the events I am filtering span multiple dates, from a few days to a few months so I need the results to show if any of the dates align.

Hi @elliot.owen!

Your List Filter setup is correct, but you have some elements from CMS Nest and v1, which isn’t compatible with List Filter v2. To fix this try using List Nest to nest the elements from the CMS items.

Let me know if this works for you!

Hi Pedro, I’m looking for help with or documentation on how to set up the ‘to’ and ‘from’ values for the date filter with V2. E.g. can I add them both to the same checkbox, and what are the correct names for these attributes? My checkbox is labelled ‘This Weekend’ so i need > start date and < end date to both be valid.

Re: V1 Nest, can you tell me where you saw this? I do not load the V1 script and have tried to remove any reference to it. FYI, the date attributes are not displayed using List Nest.

Thanks,
Elliot

Hi @elliot.owen!

Unfortunately there isn’t a single checkbox feature that natively supports both a “from” and “to” date filters.
But I can work in come custom code to achieve that for your project if you want.

And about CMS Nest, you have some attributes still there but you don’t have the v1 script so it’s no problem, if you want you can delete them.

I’m thinking on something like this:

Combine into one checkbox + custom script

  1. Use two separate hidden inputs:

    • data-filter-range-start — accepts a date for filtering
    • data-filter-range-end — accepts a date for filtering
  2. Associate both inputs with the same field:

    <input type="hidden" fs-list-field="eventDate" fs-list-fieldtype="date" id="range-start">
    <input type="hidden" fs-list-field="eventDate" fs-list-fieldtype="date" id="range-end">
    

    This ties both inputs to the same CMS date field.

  3. Use your checkbox labels as toggles, not filters.
    ➤ Example: “This Weekend” checkbox toggles the date range into those hidden inputs.

  4. Add JavaScript to:

    • Detect when a checkbox is toggled
    • Calculate the needed date range (e.g., start of weekend to end of weekend)
    • Populate the hidden inputs with those dates
    • Trigger an input event to notify Attributes V2 to refresh filters

Let me know if this helps!

Could you please add the dates to the events?

Hi Pedro,
Is it possible to filter by date? I’m using input field with type = date.

Hi @kash!

Yess, you need to add fs-list-fieldtype="date" to your element with fs-list-field.

1 Like

Thank you Pedro. I followed that but am still not getting a result when enter the date. Can you please check my read-only . Thank you for your help.