WordPress.org

Ready to get started?Download WordPress

Forums

Contact Form 7 Datepicker
How do you Blockout Mondays, Wednesdays, Saturdays and Sundays (6 posts)

  1. pylon2000
    Member
    Posted 11 months ago #

    Hi guys and girls,

    I've have a good search around the internet for a way to block out days on the calendar without much luck.

    Can anyone help out a WordPress and JavaScript amateur.

    I just want to block out Mondays, Wednesdays, Saturdays and Sundays.

    Thanks,
    Pylon

    http://wordpress.org/plugins/contact-form-7-datepicker/

  2. kalvinlee
    Member
    Posted 4 months ago #

    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

  3. Rolands Zeltins
    Member
    Posted 4 months ago #

    [ 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!

  4. kalvinlee
    Member
    Posted 4 months ago #

    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!

  5. kalvinlee
    Member
    Posted 4 months ago #

    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!

  6. kalvinlee
    Member
    Posted 3 weeks ago #

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

    http://www.manhattanbridgeortho.com/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.

  7. jan_tresohr
    Member
    Posted 5 days ago #

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

    thnaks in advance, Jan

Reply

You must log in to post.

About this Plugin

About this Topic

Tags

No tags yet.