WPRentals Theme Documentation WPRentals Theme Documentation

  • Client Support
  • Video Tutorials
  • WPRentals
  • WPEstate
  • API
Home / Technical how to / Technical: How to limit calendar in booking form

Technical: How to limit calendar in booking form

7939 views

 

To limit the number of months on the booking form from the property page you must do the following
In js/property.js file

Look for the function check_in_out_enable2 (should be around line 150) and add this piece of code  – replace 3 with your number of Months

var futureMonth = moment(today).add(3, 'M');

The above code will be one that limits the number of months.

After that  add

maxDate:futureMonth,

in the options object – should end up with something like

var options = {
opens:calendar_opens,
singleDatePicker: false,
autoApply: true,
alwaysShowCalendars: true,
autoUpdateInput: false,
minDate:today,
maxDate:futureMonth,
locale:{
daysOfWeek:dayNamesShort,
monthNames:longmonths
},
isCustomDate:wpestate_booking_show_booked,
};

 

To limit the calendar in the search form:

The change needs to be done in \wprentals\js\control.js

 

 

Technical how to

Related Articles

  • How to add a new currency in Theme Options for payments.
  • How to Disable WordPress Image Compression and Preserve Original Quality
  • How to Change the Default Categories Icon from Listing Card Unit
  • How to change the background color and logo for admin login page

HELP CATEGORIES

  • 71. General
  • 102. Installation & Basic Setup
  • 393. How Booking Works
  • 20Advanced Search
  • 18Elementor Free & WP Rentals Studio
  • 14Email Notifications
  • 22FAQ
  • 15Installation FAQ
  • 10Menu Options
  • 27Multi-Languages - 3rd party
  • 34Owner & Renter
  • 9Page Templates
  • 23Property / Listing
  • 22Shortcodes
  • 4Supported Maps
  • 98Technical how to
  • 5Third Party plugins
  • 3Translation
  • 3WordPress Blog Post
  • 13WordPress Widgets
  • 13WP Rentals Payments
  • 80WP Rentals Theme Options

Join Us On

Powered by WP Estate - All Rights Reserved
  • Client Support
  • Video Tutorials
  • WPRentals
  • WPEstate
  • API