From 9e860f253f4a9b89ad674d9257b2a81e02a59a57 Mon Sep 17 00:00:00 2001 From: Daniel Cebrian Date: Tue, 30 Apr 2024 11:21:42 +0200 Subject: [PATCH] #13573 fixed date select --- pandora_console/include/functions_html.php | 3 ++- pandora_console/operation/inventory/inventory.php | 11 +++++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/pandora_console/include/functions_html.php b/pandora_console/include/functions_html.php index 6de4467d83..a1ecf8d219 100644 --- a/pandora_console/include/functions_html.php +++ b/pandora_console/include/functions_html.php @@ -7942,6 +7942,7 @@ function html_print_select_date_range( $date_format_js='yy/mm/dd', $time_format_js='HH:mm:ss', $id='', + $units_selected='1', ) { global $config; @@ -8136,7 +8137,7 @@ function html_print_select_date_range( $output .= html_print_select( $units, $name.'_units', - '1', + $units_selected, '', '', 0, diff --git a/pandora_console/operation/inventory/inventory.php b/pandora_console/operation/inventory/inventory.php index bb4236da25..b3c83699a7 100755 --- a/pandora_console/operation/inventory/inventory.php +++ b/pandora_console/operation/inventory/inventory.php @@ -46,6 +46,7 @@ $date_init_less = (strtotime(date('Y/m/d')) - SECONDS_1DAY); $date_init = get_parameter('date_init', date(DATE_FORMAT, $date_init_less)); $time_init = get_parameter('time_init', date(TIME_FORMAT, $date_init_less)); $datetime_init = strtotime($date_init.' '.$time_init); +$date_units = get_parameter('utimestamp_units'); if ($custom_date === '1') { if ($datetime_init >= $datetime_end) { $datetime_init = $date_init_less; @@ -55,7 +56,6 @@ if ($custom_date === '1') { $date_end = date('Y/m/d H:i:s', $datetime_end); $period = ($datetime_end - $datetime_init); } else if ($custom_date === '2') { - $date_units = get_parameter('utimestamp_units'); $date_end = date('Y/m/d H:i:s'); $date_init = date('Y/m/d H:i:s', (strtotime($date_end) - ((int) $date_text * (int) $date_units))); $period = (strtotime($date_end) - strtotime($date_init)); @@ -768,7 +768,14 @@ if (is_metaconsole() === false) { date('H:i:s', $date_init), date('Y/m/d', $utimestamp), date('H:i:s', $utimestamp), - $date_text + $date_text, + 'w100p', + 'Y/m/d', + 'H:i:s', + 'yy/mm/dd', + 'HH:mm:ss', + '', + $date_units ) ); }