code: public function jsonSerialize()
      {
          $json = [];
  
          if (null !== $this->min) {
              $json['min'] = $this->min->format(\DateTime::ISO8601);
          }
          if (null !== $this->max) {
              $json['max'] = $this->max->format(\DateTime::ISO8601);
          }
  
          return $json;
      }
docs: Gets all data that should be available in a json representation.
  
  @return array an associative array of the available variables