Set Booking Calendar View To Specific Month Via Script

This snippet sets the JetBooking calendar to a specific month, listens for filter events, and updates a user meta field via AJAX after a booking. It integrates JetBooking, JetSmartFilters, and JetEngine to coordinate these actions in a single custom script.

Specifications
Set Booking Calendar View To Specific Month Via Script
7 January, 2026
  • Plugin
    • JetEngine
    • JetSmartFilters
    • JetBooking
  • Category
    • Booking & Appointments
    • Filters & Search
  • Programming languages
    • PHP
    • JavaScript
Source code

Installing Instruction

  1. Copy the provided JavaScript code snippet to your clipboard.
  2. Add the code using one of the following methods:
    1. Option A: Using a Custom Code Plugin (Recommended)
      1. Install and activate a plugin such as WPCode Lite, Code Snippets, or Simple Custom CSS and JS.
      2. Create a new JavaScript snippet.
      3. Paste only the JavaScript code, without <script> tags.
      4. Save and activate the snippet.
    2. Option B: Using a Custom Code / HTML Area
      1. Add the code in a Custom HTML widget or directly into a theme file (for example, header.php or footer.php).
      2. Keep the <script> tags when using this method.
      3. Save your changes.

Example Use Case

Use this snippet to preset and dynamically manage calendar views and filters in JetBooking-based platforms for improved UX. Booking site admins and developers wanting custom calendar behavior will benefit.
Applicable scenarios:

  • Travel and rental booking sites showing default popular booking months.
  • Event booking platforms syncing filters with the calendar view dynamically.
  • Membership or user-driven booking platforms tracking preferences per user.
  • Vacation rental sites optimizing the guest booking experience.
  • Booking managers automating personalized calendar views.
Specifications
Set Booking Calendar View To Specific Month Via Script
7 January, 2026
  • Plugin
    • JetEngine
    • JetSmartFilters
    • JetBooking
  • Category
    • Booking & Appointments
    • Filters & Search
  • Programming languages
    • PHP
    • JavaScript
Source code

Let’s build together

Have your own solution?

Came up with a great solution and want to show it to the Crocoblock community?

Request a new feature

Leave a feature request through GitHub, and our developers will consider it