From d312b0d81388d613b17249ab6c12b9f373165928 Mon Sep 17 00:00:00 2001 From: Daniel Maya Date: Mon, 13 Nov 2023 13:08:28 +0100 Subject: [PATCH] #12400 Fixed date format --- pandora_console/include/functions_html.php | 26 ++++++++++++---------- 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/pandora_console/include/functions_html.php b/pandora_console/include/functions_html.php index 888531e915..d9c60589ce 100644 --- a/pandora_console/include/functions_html.php +++ b/pandora_console/include/functions_html.php @@ -7305,8 +7305,10 @@ function html_print_select_date_range( $time_end='', $date_text=SECONDS_1DAY, $class='w100p', - $date_format='Y/m/d', - $time_format='H:i:s' + $date_format_php='Y/m/d', + $time_format_php='H:i:s', + $date_format_js='yy/mm/dd', + $time_format_js='HH:mm:ss' ) { global $config; @@ -7328,21 +7330,21 @@ function html_print_select_date_range( } if ($date_end === '') { - $date_end = date($date_format); + $date_end = date($date_format_php); } if ($date_init === '') { - $date_init = date($date_format, strtotime($date_end.' -1 days')); + $date_init = date($date_format_php, strtotime($date_end.' -1 days')); } - $date_init = date($date_format, strtotime($date_init)); + $date_init = date($date_format_php, strtotime($date_init)); if ($time_init === '') { - $time_init = date($time_format); + $time_init = date($time_format_php); } if ($time_end === '') { - $time_end = date($time_format); + $time_end = date($time_format_php); } $fields[SECONDS_1DAY] = __('Last 24hr'); @@ -7508,7 +7510,7 @@ function html_print_select_date_range( } $('#text-date').datepicker({ - dateFormat: '".DATE_FORMAT_JS."', + dateFormat: '".$date_format_js."', changeMonth: true, changeYear: true, showAnim: 'slideDown' @@ -7516,7 +7518,7 @@ function html_print_select_date_range( $('[id^=text-time_init]').timepicker({ showSecond: true, - timeFormat: '".TIME_FORMAT_JS."', + timeFormat: '".$time_format_js."', timeOnlyTitle: '".__('Choose time')."', timeText: '".__('Time')."', hourText: '".__('Hour')."', @@ -7527,7 +7529,7 @@ function html_print_select_date_range( }); $('[id^=text-date_init]').datepicker ({ - dateFormat: '".DATE_FORMAT_JS."', + dateFormat: '".$date_format_js."', changeMonth: true, changeYear: true, showAnim: 'slideDown', @@ -7549,7 +7551,7 @@ function html_print_select_date_range( }); $('[id^=text-date_end]').datepicker ({ - dateFormat: '".DATE_FORMAT_JS."', + dateFormat: '".$date_format_js."', changeMonth: true, changeYear: true, showAnim: 'slideDown', @@ -7572,7 +7574,7 @@ function html_print_select_date_range( $('[id^=text-time_end]').timepicker({ showSecond: true, - timeFormat: '".TIME_FORMAT_JS."', + timeFormat: '".$time_format_js."', timeOnlyTitle: '".__('Choose time')."', timeText: '".__('Time')."', hourText: '".__('Hour')."',