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

eshiett1995 pro asked 6 years ago


Mikołaj Smoleński staff answered 6 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


eshiett1995 pro answered 6 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)
    }
})


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

  • ForumUser: Pro
  • Premium support: No
  • Technology: MDB jQuery
  • MDB Version: -
  • Device: -
  • Browser: -
  • OS: -
  • Provided sample code: No
  • Provided link: No
Tags