diff --git a/src/EventInstanceListBuilder.php b/src/EventInstanceListBuilder.php index a847574bc3abdcec206b08f7052750beb3374417..6eb0fb2612865f3a80514cf8c3cd5e717cfdc753 100644 --- a/src/EventInstanceListBuilder.php +++ b/src/EventInstanceListBuilder.php @@ -119,13 +119,15 @@ class EventInstanceListBuilder extends EntityListBuilder { '#url' => $entity->getEventSeries()->toUrl(), ]; $config = $this->config->get('recurring_events.eventinstance.config'); + $timezone = new \DateTimeZone(drupal_get_user_timezone()); + $entity->date->start_date->setTimezone($timezone); $row['date'] = $entity->date->start_date->format($config->get('date_format')); $row['author']['data'] = [ '#theme' => 'username', '#account' => $entity->getOwner(), ]; $row['status'] = $entity->isPublished() ? $this->t('Published') : $this->t('Unpublished'); - $row['changed'] = $this->dateFormatter->format($entity->getChangedTime(), 'short'); + $row['changed'] = $this->dateFormatter->format($entity->getChangedTime(), 'short', '', $timezone->getName()); if ($this->languageManager->isMultilingual()) { $row['language'] = $this->languageManager->getLanguageName($entity->language()->getId()); diff --git a/src/EventSeriesListBuilder.php b/src/EventSeriesListBuilder.php index 4838d2cee34136f9beb4f7237276a9ef1e2e4cf7..9249a4587507c043c018f6e6cb528eb48fadcb71 100644 --- a/src/EventSeriesListBuilder.php +++ b/src/EventSeriesListBuilder.php @@ -122,16 +122,19 @@ class EventSeriesListBuilder extends EntityListBuilder { $row['type'] = $entity->recur_type->value; $row['instances'] = $entity->getInstanceCount(); $row['starts'] = $this->t('None'); + $timezone = new \DateTimeZone(drupal_get_user_timezone()); if (!empty($entity->getSeriesStart())) { $config = $this->config->get('recurring_events.eventseries.config'); - $row['starts'] = $entity->getSeriesStart()->format($config->get('date_format')); + $start_date = $entity->getSeriesStart(); + $start_date->setTimezone($timezone); + $row['starts'] = $start_date->format($config->get('date_format')); } $row['author']['data'] = [ '#theme' => 'username', '#account' => $entity->getOwner(), ]; $row['status'] = $entity->isPublished() ? $this->t('Published') : $this->t('Unpublished'); - $row['changed'] = $this->dateFormatter->format($entity->getChangedTime(), 'short'); + $row['changed'] = $this->dateFormatter->format($entity->getChangedTime(), 'short', '', $timezone->getName()); if ($this->languageManager->isMultilingual()) { $row['language'] = $this->languageManager->getLanguageName($entity->language()->getId());