How do i configure the date picker to only show months and y


Topic: How do i configure the date picker to only show months and years

eshiett1995 pro asked 7 years ago

eshiett1995 pro answered 7 years ago

by using the on "set" event and calling the pickadate('picker').get('value') method.

var input = $('.datepicker').pickadate();

input.pickadate('picker').on('set', function(event) {
    if ( event.select ) {
        alert('it worked');

        alert(input.pickadate('picker').get('select'));

        console.log(input.pickadate('picker').get('select'));

        alert(input.pickadate('picker').get('value'));
    }
    else if ( 'clear' in event ) {
        //to_picker.set('min', false)
    }
})

Mikołaj Smoleński staff answered 7 years ago

Hi,

You can't disable days from date picker. Instead I suggest to make two selects - first with months and second with years.

Regards


Please insert min. 20 characters.

FREE CONSULTATION

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

Status

Answered

Specification of the issue
  • User: Pro
  • Premium support: No
  • Technology: MDB jQuery
  • MDB Version: -
  • Device: -
  • Browser: -
  • OS: -
  • Provided sample code: No
  • Provided link: No