Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

[Form] Add input_format option to DateType and DateTimeType#29887

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

Conversation

@fancyweb
Copy link
Contributor

@fancywebfancyweb commentedJan 14, 2019
edited
Loading

QA
Branch?master
Bug fix?no
New feature?yes
BC breaks?no
Deprecations?no
Tests pass?yes
Fixed tickets#29883
LicenseMIT
Doc PRsymfony/symfony-docs#10882

Add a new option to specify the date format when using thestring input type.

andrew-demb, OskarStark, andreybolonin, and GwendolenLynch reacted with thumbs up emojiGwendolenLynch reacted with hooray emojiGwendolenLynch reacted with heart emoji
'empty_data' =>function (Options$options) {
return$options['compound'] ?array() :'';
},
'input_format' =>'Y-m-d H:i:s',
Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

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');
Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Should we validate the passedinput_format ?

@fancywebfancywebforce-pushed theadd-input-format-option-to-date-time-form-types branch froma7303a6 to12c80e8CompareJanuary 14, 2019 20:51
@fancywebfancywebforce-pushed theadd-input-format-option-to-date-time-form-types branch 2 times, most recently from164ec2e tob4b1296CompareJanuary 17, 2019 20:48
@nicolas-grekasnicolas-grekas added this to thenext milestoneJan 24, 2019
@fancywebfancywebforce-pushed theadd-input-format-option-to-date-time-form-types branch fromb4b1296 to869bbdeCompareJanuary 25, 2019 19:36
@xabbuh
Copy link
Member

@fancyweb Can you rebase here?

@fancywebfancywebforce-pushed theadd-input-format-option-to-date-time-form-types branch from869bbde to7de0120CompareFebruary 2, 2019 09:04
return'';
});

$resolver->setAllowedTypes('input_format','string');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

returnsprintf('Using the "date_format" option of %s when the "widget" option is set to "single_text" is deprecated since Symfony 4.3 and will lead to an exception in 5.0.',self::class);
//throw new LogicException(sprintf('Cannot use the "date_format" option of the %s when the "widget" option is set to "single_text".', self::class));

As we are going to do with thetime_widget option, I wonder if we should throw an exception when the input_format is passed and the value ofinput is not strictly equal to string'.

@xabbuh
Copy link
Member

@fancyweb Can you rebase here?

@fancywebfancywebforce-pushed theadd-input-format-option-to-date-time-form-types branch from7de0120 toef26ad0CompareFebruary 16, 2019 08:24
@fancywebfancywebforce-pushed theadd-input-format-option-to-date-time-form-types branch fromef26ad0 toc8240a0CompareFebruary 18, 2019 18:20
@xabbuh
Copy link
Member

Thank you@fancyweb.

@xabbuhxabbuh merged commitc8240a0 intosymfony:masterFeb 20, 2019
xabbuh added a commit that referenced this pull requestFeb 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#10882Add 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
fabpot added a commit that referenced this pull requestMar 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 requestMar 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 TimeTypeRelated Symfony PRs :symfony/symfony#29887 andsymfony/symfony#30358Commits-------8fc1b53 [Form] Add input_format option to DateType, DateTimeType and TimeType
@nicolas-grekasnicolas-grekas modified the milestones:next,4.3Apr 30, 2019
@fabpotfabpot mentioned this pull requestMay 9, 2019
@fancywebfancyweb deleted the add-input-format-option-to-date-time-form-types branchAugust 9, 2019 07:14
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@ycerutoycerutoyceruto left review comments

@nicolas-grekasnicolas-grekasnicolas-grekas approved these changes

@xabbuhxabbuhxabbuh approved these changes

Assignees

No one assigned

Projects

None yet

Milestone

4.3

Development

Successfully merging this pull request may close these issues.

5 participants

@fancyweb@xabbuh@nicolas-grekas@yceruto@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp