From 8038f22dc100d09ff53808d4d372567a262c24ff Mon Sep 17 00:00:00 2001 From: Iván Ávalos Date: Sat, 11 Dec 2021 16:38:03 -0600 Subject: A lot of changes! --- modern/src/common/formatter.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'modern/src/common/formatter.js') diff --git a/modern/src/common/formatter.js b/modern/src/common/formatter.js index 0ff4e74..22d1654 100644 --- a/modern/src/common/formatter.js +++ b/modern/src/common/formatter.js @@ -49,12 +49,12 @@ export const formatDistance = (value, unit, t) => { export const formatSpeed = (value, unit, t) => { switch (unit) { case 'kmh': - return `${(value * 1.852).toFixed(2)} ${t('sharedKmh')}`; + return `${(value * 1.852).toFixed(0)} ${t('sharedKmh')}`; case 'mph': - return `${(value * 1.15078).toFixed(2)} ${t('sharedMph')}`; + return `${(value * 1.15078).toFixed(0)} ${t('sharedMph')}`; case 'kn': default: - return `${(value * 1).toFixed(2)} ${t('sharedKn')}`; + return `${(value * 1).toFixed(0)} ${t('sharedKn')}`; } }; @@ -70,7 +70,10 @@ export const formatVolume = (value, unit, t) => { } }; -export const formatHours = (value) => moment.duration(value).humanize(); +export const formatHours = (value, t) => { + moment.locale('es'); + return `${moment.duration(value).asHours().toFixed(0)} ${t('sharedHours')}`; +} export const formatCoordinate = (key, value, unit) => { let hemisphere; -- cgit v1.2.3