GoogleAnalyticsDate.php in Google Analytics Reports 8.3
File
src/Plugin/views/filter/GoogleAnalyticsDate.php
View source
<?php
namespace Drupal\google_analytics_reports\Plugin\views\filter;
use Drupal\views\Plugin\views\filter\Date;
class GoogleAnalyticsDate extends Date {
public function operators() {
$operators = [
'=' => [
'title' => $this
->t('Is equal to'),
'method' => 'opSimple',
'short' => $this
->t('='),
'values' => 1,
],
];
return $operators;
}
protected function opSimple($field) {
$origin = !empty($this->value['type']) && $this->value['type'] == 'offset' ? \Drupal::time()
->getRequestTime() : 0;
$value = intval(strtotime($this->value['value'], $origin));
$this->query
->addWhere($this->options['group'], $field, $value, $this->operator);
}
}