AuditLogDate.php in Audit Log 8.2
File
src/Plugin/views/filter/AuditLogDate.php
View source
<?php
namespace Drupal\audit_log\Plugin\views\filter;
use Drupal\views\Plugin\views\filter\Date;
class AuditLogDate extends Date {
protected function opSimple($field) {
if (!empty($this->value['type']) && $this->value['type'] == 'offset') {
$value = intval(strtotime($this->value['value'], 0));
$value = '***CURRENT_TIME***' . sprintf('%+d', $value);
}
else {
$tz = 'UTC';
$dt = new \DateTime($this->value['value'], new \DateTimeZone($tz));
$value = $dt
->getTimestamp();
}
$expression = "{$field} {$this->operator} {$value}";
$this->query
->addWhereExpression($this->options['group'], $expression);
}
}