1

I have a route setup for Dates and would like to show all entries from that particular Day and Month.

For example, clicking 29/11/2022 would take you to mysite.com/dates/29-11 and I would like to see all posts with a date field matching 29/11/****.

From the docs, it doesn't seem like this is possible, as the comparisons include the year; does anyone know of a way to do it?

In my head it's something like:

{% set date = craft.app.request.getSegment(2) %}
{# so date = '29-11' #}

{% set entries = craft.entries().date(['contains', date]).all() %}

OR

{% set entries = craft.entries().search(date).all() %}

supazu
  • 576
  • 4
  • 12

1 Answers1

1

Do I get your question right that the tricky part is to get entries for a certain day in multiple years?

Is the number of years in question limited? Then you could set up a loop and query the years one after another.

obs
  • 509
  • 4
  • 11