diff --git a/fittrackee_client/src/components/Common/Distance.vue b/fittrackee_client/src/components/Common/Distance.vue new file mode 100644 index 00000000..54e50e48 --- /dev/null +++ b/fittrackee_client/src/components/Common/Distance.vue @@ -0,0 +1,55 @@ + + + + + diff --git a/fittrackee_client/src/components/Dashboard/Timeline.vue b/fittrackee_client/src/components/Dashboard/Timeline.vue index dab4b582..1109c80e 100644 --- a/fittrackee_client/src/components/Dashboard/Timeline.vue +++ b/fittrackee_client/src/components/Dashboard/Timeline.vue @@ -5,6 +5,7 @@ @@ -18,6 +19,7 @@ : null " :user="user" + :useImperialUnits="user.imperial_units" :key="workout.id" /> diff --git a/fittrackee_client/src/components/Dashboard/UserRecords/index.vue b/fittrackee_client/src/components/Dashboard/UserRecords/index.vue index f8bee650..015dc312 100644 --- a/fittrackee_client/src/components/Dashboard/UserRecords/index.vue +++ b/fittrackee_client/src/components/Dashboard/UserRecords/index.vue @@ -13,6 +13,7 @@ :sportTranslatedLabel="sportTranslatedLabel" :records="recordsBySport[sportTranslatedLabel]" :key="sportTranslatedLabel" + :useImperialUnits="user.imperial_units" /> @@ -40,7 +41,8 @@ getRecordsBySports( props.user.records, translateSports(props.sports, t), - props.user.timezone + props.user.timezone, + props.user.imperial_units ) ) diff --git a/fittrackee_client/src/components/Dashboard/UserStatsCards/index.vue b/fittrackee_client/src/components/Dashboard/UserStatsCards/index.vue index c655223a..6fabf6cc 100644 --- a/fittrackee_client/src/components/Dashboard/UserStatsCards/index.vue +++ b/fittrackee_client/src/components/Dashboard/UserStatsCards/index.vue @@ -5,11 +5,7 @@ :value="user.nb_workouts" :text="$t('workouts.WORKOUT', user.nb_workouts)" /> - + props.user.total_duration ) const totalDuration = computed(() => get_duration(userTotalDuration)) + const defaultUnitFrom: TUnit = 'km' + const unitTo: TUnit = user.value.imperial_units + ? units[defaultUnitFrom].defaultTarget + : defaultUnitFrom + const totalDistance = user.value.imperial_units + ? convertDistance(user.value.total_distance, defaultUnitFrom, unitTo, 2) + : user.value.total_distance function get_duration(total_duration: ComputedRef) { const duration = total_duration.value.match(/day/g) diff --git a/fittrackee_client/src/components/Workout/WorkoutCard.vue b/fittrackee_client/src/components/Workout/WorkoutCard.vue index 628349bd..2bb0bafe 100644 --- a/fittrackee_client/src/components/Workout/WorkoutCard.vue +++ b/fittrackee_client/src/components/Workout/WorkoutCard.vue @@ -87,7 +87,13 @@