Enhancement: locale option for date & relativeDate format (#2658)

This commit is contained in:
0phoff 2024-01-17 18:23:11 +01:00 committed by GitHub
parent 641eb25047
commit 7837864841
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 39 additions and 2 deletions

View file

@ -70,7 +70,20 @@ function formatValue(t, mapping, rawValue) {
value = t("common.bitrate", { value });
break;
case "date":
value = t("common.date", { value, 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,
});
break;
case "text":
default: