Skip to content

Commit

Permalink
handle type annotation for date and datetime
Browse files Browse the repository at this point in the history
set type to Zend\Form\Element\Date and Zend\Form\Element\DateTime respectively
  • Loading branch information
maxnuf committed May 11, 2013
1 parent ed6aa30 commit a9f5fe7
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,12 @@ public function handleTypeAnnotation($e)
case 'boolean':
$type = 'Zend\Form\Element\Checkbox';
break;
case 'date':
$type = 'Zend\Form\Element\Date';
break;
case 'datetime':
$type = 'Zend\Form\Element\DateTime';
break;
default:
$type = 'Zend\Form\Element';
break;
Expand Down Expand Up @@ -221,9 +227,6 @@ public function handleValidatorAnnotation($e)
case 'smallint':
$inputSpec['validators'][] = array('name' => 'Int');
break;
case 'date':
$inputSpec['validators'][] = array('name' => 'Date');
break;
case 'string':
if ($annotation->length) {
$inputSpec['validators'][] = array(
Expand Down

1 comment on commit a9f5fe7

@thestanislav
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems to be related with this doctrine#192

Please sign in to comment.