diff --git a/mpwo_api/mpwo_api/activities/models.py b/mpwo_api/mpwo_api/activities/models.py index 247d359c..9b9c0234 100644 --- a/mpwo_api/mpwo_api/activities/models.py +++ b/mpwo_api/mpwo_api/activities/models.py @@ -67,11 +67,9 @@ class Activity(db.Model): "creation_date": self.creation_date, "modification_date": self.modification_date, "activity_date": self.activity_date, - "duration": (self.duration.total_seconds() - if self.duration - else None), - "pauses": self.pauses.total_seconds() if self.pauses else None, - "moving": self.moving.total_seconds() if self.moving else None, + "duration": str(self.duration) if self.duration else None, + "pauses": str(self.pauses) if self.pauses else None, + "moving": str(self.moving) if self.moving else None, "distance": float(self.distance) if self.distance else None, "min_alt": float(self.min_alt) if self.min_alt else None, "max_alt": float(self.max_alt) if self.max_alt else None, diff --git a/mpwo_client/src/components/Activities/ActivityDisplay.jsx b/mpwo_client/src/components/Activities/ActivityDisplay.jsx index e8dc565c..0e64aeda 100644 --- a/mpwo_client/src/components/Activities/ActivityDisplay.jsx +++ b/mpwo_client/src/components/Activities/ActivityDisplay.jsx @@ -27,7 +27,7 @@ class ActivityDisplay extends React.Component {
- {' '} - Start at {activity.activity_date} -
-- {' '} - Duration: {activity.duration} {' '} - {activity.pauses > 0 && ( - `(pauses: ${activity.pauses})` - )} -
-- {' '} - Distance: {activity.distance}km
-- - {' '} - Average speed: {activity.ave_speed} km/h -{' '} - Max speed : {activity.max_speed} km/h -
-{' '} - Min altitude: {activity.min_alt}m -{' '} - Max altitude: {activity.max_alt}m -
-{' '} - Ascent: {activity.ascent}m -{' '} - Descent: {activity.descent}m -
-+ {' '} + Start at {activity.activity_date} +
++ {' '} + Duration: {activity.duration} {' '} + {activity.pauses !== '0:00:00' && ( + `(pauses: ${activity.pauses})` + )} +
++ {' '} + Distance: {activity.distance} km
++ + {' '} + Average speed: {activity.ave_speed} km/h -{' '} + Max speed : {activity.max_speed} km/h +
+{' '} + Min altitude: {activity.min_alt}m -{' '} + Max altitude: {activity.max_alt}m +
+{' '} + Ascent: {activity.ascent}m -{' '} + Descent: {activity.descent}m +
+