Ejemplo n.º 1
0
 /**
  * Get the time when the group was most recently active
  *
  * @param  bool            $human True to output the last activity in a human-readable string, false to return a TimeDate object
  * @return string|TimeDate
  */
 public function getLastActivity($human = true)
 {
     if ($human) {
         return $this->last_activity->diffForHumans();
     } else {
         return $this->last_activity;
     }
 }
Ejemplo n.º 2
0
 /**
  * Returns the amount of time passed since the server was
  * last updated in a human-readable form
  * @return string
  */
 public function lastUpdate()
 {
     return $this->updated->diffForHumans();
 }
Ejemplo n.º 3
0
 /**
  * Get the time when the page was last updated
  * @return string The page's last update time in a human-readable form
  */
 public function getUpdated()
 {
     $this->lazyLoad();
     return $this->updated->diffForHumans();
 }
Ejemplo n.º 4
0
 /**
  * Gets a human-readable representation of the time when the message was sent
  * @return string
  */
 public function getCreationDate()
 {
     return $this->timestamp->diffForHumans();
 }
Ejemplo n.º 5
0
 /**
  * Get the timestamp of the match
  *
  * @param string $format The date format. Leave blank if you want a relative time (e.g. 2 days ago)
  *
  * @return string The match's timestamp
  */
 public function getTimestamp($format = "")
 {
     if (empty($format)) {
         return $this->timestamp->diffForHumans();
     }
     return $this->timestamp->format($format);
 }
Ejemplo n.º 6
0
 /**
  * Get the creation date of the team
  *
  * @return string The creation date of the team
  */
 public function getCreationDate()
 {
     return $this->created->diffForHumans();
 }
Ejemplo n.º 7
0
 /**
  * @param \TimeDate $time   The TimeDate object we'll be representing as text
  * @param string    $format The format that will be shown. If a format isn't set, it'll return the difference in human readable time
  *
  * @return string
  */
 public function __invoke($time, $format = "")
 {
     $timeElement = '<span class="c-timestamp js-timestamp" title="%s">%s</span>';
     $outputTime = empty($format) ? $time->diffForHumans() : $time->format($format);
     return sprintf($timeElement, $time->format("F j, Y g:ia"), $outputTime);
 }
Ejemplo n.º 8
0
 /**
  * Get the last login for a player
  * @param  bool   $human Whether to get the literal time stamp or a relative time
  * @return string The date of the last login
  */
 public function getLastLogin($human = true)
 {
     $this->lazyLoad();
     if ($human) {
         return $this->last_login->diffForHumans();
     } else {
         return $this->last_login;
     }
 }