Last active
February 24, 2023 08:17
-
-
Save MjHead/014ddfff08c78d055d5190c90d3c8ed2 to your computer and use it in GitHub Desktop.
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_footer', function() { | |
echo '<script> | |
jQuery( document ).on( "jet-booking/init-field", ( $event, $field ) => { | |
var silent = false; | |
var format = $field.data( "format" ) || "YYYY-MM-DD"; | |
$field.bind( "datepicker-change", ( event, obj ) => { | |
silent = ! silent; | |
if ( silent ) { | |
$field.data( "dateRangePicker" ).setEnd( moment( obj.date1 ).add( 7, "d" ).format( "YYYY-MM-DD" ) ); | |
} | |
} ); | |
} ); | |
</script>'; | |
}, 99 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment