Hello Muhammad,
Are you using a TPC Grid? If so, it is correct that the dates are being passed to the front-end as an ISO UTC string. This format would look something like the following:
"2018-05-01T20:22:54.000Z".
If the dates are not being passed in this format, we would recommend that you upgrade to The Portal Connector version 5.3, as we have completely re-built the way the application handles dates.
Fetch XML is filterable using an ISO string as shown above (the default way that The Portal Connector passes dates to the grid). For example, the following fetch is valid and returns me many records.
<fetch version="1.0" mapping="logical" output-format="xml-platform">
<entity name="account">
<attribute name="name" />
<attribute name="primarycontactid" />
<attribute name="telephone1" />
<attribute name="accountid" />
<attribute name="createdon" />
<order attribute="name" descending="false" />
<filter type="and">
<condition attribute="createdon" operator="eq" value="2018-05-01T20:22:54.000Z" />
</filter>
</entity>
</fetch>
Are you calling this functionality through custom JavaScript? If so, you can pass the UTC (ISO String) to the JavaScript Date object and it will automatically create a Date in the users local timezone.
var localDate = new Date("2018-05-01T20:22:54.000Z")
From this Date object, you can use standard
Date.ToString() or
Date.toLocaleDateString() and create any date format you would like.
It is not recommended to format the Date using the Grid column settings (server-side), as this will ignore the users local time zone.
It is possible to format the dates on the client-side, this will simply require some custom JavaScript. Below is a working example of how to use Kendo Date formatting to format the date of a column in a TPC Grid.
//Obtain Grid
var grid = tpc.page.TpcGridModel.get_grid();
/* -------------------------------------------------------------
Standard Date Format
---------------------------------------------------------------*/
//Set Date Column Format
grid.columns[6].format = "{0:d}";
//Set Options
grid.setOptions({
columns: grid.columns
});
/* -------------------------------------------------------------
Custom Date Format
---------------------------------------------------------------*/
//Set Date Column Format
grid.columns[6].format = "{0: yyyy-MM-dd HH:mm:ss}";
//Set Options
grid.setOptions({
columns: grid.columns
});
More information on Kendo Date formatting can be found here:
https://docs.telerik.com/kendo-ui/globalization/intl/dateformatting.
Hopefully this information is useful and will help you to solve your FetchXML issue. Please let me know if you have any other questions or email us at
support@crmportalconnector.com if you need more help.
Thank you,
Josh