I am trying to get two dates from two calendars with jquery
how can I do this.
the code:
<div id="checklinkform" data-role="fieldcontain">
<label for="checkin">Date dΓ©but :</label></td>
<input name="checkin" id="checkin" data-role="datebox" type="date" data-mini="true"
data-options='{"closeCallback":"linkedCheckin", "noButton": false, "closeCallbackArgs":["checkin"], "mode": "calbox", "focusMode": true, "centerWindow": true, "afterToday": false, "beforeToday":true}'>
<input name="checkin_monthday" type="hidden" size="2" id="checkin_monthday" data-mini="true"/>
<input name="checkin_year_month" type="hidden" size="7" id="checkin_year_month" data-mini="true"/>
<label for="checkout">Date fin :</label></td>
<input name="checkout" id="checkout" data-role="datebox" type="date" data-mini="true"
data-options='{"calHighToday":false, "closeCallback":"linkedCheckin", "noButton": false, "closeCallbackArgs":["checkout"], "mode": "calbox", "focusMode": true, "centerWindow": true}'>
<input name="checkout_monthday" type="hidden" size="2" id="checkout_monthday" data-mini="true"/>
<input name="checkout_year_month" type="hidden" size="7" id="checkout_year_month" data-mini="true"/>
</div>
Change
there is a cheklinkform function that im uses:
linkedCheckin = function (date, name) {
var self = this,
nextday = date.copymod([0,0,1]);
today = new Date();
diff = parseInt((date - today) / ( 1000 * 60 * 60 * 24 ),10);
diffstrt = (diff * -1)-2;
$('#'+name+'_year_month').val(self._formatter('%Y-%m', date));
$('#'+name+'_monthday').val(self._formatter('%d', date));
$('#checkoutput').text($('#checklinkform input').serialize());
if ( name === "checkin" ) {
$('#checkout').data('datebox').theDate = nextday;
$('#checkout').trigger('datebox', {'method':'doset'});
$('#checkout').datebox({"minDays": diffstrt});
$('#checkout').datebox('open');
}
}
I would like to get a 2nd day to send them another function
source
share