Le sigh - needed to make a new ImportLogViewModel - can't be shared because of DenyPreviousMonth

This commit is contained in:
2014-02-05 20:30:29 -05:00
parent 0a492156a5
commit ff0b2a140c
17 changed files with 142 additions and 57 deletions
@@ -8,18 +8,15 @@ namespace MileageTraker.Web.Attributes
{
public override bool IsValid(object value)
{
var date = DateTime.Parse(value.ToString());
DateTime date;
if (value == null || !DateTime.TryParse(value.ToString(), out date))
return false;
return date.Date >= GetCutoff();
}
private static DateTime GetCutoff()
{
return DomainRules.GetLogEntryCutoff();
//var today = DateTime.Today;
//return today.AddMonths(-1).AddDays(-today.Day + 1); // last two months
//if (today.Day > 10)
// return today.AddDays(-today.Day); // beginning of this month
//return today.AddMonths(-1).AddDays(-today.Day); // beginning of previous month
}
}
}