Skip to content

Commit

Permalink
[Form] Removed an exception that prevented valid formats from being p…
Browse files Browse the repository at this point in the history
…assed, e.g. "h" for the hour, "L" for the month etc.
  • Loading branch information
webmozart committed Nov 9, 2012
1 parent ae61d35 commit 0f75586
Showing 1 changed file with 0 additions and 4 deletions.
Expand Up @@ -87,10 +87,6 @@ public function buildForm(FormBuilderInterface $builder, array $options)
throw new InvalidOptionsException('The "date_format" option must be one of the IntlDateFormatter constants (FULL, LONG, MEDIUM, SHORT) or a string representing a custom format.');
}

if (null !== $pattern && (false === strpos($pattern, 'y') || false === strpos($pattern, 'M') || false === strpos($pattern, 'd') || false === strpos($pattern, 'H') || false === strpos($pattern, 'm'))) {
throw new InvalidOptionsException(sprintf('The "format" option should contain the letters "y", "M", "d", "H" and "m". Its current value is "%s".', $pattern));
}

if ('single_text' === $options['widget']) {
if (self::HTML5_FORMAT === $pattern) {
$builder->addViewTransformer(new DateTimeToRfc3339Transformer(
Expand Down

0 comments on commit 0f75586

Please sign in to comment.