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:
parent
5d8fc99b93
commit
2b45b064eb
@ -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
|
||||||
}
|
}
|
||||||
|
@ -1 +1 @@
|
|||||||
1.26.7
|
1.26.8
|
||||||
|
Loading…
Reference in New Issue
Block a user