code: public function setDateRange($dateRange)
      {
          if ($dateRange instanceof DateTimeRange) {
              $this->dateRange = $dateRange;
          } elseif (is_array($dateRange)) {
              $this->dateRange = new DateTimeRange($dateRange);
          } else {
              $this->dateRange = null;
              trigger_error('Argument must be an object of class DateTimeRange. Data loss!', E_USER_WARNING);
          }
  
          return $this;
      }
docs: Sets the "dateRange" of the SearchSort.
  
  @param DateTimeRange $dateRange
  
  @return SearchSort