3

I am using Sitecore 9.3 & SXA. I have a custom event component (template, rendering, variants ...).

How do I go about creating a date range filter for the event start date and end date? I want select a range (e.g 1/29/2021 - 2/05/2021) and get all results with both start and end dates in that range. (e.g. an event with end date 1/29/2021 will be queried).

1
  • 1
    Hey Danny, This forum is not for asking these kind of question IMHO. I would kindly ask you to try implement functionality yourself and when you are stuck, come back and rephrase your question the way you will ask for particular problem. This is too general and you are asking here for implementation which I believe nobody will answer. – Peter Procházka Jan 29 at 21:57
1

Take a look at the answer here to get started: https://sitecore.stackexchange.com/a/11937/237

It's not possible ootb, and the easiest way to achieve this is creating a computed field in the index which will take the date fields value and transform it into a range text. Store this inside of the index as string and use it in the facet (as string, not as date).

Your logic to determine the ranges will be inside this computed field as that determines which dates will be related to which string. Note that you are able to change this logic if needed, but you would need to re-index your event items if you do.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.