"Event Start Date Time" and "Event End Date Time" are the names of my two columns. I have to display the list of ongoing events after filtering it.
Scenario for Active Events Filter
The start time should exceed the "Event Start Date Time" and "Event Start Date Time" should equal today's date. If the time is 11 AM right now, I have to disregard all events that finished earlier. For instance, 9 AM–10 PM.
I must mention the forthcoming occurrences. Since it is currently 11 AM, I must display all of today's events from that point on until whatever time it finishes.
I also need to list any events that begin today and conclude tomorrow, such as
It is 7/7/2024 today and 8/7/2024 tomorrow.
As an illustration, the events begin today at 7/7/2024 8:30 PM and end at 8/7/2024 9 AM.
My Filter Query
Set(gblDateToday, Today());
Set(gblDateTomorrow, DateAdd(gblDateToday,1,TimeUnit.Days));
ClearCollect(
collActiveEvents,
Filter('Events', ('Event Start Date and Time' >= gblDateToday && 'Event Start Date and Time' < gblDateTomorrow) && (Status = 'Status (Events)'.Active) )
);
RemoveIf(collActiveEvents, 'Event End Date and Time' < Now());
ClearCollect(
collActiveEvents1,
Filter('Events', ('Event Start Date and Time' <= Now() && 'Event End Date and Time' >= Now()) && (Status = 'Status (Events)'.Active))
);
RemoveIf(collActiveEvents1, 'Event End Date and Time' < Now());
It's working for all the scenario except if any events starts Today after 6:30PM. Both columns are Date & Time Columns and Time zone independent in Dataverse.