You must Sign In to post a response.
  • Category: [Competition Entries]

    How to disable specific months of a particular year in Jquery Month Picker

    i tried to disable months using jquery.mtz.monthpicker.js (https://github.com/lucianocosta/jquery.mtz.monthpicker/blob/master/jquery.mtz.monthpicker.js), but it disables specific months for all years, i want to disbale months of specific year.
    My Code

    function Disablemonth() {

    $("#monthpick").monthpicker({
    pattern: 'mm.yyyy'

    });


    $("monthpick").monthpicker('disableMonths', [06, 08, 11, 3]);

    }
  • #764717
    Hi,

    If you want to disable particular month dates then refer below sample


    $("#txtdatepicker").datepicker({
    beforeShowDay: function(date) {
    var month = date.getMonth()+1;
    var day = date.getDate();
    return [!(month == 8 || month == 6), ""];
    }
    });


    --------------------------------------------------------------------------------
    Give respect to your work, Instead of trying to impress your boss.

    N@veen
    Blog : http://naveens-dotnet.blogspot.in/

  • #764738
    Hi,

    I guess you have any ready made made code for such purpose. You may write your own CSS to disable the months of your choice on a particular year.

    Just to give lights on in this topic, go through the code to disable each day. May be you can expand the same code for your requirement,
    https://davidwalsh.name/jquery-datepicker-disable-days


    Regards,
    Asheej T K
    Microsoft MVP[ASP.NET/IIS]
    DotNetSpider MVM


Sign In to post your comments