You are here

public function SiteAlert::getEndTime in Site Alert 8

File

src/Entity/SiteAlert.php, line 106

Class

SiteAlert
Implements SiteAlert class.

Namespace

Drupal\site_alert\Entity

Code

public function getEndTime() {
  if ($end_time = $this
    ->get('scheduling')->end_value) {
    $date = new DrupalDateTime($end_time, 'UTC');
    return $date
      ->format('Y-m-d H:i:s', [
      'timezone' => date_default_timezone_get(),
    ]);
  }
  return '';
}