Skip to content

Commit

Permalink
Update Form/Core/Type/PlainType.php
Browse files Browse the repository at this point in the history
  • Loading branch information
gaelb80 committed Sep 28, 2012
1 parent 6d5d85a commit 115ebf4
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions Form/Core/Type/PlainType.php
Expand Up @@ -8,7 +8,7 @@
use Symfony\Component\OptionsResolver\Options;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;

use Symfony\Component\Form\Extension\Core\Type\DateType as BaseDateType;
use Symfony\Component\Form\Extension\Core\Type\DateType;

/**
* A Form type that just renders the field as a p tag. This is useful for forms where certain field
Expand All @@ -30,7 +30,6 @@ public function setDefaultOptions(OptionsResolverInterface $resolver)
'date_format' => null,
'date_pattern' => null,
'time_format' => null,
'with_time' => true,
'attr' => array(
'class' => $this->getName()
)
Expand All @@ -54,8 +53,8 @@ public function buildView(FormView $view, FormInterface $form, array $options)
} elseif (is_array($value)) {
$value = implode(', ', $value);
} elseif ($value instanceof \DateTime) {
$dateFormat = is_int($options['date_format']) ? $options['date_format'] : BaseDateType::DEFAULT_FORMAT;
$timeFormat = is_int($options['time_format']) ? $options['time_format'] : BaseDateType::DEFAULT_FORMAT;
$dateFormat = is_int($options['date_format']) ? $options['date_format'] : DateType::DEFAULT_FORMAT;
$timeFormat = is_int($options['time_format']) ? $options['time_format'] : DateType::DEFAULT_FORMAT;
$calendar = \IntlDateFormatter::GREGORIAN;
$pattern = is_string($options['date_pattern']) ? $options['date_pattern'] : null;

Expand Down

0 comments on commit 115ebf4

Please sign in to comment.