public static function getInstance() { if (self::$RelativeTime == null) { self::$RelativeTime = new RelativeTime(); } return self::$RelativeTime; }
public static function formatElementSimple($element) { $relative_time = RelativeTime::getInstance(); $html = ""; $html .= "<td>"; $html .= "<a href='#' id='jobtitle'>" . $element->jobtitle . "</a> (" . $element->job_count . ")<br>"; $html .= "Posted <a href='#' title='" . Calendar::formatDateAndTime($element->unix_date_posted) . "'>" . $relative_time->getTextForSQLDate(date("Y-m-d h:i:s", $element->unix_date_posted)) . "</a>"; $html .= "</td>"; return $html; }
public static function formatElement($element) { $relative_time = RelativeTime::getInstance(); $html = ""; $html .= "<td>"; $html .= "<a href='" . Configuration::getURLPath() . "/companies/view/" . $element->company . "'>" . $element->company . "</a> (" . $element->job_count . ") <br> Last entry : " . $relative_time->getTextForSQLDate($element->last_entry); $html .= "</td>"; return $html; }
public function testRelativeTimeFutureTime10Hours() { Bundle::start('relativetime'); $time = time() + 36000; $this->assertEquals(RelativeTime::get($time), '10 hours from now'); }