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

Export DateTimeFormats variable used by ParseDateTime() #71

Merged
merged 1 commit into from
Nov 15, 2020

Conversation

padamstx
Copy link
Contributor

Closes #70

This commit exports the DateTimeFormats variable so that users
can modify the set of formats used by ParseDateTime, as in this
example:
strfmt.DateTimeFormats = append(strfmt.DateTimeFormats, "2006-01-02T15:04Z0700")

Signed-off-by: Phil Adams [email protected]

Closes go-openapi#70

This commit exports the DateTimeFormats variable so that users
can modify the set of formats used by ParseDateTime, as in this
example:
    strfmt.DateTimeFormats = append(strfmt.DateTimeFormats, "2006-01-02T15:04Z0700")

Signed-off-by: Phil Adams <[email protected]>
@@ -55,25 +55,26 @@ func IsDateTime(str string) bool {
const (
// RFC3339Millis represents a ISO8601 format to millis instead of to nanos
RFC3339Millis = "2006-01-02T15:04:05.000Z07:00"
// RFC3339Millis represents a ISO8601 format to millis instead of to nanos
// RFC3339MillisNoColon represents a ISO8601 format to millis instead of to nanos
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I fixed a few comments to get rid of linter warnings in my IDE :)

@codecov
Copy link

codecov bot commented Nov 15, 2020

Codecov Report

Merging #71 (3eb4966) into master (3236244) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master      #71   +/-   ##
=======================================
  Coverage   81.63%   81.63%           
=======================================
  Files          10       10           
  Lines        1285     1285           
=======================================
  Hits         1049     1049           
  Misses        164      164           
  Partials       72       72           
Impacted Files Coverage Δ
time.go 95.18% <ø> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3236244...3eb4966. Read the comment docs.

@casualjim casualjim merged commit 1dcc23b into go-openapi:master Nov 15, 2020
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.

Any way to specify additional formats to use when unmarshalling strfmt.DateTime values?
2 participants