-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Validator] [DateTime] Add format
to error messages
#58559
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
[Validator] [DateTime] Add format
to error messages
#58559
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
Hey! I see that this is your first PR. That is great! Welcome! Symfony has a contribution guide which I suggest you to read. In short:
Review the GitHub status checks of your pull request and try to solve the reported issues. If some tests are failing, try to see if they are failing because of this change. When two Symfony core team members approve this change, it will be merged and you will become an official Symfony contributor! I am going to sit back now and wait for the reviews. Cheers! Carsonbot |
Hi, thanks for this new feature. New features need to target the latest branch, which is |
@OskarStark Thank you for your quick review. Changed the target branch to latest ( |
format
to error messages
Duplicate of #58602, which was rejected. |
Aaah sorry I was too fast, that's different. |
Please add a line to the changelog of the component. |
9e2f5ad
to
d5beef3
Compare
@nicolas-grekas Thank you for your comment. Added changes to changelog |
Bump, anything else I need to add/change to move this forward ? |
996e398
to
a695074
Compare
a695074
to
20e83b9
Compare
Thank you @saulius334. |
This PR was merged into the 7.3 branch. Discussion ---------- [MonologBridge] revert test changes | Q | A | ------------- | --- | Branch? | 7.3 | Bug fix? | no | New feature? | no | Deprecations? | no | Issues | | License | MIT I fail to see why these changes have been done in #58559. Commits ------- 71d8ec0 revert test changes
Problem
Currently there is no way to dynamically add the
format
value into error messages when using theDateTime
constraint. It has to be hardcoded on everyDateTime
constraint.For example:
Goal
The goal is to add the possibility to use a parameter instead of hardcoding the selected format.
For example:
If using the symfony translator we would even not need to set the message when creating the constraint.
For example:
Solution
When building the violations set a new parameter called
format
which represents the givenformat
when theDateTime
constraint is created.