Api: assume local timezone if omitted (#16835)
This commit is contained in:
parent
69de8a7e69
commit
ba7b006a70
2 changed files with 3 additions and 3 deletions
|
|
@ -74,7 +74,7 @@ func planPreviewHandler(lp loadpoint.API) http.HandlerFunc {
|
|||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
vars := mux.Vars(r)
|
||||
|
||||
planTime, err := time.Parse(time.RFC3339, vars["time"])
|
||||
planTime, err := time.ParseInLocation(time.RFC3339, vars["time"], nil)
|
||||
if err != nil {
|
||||
jsonError(w, http.StatusBadRequest, err)
|
||||
return
|
||||
|
|
@ -131,7 +131,7 @@ func planEnergyHandler(lp loadpoint.API) http.HandlerFunc {
|
|||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
vars := mux.Vars(r)
|
||||
|
||||
ts, err := time.Parse(time.RFC3339, vars["time"])
|
||||
ts, err := time.ParseInLocation(time.RFC3339, vars["time"], nil)
|
||||
if err != nil {
|
||||
jsonError(w, http.StatusBadRequest, err)
|
||||
return
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue