N°3629 - Activity panel: Add "activity_panel.datetimes_reformat_limit" config. param. to define the limit after which all dates / times should be displayed in absolute format

This commit is contained in:
Molkobain
2021-02-23 13:25:19 +01:00
parent 3d4e63416f
commit fa39846cc8
3 changed files with 10 additions and 1 deletions

View File

@@ -1213,6 +1213,14 @@ class Config
'source_of_value' => '',
'show_in_conf_sample' => false,
],
'activity_panel.datetimes_reformat_limit' => [
'type' => 'integer',
'description' => 'Limit (in days) for the dates / times to be displayed in a relative format (eg. "2 days ago") instead of in absolute format (eg. "2021-05-01 10:00"). After that limit, they will all be displayed in absolute format using the "date_and_time_format" parameter.',
'default' => 7,
'value' => 7,
'source_of_value' => '',
'show_in_conf_sample' => false,
],
'obsolescence.show_obsolete_data' => [
'type' => 'bool',
'description' => 'Default value for the user preference "show obsolete data"',

View File

@@ -25,7 +25,7 @@ $(function()
options:
{
datetime_format: null,
datetimes_reformat_limit: 14, // In days
datetimes_reformat_limit: 7, // In days
transaction_id: null, // Null until the user gets the lock on the object
lock_enabled: false, // Should only be true when object mode is set to "view" and the "concurrent_lock_enabled" config. param. enabled
lock_status: null,

View File

@@ -1,5 +1,6 @@
$('#{{ oUIBlock.GetId() }}').activity_panel({
datetime_format: {{ oUIBlock.GetDateTimeFormatForJSWidget()|json_encode|raw }},
datetimes_reformat_limit: {{ get_config_parameter('activity_panel.datetimes_reformat_limit') }},
{% if oUIBlock.HasTransactionId() %}transaction_id: {{ oUIBlock.GetTransactionId()|var_export }},{% endif %}
lock_enabled: {{ oUIBlock.IsLockEnabled()|var_export }},
lock_watcher_period: {{ get_config_parameter('activity_panel.lock_watcher_period') }},