+7
-3
lines changedFilter options
+7
-3
lines changed Original file line number Diff line number Diff line change
@@ -21,6 +21,9 @@ static QueryLogic()
21
21
{
22
22
QueryToken.StaticEntityExtensions = parent => Expressions.GetExtensionsTokens(parent);
23
23
QueryToken.DynamicEntityExtensions = parent => Expressions.GetExtensionsWithParameterTokens(parent);
24
+
QueryToken.IsLocalDateTime = qt =>
25
+
qt is NetPropertyToken npt && npt.MemberInfo.Name == nameof(DateTimeOffset.DateTime) && npt.MemberInfo.DeclaringType == typeof(DateTimeOffset) ||
26
+
qt is EntityPropertyToken ept && Schema.Current.Field(ept.PropertyRoute) is FieldValue fv && fv.DateTimeKind == DateTimeKind.Local;
24
27
ExtensionToken.BuildExtension = (parentType, key, parentExpression) => Expressions.BuildExtension(parentType, key, parentExpression);
25
28
QueryToken.ImplementedByAllSubTokens = GetImplementedByAllSubTokens;
26
29
QueryToken.IsSystemVersioned = IsSystemVersioned;
Original file line number Diff line number Diff line change
@@ -93,10 +93,11 @@ public override Filter ToFilter(QueryDescription qd, bool canAggregate, JsonSeri
93
93
var val = value is JsonElement jtok ?
94
94
jtok.ToObject(expectedValueType, jsonSerializerOptions) :
95
95
value;
96
+
96
97
97
-
if (val is DateTime dt)
98
+
if (val is DateTime dt && !QueryToken.IsLocalDateTime(parsedToken))
98
99
val = dt.FromUserInterface();
99
-
else if (val is ObservableCollection<DateTime?> col)
100
+
else if (val is ObservableCollection<DateTime?> col && !QueryToken.IsLocalDateTime(parsedToken))
100
101
val = col.Select(dt => dt?.FromUserInterface()).ToObservableCollection();
101
102
102
103
return new FilterCondition(parsedToken, operation, val);
Original file line number Diff line number Diff line change
@@ -260,7 +260,7 @@ public static IEnumerable<QueryToken> OnDynamicEntityExtension(QueryToken parent
260
260
return DynamicEntityExtensions(parent);
261
261
}
262
262
263
-
static Func<QueryToken, bool> IsLocalDateTime = qt => qt is NetPropertyToken npt && npt.MemberInfo.Name == nameof(DateTimeOffset.DateTime) && npt.MemberInfo.DeclaringType == typeof(DateTimeOffset);
263
+
public static Func<QueryToken, bool> IsLocalDateTime;
264
264
265
265
public static List<QueryToken> DateTimeProperties(QueryToken parent, DateTimePrecision precision)
266
266
{
You can’t perform that action at this time.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4