-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
[Form] Minor reword in the Choice type #12054
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Reading the related issue it occurs to me that the reporter was referring to options of the |
I've added more examples in the DateIntervalType docs. Thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The comments at lines 86, 119, 172, 187, 214 and 331 of the changed dateinterval.rst file are incorrect.
The comment at line 86 should say "values displayed to users range from 0 to 30 (both inclusive)". The other comments also misstate what the end of the displayed range would be.
The fact that these errors were made in trying to clarify this "feature" only illustrates how unintuitive the feature is.
I tested in the Symfony Demo app: ->add('foo', DateIntervalType::class, [
'mapped' => false,
]) ->add('foo', DateIntervalType::class, [
'mapped' => false,
'months' => range(1, 12),
]) ->add('foo', DateIntervalType::class, [
'mapped' => false,
'months' => array_combine(range(1, 12), range(1, 12)),
]) |
Your test proves my point about the comment at line 186 (not 187 as my first comment said) of dateinterval.rst. The values displayed to users when ‘months’ is set to range(1, 12) range from 0 to 11, not 0 to 12 as your comment says. BTW, the same sort of error appears in line 200 as well. |
@adrx you are right! I was looking at the wrong comments! Sorry. |
a3e1c57
to
e76a409
Compare
This will hopefully avoid issues like #11925.