-
-
Save spencerfinnell/831a11769868b7f60cbeb55b6408bd13 to your computer and use it in GitHub Desktop.
This file contains 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
jQuery( function( $ ) { | |
var start, end, nights; | |
$( '.simpay-date-input' ).datepicker( 'option', 'onSelect', function() { | |
startVal = $( '#simpay-10-date-6' ).val(); | |
endVal = $( '#simpay-10-date-7' ).val(); | |
if ( '' !== startVal && '' !== endVal ) { | |
start = new Date( startVal ); | |
end = new Date( endVal ); | |
nights = end.getDate() - start.getDate(); | |
alert( 'Nights ' + nights ); | |
// Determine further pricing based on nights. | |
} | |
} ); | |
} ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment