Skip to content

Instantly share code, notes, and snippets.

@LaxusCroco
Last active November 15, 2023 14:29
Show Gist options
  • Save LaxusCroco/c8868d6750918ce3717ebe201c0a8af5 to your computer and use it in GitHub Desktop.
Save LaxusCroco/c8868d6750918ce3717ebe201c0a8af5 to your computer and use it in GitHub Desktop.
Allow reservations only one year in advance.
<?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 = moment().add(1, 'y').subtract( 1, 'd' ).format( config.format );
return config;
}
} );
</script>
<?php } );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment