I have a kind of kludgy idea for how it could be done with a bit of JavaScript and the existing code structure of the plugin, but I’m reluctant to recommend it.
In short, after the page loads, I’d iterate through the list of events with jQuery('.ics-calendar .event').each()
. The plugin creates a CSS class in the form of thhmmss
for the start time of each event. (For instance, an event that starts at 8 AM would have a CSS class of t080000
.)
You could take the integer portion of that class, compare it to the current time, and hide any events that started in the past.
Of course, aside from being kludgy, this is not ideal because it would hide events as soon as they start, but I assume you want to hide them when they end, so you’d have to fudge that somehow.
Anyway… I think this explanation suffices to demonstrate why I’m not putting this into the plugin as-is… but it’s a start. I think I would probably modify the template to include data-start
and data-end
attributes in each of the events, with the value in hhmmss
format (no t
at the beginning), and use the data-end
value in the comparison against the current time.
-
This reply was modified 2 years, 7 months ago by
room34.