-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feature #3530 Render date and time fields using native form widgets b…
…y default (javiereguiluz) This PR was merged into the 3.0.x-dev branch. Discussion ---------- Render date and time fields using native form widgets by default EasyAdmin displays by default the date/time/datetime fields using the default Symfony Forms design (i.e. using `<select>` choices). The main issue is that the year is limited to +/- 5 years, which is not very useful in most apps: ![image](https://user-images.githubusercontent.com/73419/87225950-fae15600-c390-11ea-924f-a1b68e955d1a.png) So, this PR adds 3 new config methods for date/time/datetime fields: ```php ->renderAsNativeWidget() // HTML5 native widget ->renderAsChoice() // <select> lists ->renderAsText() // single input[text] ``` By default, all these fields are now rendered using HTML5 native widgets: ![image](https://user-images.githubusercontent.com/73419/87225992-3714b680-c391-11ea-9e21-87bb7f2bd8ef.png) Thanks to browsers improvements, we no longer need JavaScript datepickers, because native widgets are great and are localized into the users language: ![image](https://user-images.githubusercontent.com/73419/87226011-4f84d100-c391-11ea-9bf0-ac16abc7671e.png) Commits ------- 464f59c Render date and time fields using native form widgets by default
- Loading branch information
Showing
6 changed files
with
159 additions
and
4 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Large diffs are not rendered by default.
Oops, something went wrong.