This commit is contained in:
@@ -367,7 +367,24 @@ namespace AyaNova.PlugIn.V8
|
||||
if (neverEmpty)
|
||||
return DateTime.UtcNow.ToString("o");
|
||||
return string.Empty;
|
||||
}
|
||||
|
||||
///////////////////////////////
|
||||
// v7 to v8 Date conversion
|
||||
//
|
||||
//
|
||||
public static bool DateIsPast(object o, bool neverEmpty = false) { return DateIsPast(o.ToString(), neverEmpty); }
|
||||
public static bool DateIsPast(string s, bool neverEmpty = false)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(s))
|
||||
return false;//no date so not past
|
||||
|
||||
|
||||
DateTime result = new DateTime();
|
||||
if (DateTime.TryParse(s, out result))
|
||||
return result < DateTime.Now;
|
||||
//can't parse so no, it's not past
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user