private function timeAgo($timestamp) {
    $now = new \DateTime('now');
    $date = new \DateTime();
    $date->setTimestamp($timestamp);
    $datediff = date_diff($now, $date);
    $message = '';
    $components = [
      ['y', 'year', 'years'], ['m', 'month', 'months'],
      ['d', 'day', 'days'], ['h', 'hour', 'hours'],
      ['i', 'minute', 'minutes'], ['s', 'second', 'seconds'],
    ];
    foreach ($components as $component) {
      if ($datediff->{$component[0]} > 0) {
        $message = $datediff->{$component[0]} . ' '
          . ($datediff->{$component[0]} > 1 ? t($component[2]) : $component[1]);
        break;
      }
    }
    return !empty($message) ? $message . ' ' . t('ago') : '';
  }