Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 59ceb58

Browse filesBrowse files
bug #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 #57960 (comment) Commits ------- 5e75bed [Form] Allow integer for the `calendar` option of `DateType`
2 parents 659cc96 + 5e75bed commit 59ceb58
Copy full SHA for 59ceb58

File tree

Expand file treeCollapse file tree

1 file changed

+1
-1
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+1
-1
lines changed

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

Copy file name to clipboardExpand all lines: src/Symfony/Component/Form/Extension/Core/Type/DateType.php
+1-1Lines 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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.