Skip to content
This repository was archived by the owner on Oct 31, 2025. It is now read-only.

fix: keep nano second precision when maps between JSON and proto3#28

Merged
gcf-merge-on-green[bot] merged 4 commits intomainfrom
nano
Jan 14, 2022
Merged

fix: keep nano second precision when maps between JSON and proto3#28
gcf-merge-on-green[bot] merged 4 commits intomainfrom
nano

Conversation

@summer-ji-eng
Copy link
Contributor

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.

@summer-ji-eng summer-ji-eng requested a review from a team as a code owner January 14, 2022 01:31
Copy link
Contributor

@alexander-fenster alexander-fenster left a comment

Choose a reason for hiding this comment

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

Approved with some style / simplification suggestions, please feel free to merge after you resolve. Thank you!

@summer-ji-eng
Copy link
Contributor Author

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 padStart and padEnd. Thank you for reviewing my codes. 🙇‍♀️

@summer-ji-eng summer-ji-eng added the automerge Merge the pull request once unit tests and other checks pass. label Jan 14, 2022
@gcf-merge-on-green
Copy link

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.

@gcf-merge-on-green gcf-merge-on-green bot removed the automerge Merge the pull request once unit tests and other checks pass. label Jan 14, 2022
@generated-files-bot
Copy link

Warning: This pull request is touching the following templated files:

  • .github/workflows/ci.yaml - .github/workflows/ci.yaml (GitHub Actions) should be updated in synthtool

@summer-ji-eng summer-ji-eng added the automerge Merge the pull request once unit tests and other checks pass. label Jan 14, 2022
@alexander-fenster alexander-fenster added the kokoro:run Add this label to force Kokoro to re-run the tests. label Jan 14, 2022
@yoshi-kokoro yoshi-kokoro removed the kokoro:run Add this label to force Kokoro to re-run the tests. label Jan 14, 2022
@gcf-merge-on-green gcf-merge-on-green bot merged commit eaa01ce into main Jan 14, 2022
@gcf-merge-on-green gcf-merge-on-green bot deleted the nano branch January 14, 2022 17:30
@gcf-merge-on-green gcf-merge-on-green bot removed the automerge Merge the pull request once unit tests and other checks pass. label Jan 14, 2022
gcf-merge-on-green bot pushed a commit that referenced this pull request Jan 14, 2022
🤖 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).
miguelvelezsa pushed a commit to googleapis/google-cloud-node-core that referenced this pull request Oct 1, 2025
🤖 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).
miguelvelezsa pushed a commit to googleapis/google-cloud-node-core that referenced this pull request Oct 9, 2025
🤖 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).
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants