Datepicker - Select input Month and year


Topic: Datepicker - Select input Month and year

mdw asked 5 years ago

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
})

Grzegorz Bujański staff commented 5 years 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 5 years 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 5 years ago

Hi. I can't open this snippet. I thing you create private snippet and i can't open it.


Please insert min. 20 characters.

FREE CONSULTATION

Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.

Status

Open

Specification of the issue
  • User: Free
  • Premium support: No
  • Technology: MDB jQuery
  • MDB Version: 4.18.0
  • Device: All
  • Browser: All
  • OS: All
  • Provided sample code: No
  • Provided link: No
Tags