fixed formatting with pre-commit
This commit is contained in:
parent
a8229f9716
commit
defdf5c4f0
@ -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]);
|
||||
|
||||
@ -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:
|
||||
|
||||
Loading…
Reference in New Issue
Block a user