Okay
  Print

How to write a code to get review date on Single Employer Page

Question: 

I'll replace the "By: Mr. A" by the review date. For example, if Mr. A reviewed 5 min ago, it will display "5 min ago", or if Mr. A reviewed 2 days ago, it will display "2 days ago"

Answer: 

add new function code to line 164 

http://prntscr.com/i8gfmc

function elapsedTime($time_since) {
$time = time() - $time_since;
$tokens = array (
31536000 => 'year',
2592000 => 'month',
604800 => 'week',
86400 => 'day',
3600 => 'hour',
60 => 'minute',
1 => 'second'
);
foreach ($tokens as $unit => $text) {
if ($time < $unit) continue;
$numberOfUnits = floor($time / $unit);
return $numberOfUnits.' '.$text.(($numberOfUnits>1)?'s':'');
}
}

add new code to line 200

http://prntscr.com/i8gfu1

echo elapsedTime($item_review->time) .' ago';

http://prntscr.com/i8ggfz

I hope it help you