diff --git a/pandora_console/include/functions_html.php b/pandora_console/include/functions_html.php
index f0368cf79e..0dd7808092 100644
--- a/pandora_console/include/functions_html.php
+++ b/pandora_console/include/functions_html.php
@@ -7318,6 +7318,7 @@ function html_print_select_date_range(
$fields[SECONDS_1MONTH] = __('Last 30 days');
$fields['custom'] = __('Custom');
$fields['chose_range'] = __('Chose start/end date period');
+ $fields['none'] = __('None');
$output = html_print_input_hidden('custom_date', $custom_date, true);
$output .= '
';
diff --git a/pandora_console/operation/reporting/reporting_viewer.php b/pandora_console/operation/reporting/reporting_viewer.php
index e3e07590ba..cc42d7e6ac 100755
--- a/pandora_console/operation/reporting/reporting_viewer.php
+++ b/pandora_console/operation/reporting/reporting_viewer.php
@@ -58,7 +58,7 @@ $datetime_end = strtotime($date_end.' '.$time_end);
// Calculate new inteval for all reports.
$custom_date = get_parameter('custom_date', 0);
-$date = get_parameter('date', SECONDS_1DAY);
+$date = get_parameter('date', 'none');
$date_text = get_parameter('date_text', SECONDS_1DAY);
$custom_date_end = '';
@@ -111,6 +111,9 @@ if ($custom_date === '1') {
$first_of_week = date('Y-m-d', strtotime('monday', strtotime('last week')));
$period = (strtotime($date_end) - strtotime($first_of_week));
}
+} else if ($date === 'none') {
+ // Prioritize the report item period based on the current local date/time.
+ $date_end = date('Y/m/d H:i:s');
} else {
$date_end = date('Y/m/d H:i:s');
$date_start = date('Y/m/d H:i:s', (strtotime($date_end) - $date));
@@ -315,12 +318,12 @@ if ($html_menu_export === ENTERPRISE_NOT_HOOK) {
if ((bool) is_metaconsole() === true) {
$table2->data[0][2] = html_print_label_input_block(
__('Date').' ',
- html_print_select_date_range('date', true, get_parameter('date', SECONDS_1DAY), $date_init, $time_init, date('Y/m/d'), date('H:i:s'), $date_text),
+ html_print_select_date_range('date', true, get_parameter('date', 'none'), $date_init, $time_init, date('Y/m/d'), date('H:i:s'), $date_text),
);
} else {
$table2->data[0][2] = html_print_label_input_block(
__('Date').' ',
- html_print_select_date_range('date', true, get_parameter('date', SECONDS_1DAY), $date_init, $time_init, date('Y/m/d'), date('H:i:s'), $date_text),
+ html_print_select_date_range('date', true, get_parameter('date', 'none'), $date_init, $time_init, date('Y/m/d'), date('H:i:s'), $date_text),
['label_class' => 'filter_label_position_before']
);
}
@@ -451,7 +454,6 @@ $(document).ready (function () {
$("#string_to").show();
$('#string_from').show();
$("#string_items").hide();
- console.log($(".filter_label_position_before").html());
} else {
$("#string_to").hide();
$('#string_from').hide();