-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Feature/datetime factory format #3437
Feature/datetime factory format #3437
Conversation
…eit/zf2 into feature/datetime_factory_format
* - format: A PHP date() compatible string | ||
* | ||
* @param array|\Traversable $options | ||
* @return DateSelect |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DateTime
Did not want to duplicate the check done in Element, but rather used to already converted $this->options instead
@@ -52,6 +52,24 @@ class DateTime extends Element implements InputProviderInterface | |||
protected $validators; | |||
|
|||
/** | |||
* Accepted options for DateTime: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use {@inheritDoc}
to inherit parent method documentation too
@pdobrigkeit missing tests? |
* - format: A \DateTime compatible string | ||
* | ||
* @param array|\Traversable $options | ||
* @return DateSelect |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return type should be DateTime or Zend\Form\Element
Added a test. But someone should check the other form elements for |
That is tested in ZendTest\Form\ElementTest |
Take a look at for example |
…rmat Feature/datetime factory format
Added the setOptions function to the DateTime form element, which allows to set the accepted format, i.e. when using the array notation to define your elements and the factory.