• Resolved Artneo

    (@artneo)


    Hello,

    We have only one appointment per day.

    Is it possible to block 2 days before and 2 days after?

    Please see this image for an example:

    View post on imgur.com

    If the user books day 11th, then the 13–14th and 16–17th would be blocked. Is this possible with an add-on or custom development?

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter Artneo

    (@artneo)

    I was imagining that something like this would solve this request:

    <script>
    jQuery(document).ready(function($) {
       $('.ui-state-disabled').each(function() {
          $(this).prev().addClass("ui-state-disabled");
          $(this).next().addClass("ui-state-disabled");
       });
    });
    </script>

    But how to run this code only after the calendar has finished loading so it’s possible to target the calendar dates with this script?

    • This reply was modified 2 years ago by Artneo.
    Plugin Author codepeople

    (@codepeople)

    Hi,

    You can run a code with the calendar initialized using a code like this:

    jQuery(document).one("showHideDepEvent", function(){
        (function($) {
             // code to be executed after initializing the calendar
        })(jQuery); 
    });

    … however the code you mention won’t block the 2 days before and 2 days after, something much more complex will be needed since the dates have to be blocked also in the server side after the submission so those dates remain blocked.

    Thank you for using the plugin!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Block future dates if booked a date’ is closed to new replies.