Skip to content

Conversation

@rcunn87
Copy link

@rcunn87 rcunn87 commented Apr 19, 2022

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

@rcunn87
Copy link
Author

rcunn87 commented Apr 19, 2022

@mgrumbach This is the reopened PR

@rcunn87 rcunn87 force-pushed the fixOffsetDateTimeFormat branch from f2cea51 to 3fa3471 Compare April 21, 2022 15:16
@rcunn87
Copy link
Author

rcunn87 commented Jun 21, 2022

@shireennagdive @mgrumbach ?

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");
Copy link
Contributor

@mgrumbach mgrumbach Aug 4, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Author

@rcunn87 rcunn87 Aug 12, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@mgrumbach
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants