Skip to content

Commit

Permalink
allow more date time format
Browse files Browse the repository at this point in the history
  • Loading branch information
hgiasac committed Nov 7, 2024
1 parent ec59a3b commit 0dbd55c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion utils/decode.go
Original file line number Diff line number Diff line change
Expand Up @@ -1086,7 +1086,7 @@ func DecodeDateTime(value any, options ...DecodeTimeOption) (time.Time, error) {

// parse date time with fallback ISO8601 formats.
func parseDateTime(value string) (time.Time, error) {
for _, format := range []string{time.RFC3339, "2006-01-02T15:04:05", "2006-01-02T15:04:05Z0700", "2006-01-02T15:04:05-0700", time.RFC3339Nano, time.DateOnly} {
for _, format := range []string{time.RFC3339, "2006-01-02T15:04:05Z0700", "2006-01-02T15:04:05-0700", time.RFC3339Nano, "2006-01-02T15:04:05", "2006-01-02 15:04:05", time.DateOnly} {
result, err := time.Parse(format, value)
if err != nil {
continue
Expand Down

0 comments on commit 0dbd55c

Please sign in to comment.