mirror of
https://github.com/ICDSystems/ICD.Common.Utils.git
synced 2026-02-18 14:15:12 +00:00
fix: Fixing JSON datetime parsing in 2017
This commit is contained in:
@@ -213,8 +213,12 @@ namespace ICD.Common.Utils.Extensions
|
|||||||
if (extends == null)
|
if (extends == null)
|
||||||
throw new ArgumentNullException("extends");
|
throw new ArgumentNullException("extends");
|
||||||
|
|
||||||
|
#if SIMPLSHARP
|
||||||
string stringValue = extends.GetValueAsString();
|
string stringValue = extends.GetValueAsString();
|
||||||
return JsonUtils.ParseDateTime(stringValue);
|
return JsonUtils.ParseDateTime(stringValue);
|
||||||
|
#else
|
||||||
|
return (DateTime)extends.Value;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -39,7 +39,11 @@ namespace ICD.Common.Utils.Json
|
|||||||
if (token == null)
|
if (token == null)
|
||||||
throw new ArgumentNullException("token");
|
throw new ArgumentNullException("token");
|
||||||
|
|
||||||
|
#if SIMPLSHARP
|
||||||
return ParseDateTime((string)token);
|
return ParseDateTime((string)token);
|
||||||
|
#else
|
||||||
|
return (DateTime)token;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
Reference in New Issue
Block a user