Skip to content

Commit bcd9fea

Browse files
jmcnevinMarcin Romaszewicz
authored andcommitted
fixing query parsing of date parameters (#112)
1 parent da84fd7 commit bcd9fea

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

date.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@ import (
55
"time"
66
)
77

8-
const dateFormat = "2006-01-02"
8+
const DateFormat = "2006-01-02"
99

1010
type Date struct {
1111
time.Time
1212
}
1313

1414
func (d Date) MarshalJSON() ([]byte, error) {
15-
return json.Marshal(d.Time.Format(dateFormat))
15+
return json.Marshal(d.Time.Format(DateFormat))
1616
}
1717

1818
func (d *Date) UnmarshalJSON(data []byte) error {
@@ -21,7 +21,7 @@ func (d *Date) UnmarshalJSON(data []byte) error {
2121
if err != nil {
2222
return err
2323
}
24-
parsed, err := time.Parse(dateFormat, dateStr)
24+
parsed, err := time.Parse(DateFormat, dateStr)
2525
if err != nil {
2626
return err
2727
}

0 commit comments

Comments
 (0)