Add cancel button for edit log.

Disable edit button for past month
Format gas correctly
This commit is contained in:
2014-01-21 11:30:17 -05:00
parent 1feda1b520
commit 9c2149d52c
7 changed files with 65 additions and 8 deletions
+27
View File
@@ -0,0 +1,27 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace MileageTraker.Web.Models
{
public static class DomainRules
{
/// <summary>
/// Returns the most recent date for which a log can be submitted from today
/// </summary>
public static DateTime GetLogEntryCutoff()
{
return GetLogEntryCutoff(DateTime.Today);
}
/// <summary>
/// Returns the most recent date for which a log can be submitted given the
/// reference date
/// </summary>
public static DateTime GetLogEntryCutoff(DateTime referenceDate)
{
return referenceDate.AddMonths(-1).AddDays(-referenceDate.Day + 1); // last two months
}
}
}