aboutsummaryrefslogtreecommitdiff
path: root/modern/src/common/util/formatter.js
diff options
context:
space:
mode:
Diffstat (limited to 'modern/src/common/util/formatter.js')
-rw-r--r--modern/src/common/util/formatter.js6
1 files changed, 6 insertions, 0 deletions
diff --git a/modern/src/common/util/formatter.js b/modern/src/common/util/formatter.js
index f36b4d38..47bd2cd0 100644
--- a/modern/src/common/util/formatter.js
+++ b/modern/src/common/util/formatter.js
@@ -41,6 +41,12 @@ export const formatVolume = (value, unit, t) => `${volumeFromLiters(value, unit)
export const formatHours = (value) => moment.duration(value).humanize();
+export const formatNumericHours = (value, t) => {
+ const hours = Math.floor(value / 3600000);
+ const minutes = Math.floor((value % 3600000) / 60000);
+ return `${hours} ${t('sharedHourAbbreviation')} ${minutes} ${t('sharedMinuteAbbreviation')}`;
+};
+
export const formatCoordinate = (key, value, unit) => {
let hemisphere;
let degrees;