You are here

protected function DateRangeDurationWidget::getDefaultDurationInterval in Datetime Extras 8

Returns the current value of the default duration setting as an interval.

Return value

\DateInterval The current value of the default duration setting.

3 calls to DateRangeDurationWidget::getDefaultDurationInterval()
DateRangeDurationWidget::formElement in src/Plugin/Field/FieldWidget/DateRangeDurationWidget.php
Returns the form for a single field widget.
DateRangeDurationWidget::settingsForm in src/Plugin/Field/FieldWidget/DateRangeDurationWidget.php
Returns a form to configure settings for the widget.
DateRangeDurationWidget::settingsSummary in src/Plugin/Field/FieldWidget/DateRangeDurationWidget.php
Returns a short summary for the current widget settings.

File

src/Plugin/Field/FieldWidget/DateRangeDurationWidget.php, line 109

Class

DateRangeDurationWidget
Plugin implementation of the 'daterange_duration' widget.

Namespace

Drupal\datetime_extras\Plugin\Field\FieldWidget

Code

protected function getDefaultDurationInterval() {
  $default_duration = $this
    ->getSetting('default_duration');
  return $this->durationService
    ->convertDateArrayToDateInterval($default_duration);
}