Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Add new Form WeekType #32061
After the first try, I've updated the field to have more options, and be more "straight".
For that I took the choice to update the
I was not sure if it was better to update them or create new ones, WDYT?
Before addind tests and docs, it would be nice to have your first thoughts/comments
Do you need/want a small test repo?
I wonder if we need to support different input formats for this form type. Right now it only supports a string that is in the same format as the one supported by the HTML5 week input type. However, I could imagine that some developers would like to have a kind of structure like an array with a week and a year element.
If we add a form for
If we want to improve the fallback a bit, we could add a
Anyway, I think adding a field type rendering a
Your're right to ask @xabbuh :D
The WIP tag might be too much as, beside the tests, and the questions added in the edit of this PR, I think this one is ready for some reviews.
The subject of the DataTransformers is my main hesitation, should I write the tests now, or wait some feedback?
@dFayet Looking at how the updated transformers would look like, it seems to me that having new transformers would be better. We may then also reconsider the idea that the norm data should be
This PR was merged into the 4.4 branch. Discussion ---------- Add new Form WeekType | Q | A | ------------- | --- | Branch? | 4.4 | Bug fix? | no | New feature? | yes <!-- please update src/**/CHANGELOG.md files --> | BC breaks? | no <!-- see https://symfony.com/bc --> | Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files --> | Tests pass? | yes <!-- please add some, will be required by reviewers --> | Fixed tickets | #32029 | License | MIT | Doc PR | <!--symfony/symfony-docs#...--> coming soon ---- #### Update After the first try, I've updated the field to have more options, and be more "straight". The field acts like the `DateTimeType` or `TimeType`, various fields type (pure text, html5 type, select boxes), data validation, .... For that I took the choice to update the `DateTimeToStringTransformer` and `DateTimeToArrayTransformer` to make them work with weeks format. I was not sure if it was better to update them or create new ones, WDYT? Before addind tests and docs, it would be nice to have your first thoughts/comments
😊Do you need/want a small test repo? Commits ------- c4a2f02 Add new Form WeekType