You are here

public function view_custom_table_handler_filter_date::op_simple in Views Custom Table 7

Implements op_simple().

Overrides views_handler_filter_numeric::op_simple

File

views/handlers/view_custom_table_handler_filter_date.inc, line 192
Definition of views_handler_filter_date.

Class

view_custom_table_handler_filter_date
Filter to handle dates stored as a timestamp.

Code

public function op_simple($field) {

  // Use the substitutions to ensure a consistent timestamp.
  $query_substitutions = views_views_query_substitutions($this->view);
  $value = intval(strtotime($this->value['value'], $query_substitutions['***CURRENT_TIME***']));
  $value = date('Y-m-d H:i:s', $value);

  // 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}'");
}