Skip to content

[Form] deprecate custom formats with HTML5 widgets #28723

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

Merged
merged 1 commit into from
Feb 21, 2019

Conversation

xabbuh
Copy link
Member

@xabbuh xabbuh commented Oct 4, 2018

Q A
Branch? master
Bug fix? no
New feature? no
BC breaks? no
Deprecations? yes
Tests pass? yes
Fixed tickets
License MIT
Doc PR symfony/symfony-docs#10986

@xabbuh xabbuh added this to the next milestone Oct 4, 2018
@xabbuh xabbuh force-pushed the html5-singletext-format-deprecation branch 2 times, most recently from ecd04af to 055dc6c Compare October 5, 2018 07:45
Copy link
Member

@nicolas-grekas nicolas-grekas left a comment

Choose a reason for hiding this comment

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

Why would it make Symfony better? I mean, yes, html5 is a standard, but why should we stricter than required actually? What's the benefit? I don't feel like this would make anything easier to maintain, nor easier to work with.

@xabbuh xabbuh force-pushed the html5-singletext-format-deprecation branch 2 times, most recently from 7b388e6 to f973630 Compare October 8, 2018 19:54
@xabbuh xabbuh force-pushed the html5-singletext-format-deprecation branch 2 times, most recently from e547eb7 to 7ffad2b Compare October 19, 2018 08:05
@xabbuh
Copy link
Member Author

xabbuh commented Oct 19, 2018

The thing is that custom formats do not work with type="datetime-local input fields. If you use a JavaScript-based widget you will hide this fact, but as soon as your application falls back to the HTML input for whatever reason, the input will not behave as expected. Using a custom format is totally fine, but in this case you need to opt-out of the HTML5 datetime input (i.e. setting html5 to false). The rendering will then use a type="text" input which will behave as expected with custom formats.

javiereguiluz added a commit to symfony/demo that referenced this pull request Oct 19, 2018
This PR was merged into the master branch.

Discussion
----------

Fix DateTimePicker widget

As spotted here symfony/symfony#28723 (comment) we need to disable `html5` to use a `type="text"` input and make it work again.

| before | after |
| --- | --- |
| ![wrong_datepicker](https://user-images.githubusercontent.com/2028198/47217570-d05a9880-d376-11e8-9e3a-116769569f22.png) | ![correct_datepicker](https://user-images.githubusercontent.com/2028198/47217582-d6e91000-d376-11e8-9fb7-86384c57ebbb.png) |

Commits
-------

a556025 Fix DateTimePicker widget
@nicolas-grekas
Copy link
Member

custom formats do not work with type="datetime-local input fields

makes sense!

@xabbuh xabbuh force-pushed the html5-singletext-format-deprecation branch 2 times, most recently from 80a13ad to 3971ecd Compare October 22, 2018 08:01
@xabbuh xabbuh force-pushed the html5-singletext-format-deprecation branch 2 times, most recently from b6ccdd6 to bfe80ac Compare November 20, 2018 08:14
@xabbuh xabbuh force-pushed the html5-singletext-format-deprecation branch from bfe80ac to ebb2d7c Compare November 20, 2018 09:57
@xabbuh xabbuh force-pushed the html5-singletext-format-deprecation branch 2 times, most recently from 804a04d to ea3143e Compare January 5, 2019 16:58
@xabbuh xabbuh force-pushed the html5-singletext-format-deprecation branch from ea3143e to 01f65f4 Compare January 16, 2019 23:05
@xabbuh xabbuh force-pushed the html5-singletext-format-deprecation branch from 01f65f4 to 0823d38 Compare January 27, 2019 20:10
@xabbuh xabbuh force-pushed the html5-singletext-format-deprecation branch from c07d638 to b70c1b6 Compare February 21, 2019 07:52
@xabbuh xabbuh merged commit b70c1b6 into symfony:master Feb 21, 2019
xabbuh added a commit that referenced this pull request Feb 21, 2019
…bbuh)

This PR was merged into the 4.3-dev branch.

Discussion
----------

[Form] deprecate custom formats with HTML5 widgets

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | yes
| Tests pass?   | yes
| Fixed tickets |
| License       | MIT
| Doc PR        | symfony/symfony-docs#10986

Commits
-------

b70c1b6 deprecate custom formats with HTML5 widgets
@xabbuh xabbuh deleted the html5-singletext-format-deprecation branch February 21, 2019 09:42
javiereguiluz added a commit to symfony/symfony-docs that referenced this pull request Mar 7, 2019
This PR was merged into the master branch.

Discussion
----------

format option deprecation for HTML 5 widgets

document the deprecations that will be introduced with symfony/symfony#28723

Commits
-------

f4597bf format option deprecation for HTML 5 widgets
@nicolas-grekas nicolas-grekas modified the milestones: next, 4.3 Apr 30, 2019
@fabpot fabpot mentioned this pull request May 9, 2019
sayjun0505 added a commit to sayjun0505/sym_proj that referenced this pull request Apr 16, 2023
This PR was merged into the master branch.

Discussion
----------

Fix DateTimePicker widget

As spotted here symfony/symfony#28723 (comment) we need to disable `html5` to use a `type="text"` input and make it work again.

| before | after |
| --- | --- |
| ![wrong_datepicker](https://user-images.githubusercontent.com/2028198/47217570-d05a9880-d376-11e8-9e3a-116769569f22.png) | ![correct_datepicker](https://user-images.githubusercontent.com/2028198/47217582-d6e91000-d376-11e8-9fb7-86384c57ebbb.png) |

Commits
-------

a556025 Fix DateTimePicker widget
spider-yamet added a commit to spider-yamet/sym_proj that referenced this pull request Apr 16, 2023
This PR was merged into the master branch.

Discussion
----------

Fix DateTimePicker widget

As spotted here symfony/symfony#28723 (comment) we need to disable `html5` to use a `type="text"` input and make it work again.

| before | after |
| --- | --- |
| ![wrong_datepicker](https://user-images.githubusercontent.com/2028198/47217570-d05a9880-d376-11e8-9e3a-116769569f22.png) | ![correct_datepicker](https://user-images.githubusercontent.com/2028198/47217582-d6e91000-d376-11e8-9fb7-86384c57ebbb.png) |

Commits
-------

a556025 Fix DateTimePicker widget
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants