using System; using System.Collections.Generic; using System.Linq; using System.Web; namespace MileageTraker.Web.Models { public static class DomainRules { /// /// Returns the most recent date for which a log can be submitted from today /// public static DateTime GetLogEntryCutoff() { return GetLogEntryCutoff(DateTime.Today); } /// /// Returns the most recent date for which a log can be submitted given the /// reference date /// public static DateTime GetLogEntryCutoff(DateTime referenceDate) { return referenceDate.AddMonths(-1).AddDays(-referenceDate.Day + 1); // last two months } } }