Skip to content

Instantly share code, notes, and snippets.

@LaxusCroco
Created November 15, 2023 14:22
Show Gist options
  • Save LaxusCroco/04201ab03f7649acc98992b7d7a4b135 to your computer and use it in GitHub Desktop.
Save LaxusCroco/04201ab03f7649acc98992b7d7a4b135 to your computer and use it in GitHub Desktop.
Set the last available date in the JetBooking calendar. Change the '2023-12-31' to the needed date
<?php
add_action( 'wp_head', function () { ?>
<script>
jQuery( document ).on( 'jet-booking/init', () => {
window.jetBookingState.filters.add( "jet-booking/input/config", modifyBookingConfig );
window.jetBookingState.filters.add( "jet-booking/calendar/config", modifyBookingConfig );
function modifyBookingConfig( config ) {
config.endDate = '2023-12-31';
return config;
}
} );
</script>
<?php } );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment