public IEnumerable <Date> Filter(IPeriod period) { var dates = _from .Pick(period.Days()) .Match( some: from => period.Days().Where(date => date.IsGreaterOrEqualTo(from)), none: period.Days); return(_to .Pick(period.Days()) .Match( some: to => dates.Where(date => date.IsLessOrEqualTo(to)), none: () => dates)); }
private IEnumerable <Date> GenerateForSinglePeriod(IPeriod period) { var dates = _from .Pick(period.Months()) .Match( some: from => period.Days().Where(date => date.IsGreaterOrEqualTo(from)), none: period.Days); return(_to .Pick(period.Months()) .Match( some: to => dates.Where(date => date.IsLessOrEqualTo(to)), none: () => dates)); }
public IEnumerable <Date> Filter(IPeriod period) { return(_daySelectors .Select(daySelector => daySelector.PickDays(period.Days())) .SelectMany(daySequence => _ordinals.Pick(daySequence))); }
public IEnumerable <Date> Filter(IPeriod period) => _ordinals.Pick(_weekDay .PickDays(period.Days()) .Where(day => day.Day == _nth));
public IEnumerable <Date> Filter(IPeriod period) => period.Days();