• Resolved ryan36

    (@ryan36)


    I just bought the pro version of the plugin and I’m trying to disable specific days. For example I’m need to disable Sunday, Monday, Tuesday and also specific dates like 7/4/20 or 12/25/20. I there a way to do this?

    I realize that there are some code snippets provided, but when I add two of them, one will override the other.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Fahad Mahmood

    (@fahadmahmood)

    Correct, it will overwrite, so we have to manage within one function as mentioned in provided samples.

    @ryan36 you can disable specific days by adding coma separated dates of those days in this code:

    function (date) { 
    var array = ["2020-12-25","2025-12-25","2030-12-25"]; 
    var string = jQuery.datepicker.formatDate("yy-mm-dd", date); 
    return [ array.indexOf(string) == -1 ]; 
    }

    @raissufyan Function given below will work the same as you want. You can add more dates in the array you want to disable or change the dates as per your requirements.

    Thanks

    
    function (date) {
     var day = date.getDay();
    var array = ["2020-07-04","2020-12-25"]; 
    var string = jQuery.datepicker.formatDate("yy-mm-dd", date); 
    var sunday = 0;
    var monday =1;
    var tuesday = 2;
     return [(day != sunday && day != monday && day != tuesday && array.indexOf(string) == -1)];
     }
    Thread Starter ryan36

    (@ryan36)

    I appreciate the fast responses. Thanks @abdulrazzaq4085 , that snippet was exactly what I was looking for.

    Plugin Author Fahad Mahmood

    (@fahadmahmood)

    Thank you everybody @ryan36 @abdulrazzaq4085 @raissufyan

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Disabling Specific Dates: Pro Version’ is closed to new replies.