function MonthDate::summaryName
Same name in other branches
- 9 core/modules/views/src/Plugin/views/argument/MonthDate.php \Drupal\views\Plugin\views\argument\MonthDate::summaryName()
- 8.9.x core/modules/views/src/Plugin/views/argument/MonthDate.php \Drupal\views\Plugin\views\argument\MonthDate::summaryName()
- 10 core/modules/views/src/Plugin/views/argument/MonthDate.php \Drupal\views\Plugin\views\argument\MonthDate::summaryName()
Overrides ArgumentPluginBase::summaryName
File
-
core/
modules/ views/ src/ Plugin/ views/ argument/ MonthDate.php, line 28
Class
- MonthDate
- Argument handler for a month (MM)
Namespace
Drupal\views\Plugin\views\argumentCode
public function summaryName($data) {
$month = str_pad($data->{$this->name_alias}, 2, '0', STR_PAD_LEFT);
try {
return $this->dateFormatter
->format(strtotime("2005" . $month . "15" . " 00:00:00 UTC"), 'custom', $this->format, 'UTC');
} catch (\InvalidArgumentException) {
return parent::summaryName($data);
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.