angularjspickadate

Calendar with only month and year in pickadate js api


Am trying with pickadate datepicker calendar in my application, is that possible to display the calendar with only month and year?

$('#datePicker').pickadate({
      selectMonths: true, // Creates a dropdown to control month
      selectYears: 150, // Creates a dropdown of 15 years to control year
      format: 'mmm-yyyy',
      max: true,
      onSet: function (arg) {
        if ('select' in arg) { //prevent closing on selecting month/year
          this.close();
        }
      }
    });

Solution

  • var from_$input = $('.from_date').pickadate({
        today: 'Ok',
        format: 'mmmm-yyyy',
        min: new Date(),
        formatSubmit: 'yyyy-mm-dd',
        hiddenPrefix: 'prefix__',
        hiddenSuffix: '__suffix',
        selectYears: true,
        selectMonths: true,
      }),