[Form] Add input_format option to DateType and DateTimeType#29887
Merged
xabbuh merged 1 commit intosymfony:masterfrom Feb 20, 2019
Merged
Conversation
fancyweb
commented
Jan 14, 2019
| 'empty_data' => function (Options $options) { | ||
| return $options['compound'] ? array() : ''; | ||
| }, | ||
| 'input_format' => 'Y-m-d H:i:s', |
Contributor
Author
There was a problem hiding this comment.
Should we set the default here or rely on the transformer default ? IMHO, it's better here so the form type and the transformer are more decoupled.
| 'choice', | ||
| )); | ||
|
|
||
| $resolver->setAllowedTypes('input_format', 'string'); |
Contributor
Author
There was a problem hiding this comment.
Should we validate the passed input_format ?
a7303a6 to
12c80e8
Compare
164ec2e to
b4b1296
Compare
b4b1296 to
869bbde
Compare
xabbuh
approved these changes
Feb 2, 2019
Member
|
@fancyweb Can you rebase here? |
869bbde to
7de0120
Compare
nicolas-grekas
approved these changes
Feb 7, 2019
yceruto
reviewed
Feb 7, 2019
| return ''; | ||
| }); | ||
|
|
||
| $resolver->setAllowedTypes('input_format', 'string'); |
Member
There was a problem hiding this comment.
symfony/src/Symfony/Component/Form/Extension/Core/Type/DateTimeType.php
Lines 298 to 299 in a6a1be8
As we are going to do with the
time_widget option, I wonder if we should throw an exception when the input_format is passed and the value of input is not strictly equal to string'.
Member
|
@fancyweb Can you rebase here? |
7de0120 to
ef26ad0
Compare
ef26ad0 to
c8240a0
Compare
Member
|
Thank you @fancyweb. |
xabbuh
added a commit
that referenced
this pull request
Feb 20, 2019
…eType (fancyweb) This PR was merged into the 4.3-dev branch. Discussion ---------- [Form] Add input_format option to DateType and DateTimeType | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | yes | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #29883 | License | MIT | Doc PR | symfony/symfony-docs#10882 Add a new option to specify the date format when using the `string` input type. Commits ------- c8240a0 [Form] Add input_format option to DateType and DateTimeType
This was referenced Feb 21, 2019
fabpot
added a commit
that referenced
this pull request
Mar 3, 2019
…xabbuh) This PR was merged into the 4.3-dev branch. Discussion ---------- [Form] be able to specify the input format for times | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | yes | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | | License | MIT | Doc PR | This expands the work started in #29887 to also allow to configure the input format for string inputs in the `TimeType`. Commits ------- 2d9bc18 be able to specify the input format for times
javiereguiluz
added a commit
to symfony/symfony-docs
that referenced
this pull request
Mar 7, 2019
… and TimeType (fancyweb) This PR was squashed before being merged into the master branch (closes #10882). Discussion ---------- [Form] Add input_format option to DateType, DateTimeType and TimeType Related Symfony PRs : symfony/symfony#29887 and symfony/symfony#30358 Commits ------- 8fc1b53 [Form] Add input_format option to DateType, DateTimeType and TimeType
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add a new option to specify the date format when using the
stringinput type.