1
0
mirror of https://github.com/muety/wakapi.git synced 2023-08-10 21:12:56 +03:00

fix: permit simple date time format in wakatime summaries endpoint (resolve #190)

This commit is contained in:
Ferdinand Mütsch 2021-04-28 22:19:44 +02:00
parent 5d8fc99b93
commit 2b45b064eb
2 changed files with 3 additions and 3 deletions

View File

@ -99,12 +99,12 @@ func (h *SummariesHandler) loadUserSummaries(r *http.Request) ([]*models.Summary
// eventually, consider start and end params a date // eventually, consider start and end params a date
var err error var err error
start, err = time.Parse(time.RFC3339, strings.Replace(startParam, " ", "+", 1)) start, err = utils.ParseDateTimeTZ(strings.Replace(startParam, " ", "+", 1), user.TZ())
if err != nil { if err != nil {
return nil, errors.New("missing required 'start' parameter"), http.StatusBadRequest return nil, errors.New("missing required 'start' parameter"), http.StatusBadRequest
} }
end, err = time.Parse(time.RFC3339, strings.Replace(endParam, " ", "+", 1)) end, err = utils.ParseDateTimeTZ(strings.Replace(endParam, " ", "+", 1), user.TZ())
if err != nil { if err != nil {
return nil, errors.New("missing required 'end' parameter"), http.StatusBadRequest return nil, errors.New("missing required 'end' parameter"), http.StatusBadRequest
} }

View File

@ -1 +1 @@
1.26.7 1.26.8