You are here

function persian_date_field_widget_info_alter in Persian Date for Drupal 8 8

Same name and namespace in other branches
  1. 8.4 persian_date.module \persian_date_field_widget_info_alter()

Replace date widgets with persian widgets

Implements hook_field_widget_info_alter().

File

./persian_date.module, line 91
Contains persian_date.module.

Code

function persian_date_field_widget_info_alter(array &$info) {

  // Let a new field type re-use an existing widget.
  $info['datetime_default']['class'] = \Drupal\persian_date\Plugin\Field\FieldWidget\PersianDateTimeDefaultWidget::class;
  $info['datetime_datelist']['class'] = \Drupal\persian_date\Plugin\Field\FieldWidget\PersianDateTimeDatelistWidget::class;
  $info['datetime_timestamp']['class'] = \Drupal\persian_date\Plugin\Field\FieldWidget\PersianTimestampDateTimeDefaultWidget::class;
  $info['datetime_timestamp']['provider'] = 'persian_date';
}