Last active
November 15, 2023 14:29
-
-
Save LaxusCroco/c8868d6750918ce3717ebe201c0a8af5 to your computer and use it in GitHub Desktop.
Allow reservations only one year in advance.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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