Fixes the issue where the toString of OffsetDateTime truncates trailing 0's#297
Fixes the issue where the toString of OffsetDateTime truncates trailing 0's#297rcunn87 wants to merge 1 commit intoforcedotcom:masterfrom
Conversation
|
@mgrumbach This is the reopened PR |
f2cea51 to
3fa3471
Compare
| private static final HashSet<String> keywords = getKeyWords(); | ||
| private static HashMap<String, Class<?>> primitiveClassCache = getPrimitiveClassCache(); | ||
|
|
||
| private static final DateTimeFormatter DTF = DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ss.SSSX"); |
There was a problem hiding this comment.
Is the final X correct? If the OffsetDateTime value always has zero offset, then this should work. However, if non-zero offsets are possible, then we probably want XXX to match Salesforce. Note that OffsetDateTime.toString() uses XXXXX.
There was a problem hiding this comment.
The problem I was encountering was that OffsetDataTime.toString uses the shortest of what whats listed in the javadoc, and then salesforce was rejecting the data.
Let me change it and give it a test
|
Hi @rcunn87 , can you provide the steps you are using to reproduce the issue you are seeing? If you could create an "Issue" that describes the issue and steps to reproduce, and then link it to this PR, that would be very helpful. |
By default OffsetDateTime will truncate trailing Zeros from its toString representation, this change ensures that the trailing zeros will not be truncated
The truncated 0 was causing updates to get rejected because they were not a valid format