Home > Mobile >  Disable next 1 month MonthPicker
Disable next 1 month MonthPicker

Time:11-26

I need to disable till Next 1 month. please help me out

$(".input-monthpicker-freezelastyear").datepicker({
        format: "mm-yyyy",
        viewMode: "months",
        minViewMode: "months",
        startDate: new Date(),
        autoclose: true
    });


my code look like this

CodePudding user response:

To push the date by 1 whole month you could do something like this:

// Get Date now
const date = new Date()
// Set the month exactly one more from now
date.setMonth(date.getMonth() 1)

console.log(date);

Or wrap it into a function to use elswhere like this answer (answer's source)

  • Related