Customize weather temperature display based on unit setting
This commit is contained in:
parent
951dde5334
commit
0931dfc5b1
@ -58,10 +58,14 @@
|
|||||||
/>
|
/>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
{{ Number(workoutObject.weatherStart.temperature).toFixed(1) }}°C
|
{{ useImperialUnits ?
|
||||||
|
convertCelsiusToFahrenheit(Number(workoutObject.weatherStart.temperature)).toFixed(1) + " °F" :
|
||||||
|
Number(workoutObject.weatherStart.temperature).toFixed(1) + " °C"}}
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
{{ Number(workoutObject.weatherEnd.temperature).toFixed(1) }}°C
|
{{ useImperialUnits ?
|
||||||
|
convertCelsiusToFahrenheit(Number(workoutObject.weatherEnd.temperature)).toFixed(1) + " °F" :
|
||||||
|
Number(workoutObject.weatherEnd.temperature).toFixed(1) + " °C"}}
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
@ -120,6 +124,10 @@
|
|||||||
const props = defineProps<Props>()
|
const props = defineProps<Props>()
|
||||||
|
|
||||||
const { useImperialUnits, workoutObject } = toRefs(props)
|
const { useImperialUnits, workoutObject } = toRefs(props)
|
||||||
|
|
||||||
|
function convertCelsiusToFahrenheit(celsius_temp: number): number {
|
||||||
|
return celsius_temp * 1.8 + 32
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
@ -94,8 +94,8 @@
|
|||||||
"SUCCESSFUL_UPDATE": "Dein Konto wurde erfolgreich aktualisiert.",
|
"SUCCESSFUL_UPDATE": "Dein Konto wurde erfolgreich aktualisiert.",
|
||||||
"UNITS": {
|
"UNITS": {
|
||||||
"LABEL": "Einheiten für die Distanz",
|
"LABEL": "Einheiten für die Distanz",
|
||||||
"IMPERIAL": "Imperiales System (ft, mi)",
|
"IMPERIAL": "Imperiales System (ft, mi, °F)",
|
||||||
"METRIC": "Metrisches System (m, km)"
|
"METRIC": "Metrisches System (m, km, °C)"
|
||||||
},
|
},
|
||||||
"TIMEZONE": "Zeitzone"
|
"TIMEZONE": "Zeitzone"
|
||||||
},
|
},
|
||||||
|
@ -94,8 +94,8 @@
|
|||||||
"SUCCESSFUL_UPDATE": "Your account has been updated successfully.",
|
"SUCCESSFUL_UPDATE": "Your account has been updated successfully.",
|
||||||
"UNITS": {
|
"UNITS": {
|
||||||
"LABEL": "Units for distance",
|
"LABEL": "Units for distance",
|
||||||
"IMPERIAL": "Imperial system (ft, mi)",
|
"IMPERIAL": "Imperial system (ft, mi, °F)",
|
||||||
"METRIC": "Metric system (m, km)"
|
"METRIC": "Metric system (m, km, °C)"
|
||||||
},
|
},
|
||||||
"TIMEZONE": "Timezone"
|
"TIMEZONE": "Timezone"
|
||||||
},
|
},
|
||||||
|
@ -82,8 +82,8 @@
|
|||||||
},
|
},
|
||||||
"UNITS": {
|
"UNITS": {
|
||||||
"LABEL": "Unités pour les distances",
|
"LABEL": "Unités pour les distances",
|
||||||
"IMPERIAL": "Système impérial (ft, mi)",
|
"IMPERIAL": "Système impérial (ft, mi, °F)",
|
||||||
"METRIC": "Système métrique (m, km)"
|
"METRIC": "Système métrique (m, km, °C)"
|
||||||
},
|
},
|
||||||
"SPORT": {
|
"SPORT": {
|
||||||
"ACTION": "action",
|
"ACTION": "action",
|
||||||
|
Loading…
Reference in New Issue
Block a user