[SOLVED] Odata Date filter doesn't work when a date field in the schema is made mandatory

I found that when a date field in the schema is made mandatory the Odata filter doesn’t work. I verified this, it works as soon as it is made non-mandatory. Error message: “OData operation is not supported.”

Need to add following:

 if (nodeIn.TypeReference.Definition == DateTimeType)
       return ParseInstant(nodeIn.Value);

in “public override ClrValue Visit(ConstantNode nodeIn)” ConstantWithTypeVisitor.cs

This works for the current issue but not sure if it won’t affect other functionalities.

Btw. you can format your code with


I am not sure how the required flag is related to your code.

Your change makes sense, but we have to find a case in the unit tests to verify when this is needed.


I found a few more cases: https://github.com/Squidex/squidex/commit/87816a8d9093c4618ffaf5781ca3b9aa378d6e37

If you can, you can provide a PR for the 3.X branch. I can then create a patch for 3.5.

I think converting into required field makes it a ConstantNode from a ConvertNode.

Yes, a little bit strange…but the tests shows all cases.