Hi Abdul,
That’s a great question! I know that there is a function that would allow you to test if a particular view is for past events, but nothing for testing individual events, I’m afraid.
We do a similar sort of thing when displaying the “This events has passed” message on the single events page for events that are in the past. You may be able to repurpose some of that code to do the same.
Sorry I don’t have a concrete solution for you here, but I hope this at least helps you get started!
Cheers,
Geoff