Q:

Count number of nights between two days of the week

I'm trying to calculate the number of nights between two selected days of the week using jQuery for a booking system, to specify which days of the week people can arrive and depart on.  I have two dropdowns, one for arrival day and one for departure day:
<select required="required" class="daypicker" id="arrivalday" name="arrivalday">
    <option></option>
    <option value="1">Monday</option>
    <option value="2">Tuesday</option>
    <option value="3">Wednesday</option>
    <option value="4">Thursday</option>
    <option value="5">Friday</option>
    <option value="6">Saturday</option>
    <option value="7">Sunday</option>
</select>
<select required="required" class="daypicker" id="departureday" name="departureday">
    <option></option>
    <option value="1">Monday</option>
    <option value="2">Tuesday</option>
    <option value="3">Wednesday</option>
    <option value="4">Thursday</option>
    <option value="5">Friday</option>
    <option value="6">Saturday</option>
    <option value="7">Sunday</option>
</select>

If either of the dropdowns change, it should calculate the number of nights as follows:
arrival = Monday
departure = Friday
number of nights = 4

arrival = Monday
departure = Monday
number of nights = 7

arrival = Friday
departure = Monday
number of nights = 3

This is what I have so far, but nothing is happening:
$(document).ready(function(){    
$(".daypicker").change(function(){
var arrivalday = $("#arrivalday").val();
var departureday = $('#departureday').val();

if (arrivalday == departureday){
$('#numnights').html('7');
} else if (arrivalday < departureday) {
$('#numnights').html(departureday - arrivalday);
} else {
$('#numnights').html(arrivalday- departureday - 1);
}
}).change();
});

Found the issue, the selects are displayed after a user selects an option, so I moved the code into the change function of that option and everything worked as expected. 

A:

You already got it, you just needed to create the container for the output (the numnights element).  
Anyway the code is a little bit cleaner in this way:

$(document).ready(function(){    
    $(".daypicker").on('change', function(){calculateNights();});
});

function calculateNights() {
    var arrivalday = $("#arrivalday").val();
    var departureday = $('#departureday').val();
    var numberNights = departureday - arrivalday;
    numberNights = (numberNights < 1) ?  numberNights + 7 : numberNights;
    $("#numNights").html(numberNights);
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<select required="required" class="daypicker" id="arrivalday" name="arrivalday">
    <option></option>
    <option value="1">Monday</option>
    <option value="2">Tuesday</option>
    <option value="3">Wednesday</option>
    <option value="4">Thursday</option>
    <option value="5">Friday</option>
    <option value="6">Saturday</option>
    <option value="7">Sunday</option>
</select>
<select required="required" class="daypicker" id="departureday" name="departureday">
    <option></option>
    <option value="1">Monday</option>
    <option value="2">Tuesday</option>
    <option value="3">Wednesday</option>
    <option value="4">Thursday</option>
    <option value="5">Friday</option>
    <option value="6">Saturday</option>
    <option value="7">Sunday</option>
</select>
<hr>
<div id="numNights"></div>

Hope it helps!