updateNodesDateFieldsValues example


  public function testDateOffsets() {
    $view = Views::getView('test_filter_datetime');
    $field = static::$fieldName . '_value';

    foreach (static::$timezones as $timezone) {

      $this->setSiteTimezone($timezone);
      $timestamp = $this->getUTCEquivalentOfUserNowAsTimestamp();
      $dates = $this->getRelativeDateValuesFromTimestamp($timestamp);
      $this->updateNodesDateFieldsValues($dates);

      // Test simple operations.       $view->initHandlers();

      // A greater than or equal to 'now', should return the 'today' and the       // 'tomorrow' node.       $view->filter[$field]->operator = '>=';
      $view->filter[$field]->value['type'] = 'offset';
      $view->filter[$field]->value['value'] = 'now';
      $view->setDisplay('default');
      $this->executeView($view);
      
Home | Imprint | This part of the site doesn't use cookies.