I have an array of terms which have start-dates and end-dates. how can I find whether today falls between the terms. code is
var termsforcurrentCalendar = UnitOfWork.SchoolTerms.Query().Where(x
=> x.SchoolCalendarId == currentCalendar.SchoolCalendarId).ToArray();
var noOfTerms = termsforcurrentCalendar.Count();
for (int i = 0; i < noOfTerms; i++)
{
if (DateTime.Today > termsforcurrentCalendar[i].EndDate)
{
if (i != noOfTerms)
{
if (DateTime.Today < termsforcurrentCalendar[i + 1].StartDate)
{
datetoBeChecked = termsforcurrentCalendar[i + 1].StartDate;
}
}
}
}