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

Xsd date and time support #195

Merged
merged 8 commits into from
Feb 28, 2021
Merged

Xsd date and time support #195

merged 8 commits into from
Feb 28, 2021

Conversation

moihn
Copy link

@moihn moihn commented Feb 26, 2021

I have added support to xsd:date, xsd:datetime, and xsd:time by referencing the code at https://github.com/NYTimes/encoding-wrapper/blob/master/elementalconductor/time.go

But it actually isn't quite fully covering the various string literals of these types as described at:
xsd:time => http://books.xmlschemata.org/relaxng/ch19-77311.html
xsd:date => http://books.xmlschemata.org/relaxng/ch19-77041.html
xsd:datetime => http://books.xmlschemata.org/relaxng/ch19-77049.html

So I used similar idea to develop a better implementation of XsdDate, XsdDateTime and XsdTime.

Please let me know if you have any comments.

The code has been tested against our product and SOAP service, and "go test" can have a PASS.

Thanks and regards

@c4milo
Copy link
Member

c4milo commented Feb 26, 2021

Awesome, I will take a look at this PR during the weekend. Thank you!

@@ -33,7 +33,7 @@ type Document struct {
// The date the message was created. Used for auditing and logging.
//

CreationDate time.Time `xml:"creationDate,attr,omitempty" json:"creationDate,omitempty"`
CreationDate soap.XsdDateTime `xml:"creationDate,attr,omitempty" json:"creationDate,omitempty"`
Copy link
Member

Choose a reason for hiding this comment

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

In Go, the naming convention will be XSDDateTime

Copy link
Author

Choose a reason for hiding this comment

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

Please find the PR for fixing it here: #196

@c4milo
Copy link
Member

c4milo commented Feb 28, 2021

LGTM! only a minor non-blocking nitpick!

@c4milo c4milo merged commit dac628d into hooklift:master Feb 28, 2021
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.

2 participants