...
If none of the three items are in the configuration, the “AI Insights” tab won’t be shown.
Editing an asset configuration
Date fields
By default, the date field for the expiration date comes with a text to add a year from today.
...
It is possible to configure this display of text.
Config path | Default value | Description |
---|
$edit.default.fields.names.dteendrights
| Code Block |
---|
{
"default": {
"helpers": [
{
"args": [1,"years"],
"method": "add"
}
]
}
} |
| Adds a number of days/weeks/months/year to the date. Properties: args : array of 2 elements (1 when using endOf method). the first element is a number and the second element is a string reprensenting the unit of time (days, weeks, months, years, ...).
Code Block |
---|
| # Example of uses
"args": [10,"days"],
# or
"args": [2,"weeks"],
# or
"args": [6,"months"],
# or
"args": [1,"years"], |
autoDisplayUnit : by default, the text displayed will be "humanized" to be user-readable-friendly. If you'd rather display the time reference in another unit of time, you can specify it here. If no time unit is specified, it will take it from the args property.
Code Block |
---|
| # Use case example
{
"default": {
"helpers": [
{
"autoDisplayUnit": "months",
"args": [6,"months"],
"method": "add"
},
{
"autoDisplayUnit": "months",
"args": [1,"years"],
"method": "add"
},
{
"autoDisplayUnit": "months",
"args": [2,"years"],
"method": "add"
}
]
}
} |
Without the autoDisplayUnit , this is what we would have: Image AddedBy adding the autoDisplayUnit , we can have a unified unit of time: Image AddedautoDisplayUnit is best if added to each helper. Here is an example of autoDisplayUnit set to “months” for the first 2 helpers (“6 months” and “1 year”) but not for the 3rd (“2 years”). Image Addedmethod : this is the "operation" you'd like to operate on the date. The possible values are add , subtract or endOf (1).
Image AddedImage AddedImage Added(1) the endOf method needs another property when in use: Code Block |
---|
"i18n": "duration.endofyear" |
This will change the text to “end of the year”. i18n : is a i18n key that will change the label/text displayed. Example:
Code Block |
---|
{
"args": [10,"years"],
"method": "add",
"i18n": "shared-board.fetching.title"
} |
Will have displayed : Image AddedOr, if we change the property to : Code Block |
---|
{
"args": [10,"years"],
"method": "add",
"i18n": "foo bar"
} | Image Added
|
| | |