diff --git a/core/config.class.inc.php b/core/config.class.inc.php index 430146982..0d4ec2358 100644 --- a/core/config.class.inc.php +++ b/core/config.class.inc.php @@ -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"', diff --git a/js/layouts/activity-panel/activity-panel.js b/js/layouts/activity-panel/activity-panel.js index ccf25ead3..664005ad1 100644 --- a/js/layouts/activity-panel/activity-panel.js +++ b/js/layouts/activity-panel/activity-panel.js @@ -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, diff --git a/templates/base/layouts/activity-panel/layout.js.twig b/templates/base/layouts/activity-panel/layout.js.twig index 0355c151f..a54c0ab4e 100644 --- a/templates/base/layouts/activity-panel/layout.js.twig +++ b/templates/base/layouts/activity-panel/layout.js.twig @@ -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') }},