From 8a3dce0e58ae7a7daf1e3bf3e0e777548dfa110a Mon Sep 17 00:00:00 2001 From: Iván Ávalos Date: Mon, 13 Dec 2021 22:57:13 -0600 Subject: Workaround for kilometer processing and devices sorted on reports selector --- modern/src/common/formatter.js | 10 +--------- modern/src/reports/ReportFilter.js | 8 +++++--- 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/modern/src/common/formatter.js b/modern/src/common/formatter.js index 22d1654..db0b7ff 100644 --- a/modern/src/common/formatter.js +++ b/modern/src/common/formatter.js @@ -47,15 +47,7 @@ export const formatDistance = (value, unit, t) => { }; export const formatSpeed = (value, unit, t) => { - switch (unit) { - case 'kmh': - return `${(value * 1.852).toFixed(0)} ${t('sharedKmh')}`; - case 'mph': - return `${(value * 1.15078).toFixed(0)} ${t('sharedMph')}`; - case 'kn': - default: - return `${(value * 1).toFixed(0)} ${t('sharedKn')}`; - } + return `${(value * 1).toFixed(0)} ${t('sharedKmh')}`; }; export const formatVolume = (value, unit, t) => { diff --git a/modern/src/reports/ReportFilter.js b/modern/src/reports/ReportFilter.js index 23c7fc0..1f3a3f0 100644 --- a/modern/src/reports/ReportFilter.js +++ b/modern/src/reports/ReportFilter.js @@ -65,9 +65,11 @@ const ReportFilter = ({ children, handleSubmit, showOnly }) => { {t('reportDevice')} -- cgit v1.2.3