aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--modern/src/common/formatter.js10
-rw-r--r--modern/src/reports/ReportFilter.js8
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 }) => {
<FormControl variant="filled" fullWidth>
<InputLabel>{t('reportDevice')}</InputLabel>
<Select value={deviceId} onChange={(e) => setDeviceId(e.target.value)}>
- {devices.map((device) => (
- <MenuItem value={device.id}>{device.name}</MenuItem>
- ))}
+ {devices
+ .sort((a, b) => a.name.localeCompare(b.name))
+ .map((device) => (
+ <MenuItem value={device.id}>{device.name}</MenuItem>
+ ))}
</Select>
</FormControl>
</Grid>