Skip to content

Instantly share code, notes, and snippets.

@Fodsuk
Created January 25, 2013 13:52
Show Gist options
  • Save Fodsuk/4634610 to your computer and use it in GitHub Desktop.
Save Fodsuk/4634610 to your computer and use it in GitHub Desktop.
public bool ValidateExpiryDate(string cardExpiryDate, DateTime lastPaymentDate)
{
if (cardExpiryDate == null || !CardDateUtil.FormatIsValid(cardExpiryDate)) return false;
DateTime expiryDate = CardDateUtil.ConvertToDateTime(cardExpiryDate, SetDayOfMonth.LastDayOfMonth);
var invalidExpiryDate = lastPaymentDate.AddMonths(3); //TODO: pass as variable
var inDate = expiryDate >= invalidExpiryDate;
return inDate;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment