Change type of date/time fields from 'string' to 'DateTimeOffset' #101
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi, this is my first PR to your repo, let me know if there are things you'd like done differently.
The Zendesk API v2 requires that most date/times be formatted as ISO8601. In the ZendeskApi_v2 library, the types of date/time fields is always
string
.It would be helpful for it to be
DateTime
orDateTimeOffset
so that developers don't pass incorrect date/time formats to the Zendesk API. For instance, there have been Zendesk API developers who have passed strings likeFriday, September 9, 2014 8:03 AM
fordue_at
to the Zendesk API.It also is helpful for developers when receiving values back from the Zendesk API; if they're already of type
DateTime
orDateTimeOffset
in the returned result, the developer doesn't have to worry about parsing the result.I chose
DateTimeOffset
overDateTime
since it includes timezone information and is the more modern choice in the .NET Framework. (Does this make sense?)This is probably a breaking change so I suppose it'll have to be carefully considered. However, I think most developers would prefer to work with a real date/time object instead of a string in this case.
string
toDateTimeOffset?
DueAt
settingCreatedAt
,UpdatedAt
to ticket creation test