1

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

Baba Ranjith
  • 196
  • 14

1 Answers1

2

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)

Harrison
  • 1,654
  • 6
  • 11
  • 19