Skip to content

Commit

Permalink
fix(tristar): closes #16
Browse files Browse the repository at this point in the history
  • Loading branch information
gbaranski committed Nov 6, 2022
1 parent cfd9f8a commit e6f6e59
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
11 changes: 10 additions & 1 deletion providers/tristar/gdansk/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package gdansk

import (
"log"
"time"
wheretopark "wheretopark/go"

geojson "github.com/paulmach/go.geojson"
Expand Down Expand Up @@ -59,8 +60,16 @@ func (p Provider) GetState() (map[wheretopark.ID]wheretopark.State, error) {
continue
}

location, err := time.LoadLocation("Europe/Warsaw")
if err != nil {
return nil, err
}
lastUpdate, err := time.Parse(time.RFC3339, vendorState.LastUpdate)
if err != nil {
return nil, err
}
state := wheretopark.State{
LastUpdated: vendor.LastUpdate,
LastUpdated: lastUpdate.In(location).Format(time.RFC3339),
AvailableSpots: map[string]uint{
"CAR": vendor.AvailableSpots,
},
Expand Down
5 changes: 5 additions & 0 deletions providers/tristar/gdynia/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,11 @@ func (p Provider) GetState() (map[wheretopark.ID]wheretopark.State, error) {
if err != nil {
return nil, err
}
location, err := time.LoadLocation("Europe/Warsaw")
if err != nil {
return nil, err
}
lastUpdate = lastUpdate.In(location)
state := wheretopark.State{
LastUpdated: lastUpdate.Format(time.RFC3339),
AvailableSpots: map[string]uint{
Expand Down

0 comments on commit e6f6e59

Please sign in to comment.