Condition for days of the week

So I have four (4) images within a header, but I only wanted to show one at a time, with the condition being the time of day (morning, afternoon, evening and night). This is the correctly working code:

But now, I’d like to add a fifth image that appears only on the weekend, as well as keep from showing any of the other images.

Another way of looking at: the first four images are only for weekdays and the new image will only be for the weekend (Sat & Sun).

This seemed to work for the new weekend image:
Variable: {{dc:global:date format="D"}}
Condition: is Sun
OR
Variable: {{dc:global:date format="D"}}
Condition: is Sat

But I can’t get the other images to work.

Hello Chad,

Thank you for the inquiry.

For the weekdays image, have you tried using {{dc:global:date format=“D”}} > Day Name Equal To > Tue ? You might need to create conditions for each day from Mon to Fri.

Make sure that the Expression is set to Datetime.

Let us know the result.

Best regards.

Hi Ismael,

Thanks for responding.

I tried your suggestion.

It semi-worked: but now all 4 images are showing, instead of just the selected time image.

here’s what one image’s conditional logic now looks like:

Thank you for the update.

You may need to include the {{dc:global:time}} after/before condition for each day.

{{dc:global:time}} after 00:00
{{dc:global:time}} before 09:00
{{dc:global:date format=“D”}} > Day Name Equal To > Mon

OR

{{dc:global:time}} after 00:00
{{dc:global:time}} before 09:00
{{dc:global:date format=“D”}} > Day Name Equal To > Tue

OR


Let us know how it goes.

1 Like

Brilliant Ismael! Why didn’t I see the logic? That makes perfect sense.

I’m traveling today but I’ll try it later when I return. Thanks!

I’ll let you know how it turns out.

No worries! We’ll keep the thread open.

Thanks Ismael.

I’ve added all the conditions, but I will be testing everything manually (as the week goes).

It’s Sunday today- can we keep this thread open until the end of the coming week (6 days?).

I’d like to see if all the conditions are working.

Hey Chad,

Yes, this can be open. Be advised that threads will automatically close 10 days after the last response.

Cheers.

1 Like

Thanks Ruenel.

YES! They are all working beautifully!

Thanks for your staff’s (and community’s) unselfish responses to my annoying inquires.

I appreciate it and you may go ahead and close this topic if you so wish.

I hope this helps someone in the future.

You are most welcome @ChadAustin