You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
In src/main/java/graphql/scalars/datetime/DateTimeScalar.java, it's incorrectly using three digits of NANO_OF_SECOND in the DateTimeFormatter. If It's a three digit fraction of a second, it should instead be MILLI_OF_SECOND.
I understand that appendFraction truncates the string without rounding, giving the same value as using MILLI_OF_SECOND. However, this is a consistency thing than more anything else, as it could be confusing to someone who isn't familiar with the DateTimeFormatterBuilder and the truncation rules of the appendFraction method.
Hello, that's a good point, it's much easier to understand the code to use milliseconds, after all they are meant to be milliseconds there. Otherwise someone might mistakenly think these are nanoseconds.
Would you like to open a PR to improve this?
sachin-bansal
added a commit
to sachin-bansal/graphql-java-extended-scalars
that referenced
this issue
Feb 29, 2024
Describe the bug
In
src/main/java/graphql/scalars/datetime/DateTimeScalar.java
, it's incorrectly using three digits of NANO_OF_SECOND in the DateTimeFormatter. If It's a three digit fraction of a second, it should instead be MILLI_OF_SECOND.Original:
Should be:
The text was updated successfully, but these errors were encountered: