We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent da84fd7 commit bcd9feaCopy full SHA for bcd9fea
1 file changed
date.go
@@ -5,14 +5,14 @@ import (
5
"time"
6
)
7
8
-const dateFormat = "2006-01-02"
+const DateFormat = "2006-01-02"
9
10
type Date struct {
11
time.Time
12
}
13
14
func (d Date) MarshalJSON() ([]byte, error) {
15
- return json.Marshal(d.Time.Format(dateFormat))
+ return json.Marshal(d.Time.Format(DateFormat))
16
17
18
func (d *Date) UnmarshalJSON(data []byte) error {
@@ -21,7 +21,7 @@ func (d *Date) UnmarshalJSON(data []byte) error {
21
if err != nil {
22
return err
23
24
- parsed, err := time.Parse(dateFormat, dateStr)
+ parsed, err := time.Parse(DateFormat, dateStr)
25
26
27
0 commit comments