Customizing Month Scrolling: Different Number for Specific Calendar

You can customize the number of months to scroll using JavaScript, allowing for different settings than the general configuration defined in option "Number of months to scroll" at WP Booking Calendar > Settings General page in the "Calendar" section.

To do this:

1) Add a Custom HTML block to your website near your Booking Calendar block. This block allows you to insert JavaScript code into your page.

2) If, for example, you have a booking resource with ID = 4 and need to set the number of months to scroll as 2 years, you can use the following JavaScript code:

Example #1

<script type="text/javascript">
    var my_resource_id = 4;                                                                      /* Defining ID of booking resource - calendar */
    _wpbc.calendar__set_param_value( my_resource_id,'booking_max_monthes_in_calendar','2y' );    /* Defining number of months to  scroll. Can be Years: '4y' or Months: '6m' */
    wpbc_cal__re_init( my_resource_id );                                                         /* Update look  of calendar */
</script>

To set the number of months to scroll as 5 months for the booking resource with ID = 1 (which is the default booking resource in the Booking Free version), you can use the following code:

Example #2

<script type="text/javascript">
    var my_resource_id = 1;                                                                      /* Defining ID of booking resource - calendar */
    _wpbc.calendar__set_param_value( my_resource_id,'booking_max_monthes_in_calendar','5m' );    /* Defining number of months to  scroll. Can be Years: '4y' or Months: '6m' */
    wpbc_cal__re_init( my_resource_id );                                                         /* Update look  of calendar */
</script>

These scripts allow you to customize the scrolling behavior for specific booking resources on your website.