public function testValueIsFormattedAccordingToFormatInElement() { $date = new DateTime(); $element = new DateTimeElement('foo'); $element->setFormat($date::RFC2822); $element->setValue($date); $this->assertEquals($date->format($date::RFC2822), $element->getValue()); }
/** * Add name element */ public function addFromElement($from = 'from') { $dateTime = new Element\DateTime($from); $dateTime->setLabel('Von')->setAttributes(array('class' => 'datepicker form-control')); //$dateTime->setFormat('Y-m-d\TH:iP'); // 'd.m.Y H:i' $dateTime->setFormat('d.m.Y H:i'); // 'd.m.Y H:i' $this->add($dateTime); }