Skip to content

Instantly share code, notes, and snippets.

@Fodsuk
Created January 25, 2013 13:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • 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