I've got two jQuery UI datepickers and when they've both had dates chosen, I'd like the difference between these dates to be displayed in a separate input[type="text"]
as soon as the second date is selected.
Also, I'd ideally like my count to subtract any weekend days and just count days from Monday - Friday.
My (relevant) code is as follows:
JS:
$('#firstday, #lastday').datepicker({
dateFormat: 'dd/mm/yy'
});
XHTML:
<label for="firstday">First Day of Leave</label>
<input type="text" name="firstday" id="firstday" />
<label for="lastday">Last Day of Leave</label>
<input type="text" name="lastday" id="lastday" />
<label for="totaldays">Total Days</label>
<input type="text" name="totaldays" id="totaldays" />
Lots of searching has led me to lots of different solutions, none of which I can get to work as I'd like so any ideas would be appreciated.