public override bool IsValidInternal(string value) { DateTime dateTime; if (StringParserHelper.IsNullOrEmptyOrBlank(value) || !StringParserHelper.TryParseDate(value, out dateTime)) { return(false); } DateTime now = DateTime.Now; if (dateTime.Year > now.Year) { return(true); } return(dateTime.Year == now.Year && dateTime.Month >= now.Month); }
public override bool IsValidInternal(string value, object state) { string cultureString = state as string; bool flag; if (StringParserHelper.IsNullOrEmptyOrBlank(value)) { flag = !this.IsRequired(state); } else { DateTime dateTime; flag = DateTimeHelper.TryParse(value, cultureString, out dateTime); if (flag && dateTime > DateTime.Now) { flag = false; } } return(flag); }
public override bool IsValidInternal(string value) => StringParserHelper.IsNullOrEmptyOrBlank(value) || StringParserHelper.TryParseDate(value, out DateTime _);
public override bool IsValidInternal(string value) => !StringParserHelper.IsNullOrEmptyOrBlank(value);