Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add RFC3339 timestamp #201

Merged
merged 1 commit into from
Apr 3, 2021
Merged

Conversation

omarismail
Copy link
Contributor

Background

Go has a time format called RFC3339.

RFC3339     = "2006-01-02T15:04:05Z07:00"

PR Description

This PR introduces the ability to add an annotation jsonapi:"attr,next,rfc3339" to a time.Time attribute, and it will parse the time according to the Go RFC3339 time format.

@google-cla
Copy link

google-cla bot commented Mar 22, 2021

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here with @googlebot I signed it! and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

ℹ️ Googlers: Go here for more info.

@omarismail
Copy link
Contributor Author

@googlebot I signed it!

@aren55555 aren55555 merged commit c0ee6d2 into google:master Apr 3, 2021
@quetzyg
Copy link
Contributor

quetzyg commented Apr 3, 2021

@aren55555 this PR was merged without the proper updates in the response code.

Mainly here, here and here.

aren55555 added a commit that referenced this pull request Apr 3, 2021
aren55555 added a commit that referenced this pull request Apr 3, 2021
@aren55555
Copy link
Contributor

@quetzyg yes I tried this last night and it appeared supplying the annotation resulted in the time still being serialized as a numeric value rather than a string. Reverted it.

@aren55555
Copy link
Contributor

I've corrected this in #204

omarismail pushed a commit to hashicorp/jsonapi that referenced this pull request Apr 13, 2021
omarismail added a commit to hashicorp/jsonapi that referenced this pull request Apr 13, 2021
* Revert "Add RFC3339 timestamp (google#201)" (google#203)

This reverts commit c0ee6d2.

* RFC 3339 support for both Marshal and Unmarshal. (google#204)

* RFC 3339 support for both Marshal and Unmarshal.

* Post merge cleanup

* Update request_test.go

Co-authored-by: Quetzy Garcia <quetzy.garcia@integrate.com>

* Update request.go

Co-authored-by: Quetzy Garcia <quetzy.garcia@integrate.com>

* Simplify the ISO 8601 logic. No need for the const rfc3339TimeFormat use time.RFC3339 directly.

Co-authored-by: Quetzy Garcia <quetzy.garcia@integrate.com>

* go mod init (google#205)

* parent 89dd8d2
author Omar Ismail <oismail91@gmail.com> 1618325394 -0400
committer Omar Ismail <oismail91@gmail.com> 1618326429 -0400
ctrombley pushed a commit to hashicorp/jsonapi that referenced this pull request Jan 12, 2024
@omarismail LGTM.

I'm curious what you think about perhaps documenting these `iso8601` and `rfc3339` in the `Readme.md`? How did you find that this tag option/value existed? How can we make this better for others vs having to search the library implementation?
ctrombley pushed a commit to hashicorp/jsonapi that referenced this pull request Jan 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants