From 6c075090d4efb77aa5fff22180b89c2487d241bc Mon Sep 17 00:00:00 2001 From: kshvakov Date: Thu, 25 Aug 2016 10:47:06 +0300 Subject: [PATCH 1/2] fix: Invalid date: XXX; please use ISO8601 format: YYYY-MM-DD --- stats.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/stats.go b/stats.go index fd7d4ce..d715d5c 100644 --- a/stats.go +++ b/stats.go @@ -5,6 +5,8 @@ import ( "time" ) +const statTimeLayout = "2006-01-02" + type Stat struct { Event string `json:"event"` TotalCount int `json:"total_count"` @@ -32,7 +34,7 @@ func (m *MailgunImpl) GetStats(limit int, skip int, startDate *time.Time, event } if startDate != nil { - r.addParameter("start-date", startDate.Format(time.RFC3339)) + r.addParameter("start-date", startDate.Format(statTimeLayout)) } for _, e := range event { From a043ade57a5b45e05130a99049cb8fa9964291d8 Mon Sep 17 00:00:00 2001 From: Michael Banzon Date: Thu, 25 Aug 2016 16:41:50 +0200 Subject: [PATCH 2/2] Changed format name. Fixes #65 --- stats.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stats.go b/stats.go index d715d5c..4313eb9 100644 --- a/stats.go +++ b/stats.go @@ -5,7 +5,7 @@ import ( "time" ) -const statTimeLayout = "2006-01-02" +const iso8601date = "2006-01-02" type Stat struct { Event string `json:"event"` @@ -34,7 +34,7 @@ func (m *MailgunImpl) GetStats(limit int, skip int, startDate *time.Time, event } if startDate != nil { - r.addParameter("start-date", startDate.Format(statTimeLayout)) + r.addParameter("start-date", startDate.Format(iso8601date)) } for _, e := range event {