3 namespace Drupal\views\Plugin\views\argument;
6 * Argument handler for a day (DD)
8 * @ViewsArgument("date_day")
10 class DayDate extends Date {
15 protected $format = 'j';
20 protected $argFormat = 'd';
23 * Provide a link to the next level of the view
25 public function summaryName($data) {
26 $day = str_pad($data->{$this->name_alias}, 2, '0', STR_PAD_LEFT);
27 // strtotime respects server timezone, so we need to set the time fixed as utc time
28 return format_date(strtotime("2005" . "05" . $day . " 00:00:00 UTC"), 'custom', $this->format, 'UTC');
32 * Provide a link to the next level of the view
34 public function title() {
35 $day = str_pad($this->argument, 2, '0', STR_PAD_LEFT);
36 return format_date(strtotime("2005" . "05" . $day . " 00:00:00 UTC"), 'custom', $this->format, 'UTC');
39 public function summaryArgument($data) {
40 // Make sure the argument contains leading zeroes.
41 return str_pad($data->{$this->base_alias}, 2, '0', STR_PAD_LEFT);