예제 #1
0
 /**
  * @param \DateTime|string $value
  * @return static
  */
 public function setValue($value)
 {
     if ($value instanceof \DateTime) {
         $value = $this->dateConverter->format($value);
     }
     $this->rawValue = trim($value);
     return parent::setValue($value);
 }
 /**
  * @inheritdoc
  */
 public function format(DateTimeInterval $value)
 {
     $leftValue = $this->dateTimeConverter->format($value->getLeft()->getValue());
     $rightValue = $this->dateTimeConverter->format($value->getRight()->getValue());
     return sprintf($this->format, $leftValue, $rightValue);
 }