Skip to content

Commit 59ceb58

Browse files
bug symfony#59014 [Form] Allow integer for the calendar option of DateType (alexandre-daubois)
This PR was merged into the 7.2 branch. Discussion ---------- [Form] Allow integer for the `calendar` option of `DateType` | Q | A | ------------- | --- | Branch? | 7.2 | Bug fix? | yes | New feature? | no | Deprecations? | no | Issues | - | License | MIT Underlying mechanisms support integers for the calendar, so integers should be allowed in the form type option. Spotted by `@stof` in symfony#57960 (comment) Commits ------- 5e75bed [Form] Allow integer for the `calendar` option of `DateType`
2 parents 659cc96 + 5e75bed commit 59ceb58

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Symfony/Component/Form/Extension/Core/Type/DateType.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ public function configureOptions(OptionsResolver $resolver): void
313313
$resolver->setAllowedTypes('months', 'array');
314314
$resolver->setAllowedTypes('days', 'array');
315315
$resolver->setAllowedTypes('input_format', 'string');
316-
$resolver->setAllowedTypes('calendar', ['null', \IntlCalendar::class]);
316+
$resolver->setAllowedTypes('calendar', ['null', 'int', \IntlCalendar::class]);
317317

318318
$resolver->setInfo('calendar', 'The calendar to use for formatting and parsing the date. The value should be an instance of \IntlCalendar. By default, the Gregorian calendar with the default locale is used.');
319319

0 commit comments

Comments
 (0)