Setting Datetime Conditional to Show and then Hide an element

Hi,

I am trying to setup a conditional that would show an element for a day and then hide the same element (and show a new element). Is this possible using Conditionals? I’m trying to use this:

{{dc:global:date format=“Y-m-d H:i:s”}} before 2021-11-13 00:00:00 and
{{dc:global:date format=“Y-m-d H:i:s”}} after 2021-11-13 20:00:00

For this particular element I’d like it to show up on November 13 only until 8pm .
I’ve tried swapping the before and after and neither way seems to work. Is this possible? Trying to avoid having to go back into slider revolution and using the publish on feature…it would be great if I could do this with conditionals because then I could change TopBar text the same way.

Also, sidenote, my client is in a different time zone and the site is set to that time zone…so the global time should pull that time, not my local time, yes?

Thanks!
Jen

Hello Jen,

Thanks for writing in! The date and time format can be possible as your condition. You just have to separate the date and time:

{{dc:global:date format="Y-m-d"}} before 2021-11-13
{{dc:global:time format="H:i:s"}} before 00:00:00

Best Regards.

I will give that a try. But this doesn’t address the issue of being able to have a graphic pop up at a certain time and then disappear at a certain time. Is there a way to bracket the conditions for that? Does separating it this way and using the “before” and “after” allow for that?

Thanks!
Jen

Hi Jen,

To make that Popup visible between a specific time, you need to add the condition with after and before both with the same way you separated for the before.

Hope it helps.
Thanks

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.