This commit is contained in:
@@ -325,6 +325,38 @@ namespace AyaNova.PlugIn.V8
|
||||
return s;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
///////////////////////////////
|
||||
// v7 to v8 Date conversion
|
||||
//
|
||||
//
|
||||
public static string StringDateToV8(string s, bool neverEmpty=false)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(s))
|
||||
{
|
||||
if (neverEmpty)
|
||||
{
|
||||
return DateTime.UtcNow.ToString("o");
|
||||
}
|
||||
else {
|
||||
return string.Empty;
|
||||
}
|
||||
}
|
||||
|
||||
DateTime result=new DateTime();
|
||||
if (DateTime.TryParse(s, out result))
|
||||
return result.ToUniversalTime().ToString("o");
|
||||
|
||||
//couldn't be parsed
|
||||
if(neverEmpty)
|
||||
return DateTime.UtcNow.ToString("o");
|
||||
return string.Empty;
|
||||
|
||||
}
|
||||
|
||||
|
||||
public enum AyaUiFieldDataType : int
|
||||
{
|
||||
NoType = 0,
|
||||
|
||||
Reference in New Issue
Block a user