Simplify the time format

This commit is contained in:
FusionPBX 2024-02-20 13:41:21 -07:00 committed by GitHub
parent 53f6f040c1
commit 61d40a62ee
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 7 additions and 1 deletions

View File

@ -28,11 +28,17 @@
//if also viewing system status, show more recent calls (more room avaialble)
$missed_limit = !empty($selected_blocks) && (is_array($selected_blocks) && in_array('counts', $selected_blocks)) ? 10 : 5;
//set the sql time format
$sql_time_format = 'DD Mon HH12:MI am';
if (!empty($_SESSION['domain']['time_format']['text'])) {
$sql_time_format = $_SESSION['domain']['time_format']['text'] == '12h' ? "DD Mon HH12:MI am" : "DD Mon HH24:MI";
}
//get the missed calls from call detail records
$sql = "select \n";
$sql .= " status, \n";
$sql .= " direction, \n";
$sql .= " to_char(timezone(:time_zone, start_stamp), '".(!empty($_SESSION['domain']['time_format']) && $_SESSION['domain']['time_format']['text'] == '12h' ? "DD Mon HH12:MI am" : "DD Mon HH24:MI")."') as start_date_time, \n";
$sql .= " to_char(timezone(:time_zone, start_stamp), '".$sql_time_format."') as start_date_time, \n";
$sql .= " caller_id_name, \n";
$sql .= " caller_id_number, \n";
$sql .= " answer_stamp \n";