You are here

function commerce_reports_handler_field_date::accept_exposed_input in Commerce Reporting 7.3

Take input from exposed handlers and assign to this handler, if necessary.

Overrides views_handler::accept_exposed_input

File

includes/views/commerce_reports_handler_field_date.inc, line 91
Views field handler for the created date on orders.

Class

commerce_reports_handler_field_date
@file Views field handler for the created date on orders.

Code

function accept_exposed_input($input) {
  if (empty($this->options['exposed'])) {
    return TRUE;
  }
  if (!empty($input['granularity']) && in_array($input['granularity'], array_keys($this
    ->granularityOptions()))) {
    $this->granularity = $input['granularity'];
  }
  else {
    return FALSE;
  }
  if (is_array($input['startDate']) && is_array($input['endDate'])) {
    $start = mktime(0, 0, 0, $input['startDate']['month'], $input['startDate']['day'], $input['startDate']['year']);
    $end = mktime(0, 0, 0, $input['endDate']['month'], $input['endDate']['day'], $input['endDate']['year']);
  }
  else {
    return FALSE;
  }
  if ($end > $start) {
    $this->startDate = $start;
    $this->endDate = $end;
  }
  else {
    return FALSE;
  }
  $this->startDate = $this
    ->convertTimestamp($this->startDate);
  $this->endDate = $this
    ->convertTimestamp($this->endDate);
  return TRUE;
}