You are here

protected function DateRecurDefaultRRule::formatDateForDisplay in Recurring Dates Field 8

1 call to DateRecurDefaultRRule::formatDateForDisplay()
DateRecurDefaultRRule::humanReadable in src/DateRecurDefaultRRule.php
Return a human readable and translated representation of the repeat rule.

File

src/DateRecurDefaultRRule.php, line 175

Class

DateRecurDefaultRRule

Namespace

Drupal\date_recur

Code

protected function formatDateForDisplay(\DateTime $date, $format = 'H:i') {
  if (empty($this->timezone)) {
    return $date
      ->format($format);
  }
  return $date
    ->setTimezone(new \DateTimeZone($this->timezone))
    ->format($format);
}