Support » Plugin: Contact Form 7 Datepicker » How do you Blockout Mondays, Wednesdays, Saturdays and Sundays

Viewing 7 replies - 1 through 7 (of 7 total)
  • kalvinlee

    (@kalvinlee)

    I was able to block out certain weekdays on the calendar. however, this was not done using wordpress – you can view it here. Wed, Thurs, and Fridays are blocked out.

    http://www.manhattanbridgeortho.com/contact.php

    I am now trying to redo this site using only wordpress and am having trouble implementing this feature using contact form 7. Any help would be appreciated.

    Thanks,
    KLee

    roulendz

    (@rolands-zeltins)

    [ Moderator note: please wrap code in backticks or use the code button. ]

    <script>
            $(function () {
    
                // 0 = monday, 1 = tuesday, 2 = wednesday, 3 = thursday,
                // 4=friday, 5 = saturday, 6=sunday
    
                var daysToDisable = [3, 4, 5];
    
                $('#appt_date_1').datepicker({
                    beforeShowDay: disableSpecificWeekDays
                });
    
                function disableSpecificWeekDays(date) {
                    var day = date.getDay();
                    for (i = 0; i < daysToDisable.length; i++) {
                        if ($.inArray(day, daysToDisable) != -1) {
                            return [false];
                        }
                    }
                    return [true];
                }
            });
    
        </script>

    Maybe this can help!

    kalvinlee

    (@kalvinlee)

    Thank you so much, this works like a charm. Is there a way to add a few lines of code to block out specific days? I am using the calendar for my customers to pick appointment days, my shop is open on Saturdays, sundays, Mondays, and Tuesdays. However, sometimes we will open up a Friday. I would like to have this reflected on the calendar. Any help would be appreciated!

    kalvinlee

    (@kalvinlee)

    Thank you so much, this works like a charm. Is there a way to add a few lines of code to block out specific days? I am using the calendar for my customers to pick appointment days, my shop is open on Saturdays, sundays, Mondays, and Tuesdays. However, sometimes we will open up a Friday. I would like to have this reflected on the calendar. Any help would be appreciated!

    I recently updated the form – you can see it here:

    Appointment Request

    I could still use some help modifying the above code to add or delete specific days. Sometimes my office is open on Fridays and sometimes we are closed on Saturdays. Thanks in advance for any help or advice on this issue.

    Hello, i want to use the code as well. but were do i have to paste it?

    thnaks in advance, Jan

    I installed this plugin to my wordpress site to add the code.
    http://wordpress.org/plugins/insert-javascript-css/

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘How do you Blockout Mondays, Wednesdays, Saturdays and Sundays’ is closed to new replies.