Added "ago" to the relative Time, truncated seconds

This commit is contained in:
int2001
2023-12-31 07:01:43 +00:00
parent 48838c4365
commit 88cf148055

View File

@@ -189,10 +189,10 @@ class Contesting extends CI_Controller {
header('Content-Type: application/json');
if ($result && $result->num_rows()) {
$timeb4=$result->row()->b4;
$timeb4=substr($result->row()->b4,0,5);
$custom_date_format = $this->session->userdata('user_date_format');
$abstimeb4=date($custom_date_format, strtotime($result->row()->COL_TIME_OFF)).' '.date('H:i',strtotime($result->row()->COL_TIME_OFF));
echo json_encode(array('message' => 'Worked at '.$abstimeb4.' ('.$timeb4.') before'));
echo json_encode(array('message' => 'Worked at '.$abstimeb4.' ('.$timeb4.' ago) before'));
}
return;
}