public function Date::formatters in Display Suite 8.2
Same name and namespace in other branches
- 8.4 src/Plugin/DsField/Date.php \Drupal\ds\Plugin\DsField\Date::formatters()
- 8.3 src/Plugin/DsField/Date.php \Drupal\ds\Plugin\DsField\Date::formatters()
Returns a list of possible formatters for this field.
Return value
array A list of possible formatters.
Overrides DsFieldBase::formatters
File
- src/
Plugin/ DsField/ Date.php, line 67
Class
- Date
- The base plugin to create DS post date plugins.
Namespace
Drupal\ds\Plugin\DsFieldCode
public function formatters() {
$date_types = $this->entityTypeManager
->getStorage('date_format')
->loadMultiple();
$date_formatters = array();
foreach ($date_types as $machine_name => $value) {
/* @var $value \Drupal\Core\Datetime\DateFormatterInterface */
if ($value
->isLocked()) {
continue;
}
$date_formatters['ds_post_date_' . $machine_name] = $this
->t($value
->id());
}
return $date_formatters;
}