aboutsummaryrefslogtreecommitdiff
path: root/web/views.go
diff options
context:
space:
mode:
Diffstat (limited to 'web/views.go')
-rw-r--r--web/views.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/web/views.go b/web/views.go
index 8df860c..b3cab8b 100644
--- a/web/views.go
+++ b/web/views.go
@@ -38,6 +38,9 @@ type AnalyticsPoint struct {
SpeedKmh float64 `json:"speedKmh"`
CotacolPer100Km float64 `json:"cotacolPer100Km"`
MovingHours float64 `json:"movingHours"`
+ RideType string `json:"rideType"`
+ BikeType string `json:"bikeType"`
+ Year int `json:"year"`
}
func buildAnalyticsPoints(items []ride.StoredRide) []AnalyticsPoint {
@@ -54,6 +57,9 @@ func buildAnalyticsPoints(items []ride.StoredRide) []AnalyticsPoint {
SpeedKmh: item.AverageSpeedMps * 3.6,
CotacolPer100Km: cotacol * 100 / (item.DistanceM / 1000),
MovingHours: float64(item.EffectiveMovingTimeS()) / 3600,
+ RideType: string(item.RideType),
+ BikeType: string(item.BikeType),
+ Year: item.StartDate.Year(),
})
}
return points