Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #725820

    Hi, similar to this post, I would like to disable specific dates in the datepicker, say 2016-12-26. Can you help out? Grazie!

    • This topic was modified 7 years, 11 months ago by lijndiensten. Reason: sent to early :/
    #727137

    Hey lijndiensten,

    Please replace

    beforeShowDay: function(date) {
    var day = date.getDay();
    return [(day != 2)];
    },

    with following one

                        beforeShowDay: function(date) {
                        var day = date.getDay();
                        function IsChristmas(date) {
                        var day = date.getDate();
                        var month = date.getMonth() + 1;
                        return (day === 26 && month === 12);
                        }
                        return [(day != 0 && !IsChristmas(date))];
                    },

    Best regards,
    Yigit

    #727217

    Hi Yigit,

    Thanks a lot for your help. This blocks Dec. 26, but does not block Tuesdays. Is there a way to do both?

    Thanks,
    Ivan

    #727224

    Hey!

    Oh sorry. Please change the code to following one

                        beforeShowDay: function(date) {
                        var day = date.getDay();
                        function IsChristmas(date) {
                        var day = date.getDate();
                        var month = date.getMonth() + 1;
                        return (day === 26 && month === 12);
                        }
                        return [(day != 2 && !IsChristmas(date))];
                    },

    Cheers!
    Yigit

    #727238

    You are my javascript-hero, many thanks.

    Enjoy the holidays :)
    Ivan

    #727240

    Hey!

    You are welcome! :)

    For your information, you can take a look at Enfold documentation here – http://kriesi.at/documentation/enfold/
    And if there are features that you wish Enfold had, you can request them and vote the requested ones here – https://kriesi.at/support/enfold-feature-requests/
    For any other questions or issues, feel free to post them here on the forum and we will gladly try to help you :)

    Happy holidays!

    Regards,
    Yigit

Viewing 6 posts - 1 through 6 (of 6 total)
  • The topic ‘Disable specific dates in datepicker’ is closed to new replies.