You are here

public function WebformSubmissionDateFilter::opBetween in Webform Views Integration 8.5

Filters by operator between.

Parameters

object $field: The views field.

Overrides Date::opBetween

File

src/Plugin/views/filter/WebformSubmissionDateFilter.php, line 62

Class

WebformSubmissionDateFilter
Filter for date values of a webform submission.

Namespace

Drupal\webform_views\Plugin\views\filter

Code

public function opBetween($field) {
  $a = intval(strtotime($this->value['min'], $this->time
    ->getRequestTime()));
  $a = $this->dateFormatter
    ->format($a, 'custom', 'Y-m-d');
  $b = intval(strtotime($this->value['max'], $this->time
    ->getRequestTime()));
  $b = $this->dateFormatter
    ->format($b, 'custom', 'Y-m-d');
  $this->query
    ->addWhere($this->options['group'], $field, [
    $a,
    $b,
  ], $this->operator);
}