You are here

public function DateWidgetBase::formatOptions in Date 8

Return the format options used by this widget.

File

lib/Drupal/date/Plugin/field/widget/DateWidgetBase.php, line 55
Definition of Drupal\date\Plugin\field\widget\DateWidgetBase.

Class

DateWidgetBase
Abstract class for all date widgets.

Namespace

Drupal\date\Plugin\field\widget

Code

public function formatOptions() {
  $options = array();
  $formats = date_datepicker_formats();
  $example_date = date_example_date();
  foreach ($formats as $f) {
    $options[$f] = $example_date
      ->format($f);
  }
  return $options;
}