I have been trying for a while to find datetime functions that work in Azure search queries. Functions such day(MyDateTime) or time(MyDateTime) to get the day of the week or time part respectively.
I have a Collection(Schedule{scheduleStart,scheduleEnd}) - Both properties being of DateTimeOffset, with which I query/filter using the lamda syntax like so:
$filter=schedule/any(d: day(d/scheduleStart) eq 1)
As far as I am aware and from what I have researched, the above day() function is a valid OData function but does not seem to work when ever I use it. I get the error Function 'day' is not supported...
So my question is. How can I get the day part or time part from a valid DateTimeOffset value in Azure Search using the query syntax? Do these functions exist?
I guess I can add another property to my model with the dayOfWeek int value, but I don't want to do that until I know there is a better way and it would only solve 1 of my problems anyway :)