-
Notifications
You must be signed in to change notification settings - Fork 392
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
Conversation
…date-and-time-support
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"` |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
LGTM! only a minor non-blocking nitpick! |
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