Linking DateBoxes

The most requested bit of coding for DateBox is to link a pair of DateBoxes in a meaningful way - for instance a check in and check out date. Below is a brief bit of code that does exactly that.

HTML Source Code

<div class="form-group">
  <label for="in_date">Check In Date</label>
  <input id="in_date" data-role="datebox" type="text" data-options='{
<div class="form-group">
  <label for="out_date">Check Out Date</label>
  <input id="out_date" data-role="datebox" data-options='{"mode":"calbox"}' type="text">

jQuery Source Code

function linker(obby, nextDatebox) {
  // Access the returned date
  var setDate =;
  // Add one day to set date
  // Format the date for min/max attribute
  minDate = this.callFormat('%Y-%m-%d', setDate);
  // Set min date on "next" datebox
  $('#'+nextDatebox).attr('min', minDate);
  // Call datebox method to read new min date
  // Open "next" datebox