Add cancel button for edit log.
Disable edit button for past month Format gas correctly
This commit is contained in:
@@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user