merge-api / merge-csharp-client

The C Sharp SDK for accessing various Merge Unified APIs
Other
2 stars 1 forks source link

DateTime Conversion to ISO 8601 Compliant Format #30

Open travis-hervey-pi opened 1 month ago

travis-hervey-pi commented 1 month ago

In the various places where DateTime is being converted to ISO 8601 formats, the format string is wrong and results in an API error when trying to filter by the times.

Example: https://github.com/merge-api/merge-csharp-client/blob/c03fb3311b8db48276b11b7ab9d4081caf0bb68c/src/Merge.Client/Hris/Employees/EmployeesClient.cs#L94

The above line produces "oO" as the time.

image

Proposed Solution:

The format string should be "0" which produces the ISO 8601 compliant time format.

_query["modified_after"] = request.ModifiedAfter.Value.ToString("o");

This looks like it needs to be applied to all the Client objects where filtering by a DateTime is possible.

dsinghvi commented 1 month ago

@travis-hervey-pi -- we are currently working on a fix for this. ccing @dcb6 to follow up here when a new SDK version is released.