Hey everyone, definitely getting lost in this one, it is probably something simple, but I think I have been staring at it too long.
I am helping out a Twitch Streamer friend with their website (on Treepl) and I want to put some notification when they are live. We are using the System Events Module and he has an event start and end date. His schedule is 5 days a week from 9:30am - 1:00pm (EST). His site is set up as “Eastern Standard Time”.
So, what I am trying to do is:
- If his Stream is live, between 9:30am - 13:00 (est) on the day that it says - “I am live on Twitch”;
- If his stream is not live, then it just outputs his next event (I can do this one, no problem).
My example below is not working… any suggestions?
{% assign currentDate = "now" | date: "%Y-%m-%d" %}
{% assign currentDateTime = "now" | date: "%Y-%m-%dT%H:%M" %}
{% component source: "Event", layout: "", sortBy: "releasedate", sortOrder: "DESC", searchScope: "{'prop_EventStartDate_Min':'{{currentDate}}'}", limit: "1", collectionVariable: "events_header", type: "module" %}
{%- for item in events_header.items %}
{% if item['EventDateStart'] >= currentDateTime and item['EventDateEnd'] <= currentDateTime %}
<p class="header-live">I'm live on twitch...</p>
{% else %}
<p class="header-live">Next stream...</p>
{% endif -%}
{% endfor -%}
Any suggestions? I know it is probably something simple that I am missing, and I’ll probably figure it out at some point… it’s been a long work weekend, so my brain is a little fried
Thanks in advance,
Aaron