fix: keep nano second precision when maps between JSON and proto3#28
fix: keep nano second precision when maps between JSON and proto3#28gcf-merge-on-green[bot] merged 4 commits intomainfrom
Conversation
alexander-fenster
left a comment
There was a problem hiding this comment.
Approved with some style / simplification suggestions, please feel free to merge after you resolve. Thank you!
Addressed all the comments. It's good to know the method |
|
Merge-on-green attempted to merge your PR for 6 hours, but it was not mergeable because either one of your required status checks failed, one of your required reviews was not approved, or there is a do not merge label. Learn more about your required status checks here: https://help.github.com/en/github/administering-a-repository/enabling-required-status-checks. You can remove and reapply the label to re-run the bot. |
|
Warning: This pull request is touching the following templated files:
|
🤖 I have created a release *beep* *boop* --- ### [0.1.7](v0.1.6...v0.1.7) (2022-01-14) ### Bug Fixes * keep nano second precision when maps between JSON and proto3 ([#28](#28)) ([eaa01ce](eaa01ce)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
🤖 I have created a release *beep* *boop* --- ### [0.1.7](googleapis/proto3-json-serializer-nodejs@v0.1.6...v0.1.7) (2022-01-14) ### Bug Fixes * keep nano second precision when maps between JSON and proto3 ([#28](googleapis/proto3-json-serializer-nodejs#28)) ([eaa01ce](googleapis/proto3-json-serializer-nodejs@eaa01ce)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
🤖 I have created a release *beep* *boop* --- ### [0.1.7](googleapis/proto3-json-serializer-nodejs@v0.1.6...v0.1.7) (2022-01-14) ### Bug Fixes * keep nano second precision when maps between JSON and proto3 ([#28](googleapis/proto3-json-serializer-nodejs#28)) ([eaa01ce](googleapis/proto3-json-serializer-nodejs@eaa01ce)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
The fractional seconds in the JSON timestamps can go up to 9 digits (i.e. up to 1 nanosecond resolution). timestamps.proto
However, Javascript Date object represent any date and time to millisecond precision.
To keep the precision, we extract the fractional seconds and append 0 until the length is equal to 9.