private bool CheckTimeSpanOverDay(TimeSpan selectedTime, TimeSpan from, TimeSpan to)
{
if (from <= to)
{
// Start and stop times are in the same day
if (selectedTime >= from && selectedTime <= to)
{
return true;
}
}
else
{
// Start and stop times are in different days
if (selectedTime >= from || selectedTime <= to)
{
return true;
}
}
return false;
}
{
if (from <= to)
{
// Start and stop times are in the same day
if (selectedTime >= from && selectedTime <= to)
{
return true;
}
}
else
{
// Start and stop times are in different days
if (selectedTime >= from || selectedTime <= to)
{
return true;
}
}
return false;
}