You are here

private function ScheduledPublishWidget::createDefaultValue in Scheduled Publish 8

Same name and namespace in other branches
  1. 8.2 src/Plugin/Field/FieldWidget/ScheduledPublishWidget.php \Drupal\scheduled_publish\Plugin\Field\FieldWidget\ScheduledPublishWidget::createDefaultValue()
1 call to ScheduledPublishWidget::createDefaultValue()
ScheduledPublishWidget::formElement in src/Plugin/Field/FieldWidget/ScheduledPublishWidget.php
Returns the form for a single field widget.

File

src/Plugin/Field/FieldWidget/ScheduledPublishWidget.php, line 82

Class

ScheduledPublishWidget
Plugin implementation of the 'scheduled_publish_widget' widget.

Namespace

Drupal\scheduled_publish\Plugin\Field\FieldWidget

Code

private function createDefaultValue(DrupalDateTime $date, string $timezone) : DrupalDateTime {
  $date
    ->setTimezone(new \DateTimeZone($timezone));
  return $date;
}