You are here

public function OfficeHoursDatelist::getInfo in Office Hours 8

Returns the element properties for this element.

Return value

array An array of element properties. See \Drupal\Core\Render\ElementInfoManagerInterface::getInfo() for documentation of the standard properties of all elements, and the return value format.

Overrides Datelist::getInfo

File

src/Element/OfficeHoursDatelist.php, line 19

Class

OfficeHoursDatelist
Provides a one-line text field form element.

Namespace

Drupal\office_hours\Element

Code

public function getInfo() {
  $parent_info = parent::getInfo();
  $info = [
    '#input' => TRUE,
    '#tree' => TRUE,
    '#process' => [
      [
        static::class,
        'processOfficeHoursSlot',
      ],
    ],
    '#element_validate' => [
      [
        static::class,
        'validateOfficeHoursSlot',
      ],
    ],
    // @see Drupal\Core\Datetime\Element\Datelist.
    '#date_part_order' => [
      'year',
      'month',
      'day',
      'hour',
      'minute',
    ],
    // @see Drupal\Core\Datetime\Element\Datetime.
    '#date_date_element' => 'none',
    // {'none'|'date'}
    '#date_time_element' => 'time',
    // {'none'|'time'|'text'}
    '#date_date_format' => 'none',
    '#date_time_callbacks' => [],
    // Can be used to add a jQuery time picker or an 'All day' checkbox.
    '#date_year_range' => '1900:2050',
    // @see Drupal\Core\Datetime\Element\DateElementBase.
    '#date_timezone' => '+0000',
  ];

  // #process, #validate bottom-up.
  $info['#process'] = array_merge($parent_info['#process'], $info['#process']);
  $info['#element_validate'] = array_merge($parent_info['#element_validate'], $info['#element_validate']);
  return $info + $parent_info;
}