Files
mixtape/zero.Core/Entities/DateRange.cs
T

25 lines
405 B
C#
Raw Normal View History

2020-10-09 12:17:58 +02:00
using System;
namespace zero.Core.Entities
{
public class DateRange
{
public DateTimeOffset? From { get; set; }
public DateTimeOffset? To { get; set; }
2021-08-18 12:39:01 +02:00
public bool IsWithin(DateTimeOffset date)
{
if (From.HasValue && date < From)
{
return false;
}
if (To.HasValue && date > To)
{
return false;
}
return true;
}
2020-10-09 12:17:58 +02:00
}
}