From defdf5c4f0bb4eec208d12b800bf3caa897eb92d Mon Sep 17 00:00:00 2001 From: 0phoff <0phoff@users.noreply.github.com> Date: Wed, 17 Jan 2024 14:01:52 +0100 Subject: [PATCH] fixed formatting with pre-commit --- next-i18next.config.js | 2 +- src/widgets/customapi/component.jsx | 14 ++++++++++++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/next-i18next.config.js b/next-i18next.config.js index 631edc7f..96483cc3 100644 --- a/next-i18next.config.js +++ b/next-i18next.config.js @@ -105,7 +105,7 @@ function relativeDate(date, formatter) { const units = ["second", "minute", "hour", "day", "week", "month", "year"]; const delta = Math.round((date.getTime() - Date.now()) / 1000); - const unitIndex = cutoffs.findIndex(cutoff => cutoff > Math.abs(delta)); + const unitIndex = cutoffs.findIndex((cutoff) => cutoff > Math.abs(delta)); const divisor = unitIndex ? cutoffs[unitIndex - 1] : 1; return formatter.format(Math.floor(delta / divisor), units[unitIndex]); diff --git a/src/widgets/customapi/component.jsx b/src/widgets/customapi/component.jsx index b0166523..7e6ad4d7 100644 --- a/src/widgets/customapi/component.jsx +++ b/src/widgets/customapi/component.jsx @@ -70,10 +70,20 @@ function formatValue(t, mapping, rawValue) { value = t("common.bitrate", { value }); break; case "date": - value = t("common.date", { value, lng: mapping?.locale, dateStyle: mapping?.dateStyle ?? "long", timeStyle: mapping?.timeStyle }); + value = t("common.date", { + value, + lng: mapping?.locale, + dateStyle: mapping?.dateStyle ?? "long", + timeStyle: mapping?.timeStyle, + }); break; case "relativeDate": - value = t("common.relativeDate", { value, lng: mapping?.locale, style: mapping?.style, numeric: mapping?.numeric }); + value = t("common.relativeDate", { + value, + lng: mapping?.locale, + style: mapping?.style, + numeric: mapping?.numeric, + }); break; case "text": default: