Browse Source

Fixed Incorrect Deserialization of FilterConstant values

Frank van den Bos 2 years ago
parent
commit
2a704c860c
1 changed files with 8 additions and 3 deletions
  1. 8 3
      InABox.Core/CoreUtils.cs

+ 8 - 3
InABox.Core/CoreUtils.cs

@@ -545,9 +545,14 @@ namespace InABox.Core
             if (value is string && type == typeof(byte[]))
                 return Convert.FromBase64String(value as string);
 
-            //if (value is string && type == typeof(Memo))
-            //	return new Memo(value as String); // { _data = value as string };
-
+            if (value is FilterConstant && type == typeof(DateTime))
+            {
+                if (Equals(FilterConstant.Now, value))
+                    return DateTime.Now;
+                if (Equals(FilterConstant.Today, value))
+                    return DateTime.Today;
+            }
+            
             if (!(value is IConvertible))
                 return value;