function Date::op_simple in Views (for Drupal 7) 8.3
Overrides Numeric::op_simple
File
- lib/
Drupal/ views/ Plugin/ views/ filter/ Date.php, line 183 - Definition of Drupal\views\Plugin\views\filter\Date.
Class
- Date
- Filter to handle dates stored as a timestamp.
Namespace
Drupal\views\Plugin\views\filterCode
function op_simple($field) {
$value = intval(strtotime($this->value['value'], 0));
if (!empty($this->value['type']) && $this->value['type'] == 'offset') {
$value = '***CURRENT_TIME***' . sprintf('%+d', $value);
// keep sign
}
// This is safe because we are manually scrubbing the value.
// It is necessary to do it this way because $value is a formula when using an offset.
$this->query
->add_where_expression($this->options['group'], "{$field} {$this->operator} {$value}");
}