Example #1
0
 /**
  * Retrieves a DateStep Validator configured for a DateTime Input type
  *
  * @return DateTime
  */
 protected function getStepValidator()
 {
     $stepValidator = parent::getStepValidator();
     $baseValue = $stepValidator->getBaseValue();
     $stepValue = isset($this->attributes['step']) ? (int) $this->attributes['step'] : null;
     // Seconds
     if ($baseValue === '1970-01-01T00:00Z' || $baseValue === '1970-01-01T00:00:00Z') {
         $stepValidator->setBaseValue(0);
     }
     return $stepValidator->setStep(new DateInterval('PT' . ($stepValue ?: 1) . 'S'));
 }