You are here

function date_api_argument_handler::pre_query in Date 6.2

Make sure the date field is added to the query.

Do this in pre_query() so it will get done even if the argument is the wildcard, since query() is skipped when the wildcard is used.

File

includes/date_api_argument_handler.inc, line 297
Views argument handler.

Class

date_api_argument_handler
Date API argument handler.

Code

function pre_query() {

  // Unset invalid date values before the query runs.
  if (!empty($this->view->args) && count($this->view->args) > $this->position) {
    $argument = $this->view->args[$this->position];
    $parts = $this->date_handler
      ->arg_parts($argument);
    if (empty($parts[0]['date']) && empty($parts[0]['period'])) {
      unset($this->view->args[$this->position]);
    }
  }
}