Notification visible between a defined start and end date

Dear community,

i’m stuck with a page notification that contains a current notice regarding holiday times, therefor i only want it to show during a defined period of time. the customer should be able to select the start and end date using the date/time field within the collection.
Using conditional visibility or filter option with the options “is after or equal to …” and “is before or equal to …” i couldn’t get the desired results.

Maybe this problem could be solved with some custom code?

Any help is highly appreciated : )
Cheers Chris

I found this post with info from @memetican in 2022. Looks like it can perform your task:

1 Like

If it’s in the CMS, the collection list filtering feature works great.

  • Add start date and end date to your collection
  • In the filter settings you want two rules;
    • Start date <= today
    • End date >= today

That tells you the event is happening now, as defined by server time, adjusted to the timezone you’ve set for your site.

The wording is a bit convoluted.
IIRC, you define it as Start Date / is before / 0 days / in the past.
It will recognize what you’re trying to do and rewrite it.

Same approach for End Date / is after / 0 days / in the future.

[ Added ] - here’s a writeup on the different approaches.

1 Like

perfect, thank you so much! : )

thank you so much – with your instructions the filters work perfectly! :smiley:

(the wording is indeed very misleading)

1 Like