Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.6k
[Validator] [DateTime] Addformat
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
[Validator] [DateTime] Addformat
to error messages#58559
Uh oh!
There was an error while loading.Please reload this page.
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
carsonbot commentedOct 14, 2024
Hey! I see that this is your first PR. That is great! Welcome! Symfony has acontribution 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 messagesDuplicate 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
tod5beef3
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
toa695074
Comparea695074
to20e83b9
CompareThank you@saulius334. |
fc65c8f
intosymfony:7.3Uh oh!
There was an error while loading.Please reload this page.
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 | MITI fail to see why these changes have been done in#58559.Commits-------71d8ec0 revert test changes
Uh oh!
There was an error while loading.Please reload this page.
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 thesymfony 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.