Topic: Datepicker - Select input Month and year
Expected behavior
Is it possible to add selectinput for year and month with the new datepicker version ? When i use $('.datepicker').pickadate(); it works but with the new update $('.datepicker').datepicker({}) it doesn't.
Is it possible to open directly datepicker on input focus with the new version ?
Actual behavior
Actually the new version is not intuitive. For example it's difficult to enter a birthdate without select year input.
Resources (screenshots, code snippets etc.)
$('.datepicker').datepicker({
formatSubmit: 'yyyy-mm-dd',
format: 'dd/mm/yyyy',
selectMonths: true,
selectYears: 100
})
Open
- User: Pro
- Premium support: Yes
- Technology: jQuery
- MDB Version: 4.18.0
- Device: All
- Browser: All
- OS: All
- Provided sample code: No
- Provided link: No
Grzegorz Bujański staff commented 11 months ago
Hi. New datepicker opens only after click the icon. It is not possible to change this behavior and it is not possible to add a separate selectinput for the year and month
lemons commented 11 months ago
Hi, please check my updated snippet: https://mdbootstrap.com/snippets/jquery/lhock/1608686Also I added the ::hover color in css permanently to make it more clear where to change the year. You could do the same for the left & right arrows/chevrons...
@edit: I also added a very simple solution for opening the calendar from clicking the input instead of the icon :)
Grzegorz Bujański staff commented 11 months ago
Hi. I can't open this snippet. I thing you create private snippet and i can't open it.