Feature: Added timeStyle to date format for custom API (#2294)
* Add timeStyle option to custom API date format * Update documentation
This commit is contained in:
parent
dc8bea95ac
commit
fc67e1a986
2 changed files with 2 additions and 1 deletions
|
@ -35,6 +35,7 @@ widget:
|
||||||
label: Field 4
|
label: Field 4
|
||||||
format: date # optional - defaults to text
|
format: date # optional - defaults to text
|
||||||
dateStyle: long # optional - defaults to "long". Allowed values: `["full", "long", "medium", "short"]`.
|
dateStyle: long # optional - defaults to "long". Allowed values: `["full", "long", "medium", "short"]`.
|
||||||
|
timeStyle: medium # optional - Allowed values: `["full", "long", "medium", "short"]`.
|
||||||
```
|
```
|
||||||
|
|
||||||
Supported formats for the values are `text`, `number`, `float`, `percent`, `bytes`, `bitrate` and `date`.
|
Supported formats for the values are `text`, `number`, `float`, `percent`, `bytes`, `bitrate` and `date`.
|
||||||
|
|
|
@ -70,7 +70,7 @@ function formatValue(t, mapping, rawValue) {
|
||||||
value = t("common.bitrate", { value });
|
value = t("common.bitrate", { value });
|
||||||
break;
|
break;
|
||||||
case "date":
|
case "date":
|
||||||
value = t("common.date", { value, dateStyle: mapping?.dateStyle ?? "long" });
|
value = t("common.date", { value, dateStyle: mapping?.dateStyle ?? "long", timeStyle: mapping?.timeStyle });
|
||||||
break;
|
break;
|
||||||
case "text":
|
case "text":
|
||||||
default:
|
default:
|
||||||
|
|
Loading…
Add table
Reference in a new issue