I have a WebApplication that manages events into tables like an Agenda.. For each event I have a StartDate and EndDate.
In the Application I want to export the events into a graph, and I want to check if the event passes the range of the required dates.
For example: Event 1: StartDate (9 September) EndDate (14 September)
I want to check if it passes (10 Sept - 16 Sept)
This is a photo of the events example Graph:
This is a code that checks for only one date:
public static bool Within(this DateTime current, DateTime startTime, DateTime endTime)
{
return startTime < currentTime < endTime;
}
Edit: To clarify more, I want the function to return true if the event passes the 2 dates range, even if it start before the range or ends after the rang it should return true anyway.
only return false if it does not pass the range.