I am using Sitecore 9.0.1 with SXA components. I have checked the SXA out of the box components for search functionality. For date fields, we have date range by which we can filter items in a specific date range value. There is a filter dropdown also, which works only n integer facets.

Can we have a date field in a template and then filter the items by year?

Example, we have below date fields in item values:

  • 12th January 2016
  • 18th May 2015
  • 31st March 2015

In search field dropdown, we will have 2 options as 2016 and 2015. On select of 2015, it will display the 2nd and 3rd item.

I am pretty new to Sitecore and SXA, any links or references will be much helpful.

Thanks in advance :)

  • There is already similar question here -> sitecore.stackexchange.com/a/5791/2056 .Difference is that they are sorting and you need to filter. I believe that you need to do one or two more steps and you are there.. – Peter Procházka Mar 26 '18 at 18:16
  • @PeterProchazka : Thanks for the quick response, but they are just sorting using date, I want to filter using year of the date, not the full date part, I kind of want to group results by year !! – Deepak Jena Mar 27 '18 at 12:00

Your Answer

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

Browse other questions tagged or ask your own question.