You are here

function _datex_date_views_argument_handler_simple::summary_argument in Datex 7.3

Provide the argument to use to link from the summary to the next level.

This will be called once per row of a summary, and used as part of $view->get_url().

Parameters

object $data: The query results for the row.

Overrides views_handler_argument::summary_argument

File

./datex.views.inc, line 768
Datex views integration.

Class

_datex_date_views_argument_handler_simple
Copied from date_views module. So we have no hard dependency on it.

Code

function summary_argument($data) {
  $format = $this->date_handler
    ->views_formats($this->options['granularity'], 'sql');
  $value = $data->{$this->name_alias};
  if (empty($value)) {
    return $this->options['exception']['value'];
  }
  $range = $this->date_handler
    ->arg_range($value);
  return date_format_date($range[0], 'custom', $format);
}