I'm trying to add a query to offline provider as below.
And I'm trying to add a filter condition for a DateTime property of my entity.
Data types of startdate property both the proxy generated object and the CommonUtility.getDefaultStartDateEndDate().startDate
are same - Local-DateTime
try offlineODataProvider.add(definingQuery: OfflineODataDefiningQuery(name: MobileServiceMetadata.EntitySets.svsOrderList.entityType.localName, query:
DataQuery().from(MobileServiceMetadata.EntitySets.svsOrderList).where(SvsOrderListType.plannedStartDate.greaterThan(CommonUtility.getDefaultStartDateEndDate().startDate)).selectAll(),automaticallyRetrievesStreams: false));
But it gives an error saying there is a syntax error in the OData query. So when I check the URL in the description of the error it is like below.
https://mobileURL.com/MService/svsOrderList?$select=*&$filter=(PLANNED_START_DATE gt 2018-09-13T15:45:51.950))
So there is an error in the url because the Datetime value should be converted to datetime in OData URL as below ( Correct URL must be )
https://mobileURL.com/MService/svsOrderList?$select=*&$filter=(PLANNED_START_DATE gt datetime 2018-09-13T15:45:51.950))
This conversion should be done by the SDK itself no idea about how to fix this issue?
Is there any way to resolve this?