Added "locale" option to the date format of the customapi

This commit is contained in:
0phoff 2024-01-17 13:34:19 +01:00
parent 1f905bc241
commit 80c5761af4
2 changed files with 2 additions and 1 deletions

View File

@ -34,6 +34,7 @@ widget:
- field: key # needs to be YAML string or object
label: Field 4
format: date # optional - defaults to text
locale: nl # optional
dateStyle: long # optional - defaults to "long". Allowed values: `["full", "long", "medium", "short"]`.
timeStyle: medium # optional - Allowed values: `["full", "long", "medium", "short"]`.
```

View File

@ -70,7 +70,7 @@ 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 "text":
default: