From 76bcd708242b3d17f795e90ba0ba60ebd671aef2 Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Tue, 20 Feb 2024 13:57:29 -0700 Subject: [PATCH] Use the domain time_format 12h or 24h --- app/xml_cdr/xml_cdr_inc.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/app/xml_cdr/xml_cdr_inc.php b/app/xml_cdr/xml_cdr_inc.php index 02c98d6e8c..c35feb6697 100644 --- a/app/xml_cdr/xml_cdr_inc.php +++ b/app/xml_cdr/xml_cdr_inc.php @@ -229,7 +229,7 @@ //prepare to page the results //$rows_per_page = ($_SESSION['domain']['paging']['numeric'] != '') ? $_SESSION['domain']['paging']['numeric'] : 50; //set on the page that includes this page - if (empty($_GET['page']) || (!empty($_GET['page']) && !is_numeric($_GET['page']))) { + if (empty($_GET['page']) || (!empty($_GET['page']) && !is_numeric($_GET['page']))) { $_GET['page'] = 0; } //ensure page is within bounds of integer @@ -245,6 +245,12 @@ } $parameters['time_zone'] = $time_zone; +//set the sql time format + $sql_time_format = 'HH12:MI am'; + if (!empty($_SESSION['domain']['time_format']['text'])) { + $sql_time_format = $_SESSION['domain']['time_format']['text'] == '12h' ? "HH12:MI am" : "HH24:MI"; + } + //get the results from the db $sql = "select \n"; $sql .= "c.domain_uuid, \n"; @@ -253,7 +259,7 @@ $sql .= "c.start_stamp, \n"; $sql .= "c.end_stamp, \n"; $sql .= "to_char(timezone(:time_zone, start_stamp), 'DD Mon YYYY') as start_date_formatted, \n"; - $sql .= "to_char(timezone(:time_zone, start_stamp), 'HH12:MI:SS am') as start_time_formatted, \n"; + $sql .= "to_char(timezone(:time_zone, start_stamp), '".$sql_time_format."') as start_time_formatted, \n"; $sql .= "c.start_epoch, \n"; $sql .= "c.hangup_cause, \n"; $sql .= "c.billsec as duration, \n";