• Resolved chrishaydon

    (@chrishaydon)


    NB: This is a link to my test site

    The problem is that when the booking form loads up (from BOOK NOW) it populates with the correct date but ignores the scheduling rules.

    If from within the booking form you open the date calendar and select exactly the same date it then reverts to the scheduling.

    =====
    Booking schedule: open each day with reservations every 30 minutes between 6pm and 9pm
    Event 01: exception set up to only allow 6.30pm and 8.30pm bookings

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

Viewing 5 replies - 1 through 5 (of 5 total)
  • Hi @chrishaydon,

    It looks like you have some custom code that is selecting a specific date when the page is loaded. Can you share that code with me? Usually, after updating the date, you have to run the following JS method to update the time:

    
    rtb_booking_form.update_timepicker_range();
    
    • This reply was modified 8 years, 2 months ago by NateWr.
    Thread Starter chrishaydon

    (@chrishaydon)

    Hi Nate – thanks for the response.

    We’ve tried running that code as suggested but it didn’t work and gave an error – i think you would be able to see the error in console on the site. Ideally, we need more context of what to do if you can provide it?

    Hi @chrishaydon,

    If you can share the custom code you’re using to select a specific date when the page is loaded and update the timepicker, I’ll take a look and see if I can spot what’s going wrong.

    Thread Starter chrishaydon

    (@chrishaydon)

    Hi @natewr

    My developer says you can see the code in the footer of the page;

    $(‘input[name=”rtb-date”]’).val(Cookies.get(‘rtbdate’));
    $(‘input#rtb-date’).val(Cookies.get(‘rtbdate’));

    He also says that calling the code you suggested after these lines did not work.

    Hope that makes sense!

    Chris

    Hi Chris,

    That code will modify the input value, but you’ll need to access the pickadate control itself which is processing the date and time picker handlers. The datepicker can be accessed at:

    
    rtb_booking_form.datepicker
    

    This is an instance of the pickadate.js control, which is referred to as picker in the docs. Here in the docs you can see how to set a date:

    http://amsul.ca/pickadate.js/api/#method-set-select

    So I’d recommend your developer sets the date and then updates the time picker like this:

    
    rtb_booking_form.datepicker.set('select', [2015, 3, 20]);
    rtb_booking_form.update_timepicker_range();
    
Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Ignoring booking schedule rules’ is closed to new replies.