DayDate.php in Drupal 10
File
core/modules/views/src/Plugin/views/argument/DayDate.php
View source
<?php
namespace Drupal\views\Plugin\views\argument;
class DayDate extends Date {
protected $format = 'j';
protected $argFormat = 'd';
public function summaryName($data) {
$day = str_pad($data->{$this->name_alias}, 2, '0', STR_PAD_LEFT);
return $this->dateFormatter
->format(strtotime("2005" . "05" . $day . " 00:00:00 UTC"), 'custom', $this->format, 'UTC');
}
public function title() {
$day = str_pad($this->argument, 2, '0', STR_PAD_LEFT);
return $this->dateFormatter
->format(strtotime("2005" . "05" . $day . " 00:00:00 UTC"), 'custom', $this->format, 'UTC');
}
public function summaryArgument($data) {
return str_pad($data->{$this->base_alias}, 2, '0', STR_PAD_LEFT);
}
}
Classes
Name |
Description |
DayDate |
Argument handler for a day (DD) |