示例#1
0
 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());
 }
示例#2
0
 /**
  * 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);
 }