﻿$().ready(function() {
    $('#ChkIn, #ChkOut').datepicker({
        numberOfMonths: 1,
        showButtonPanel: false,
        beforeShow: customRange,
        dateFormat: 'dd/mm/yy',
        showOn: 'focus',
		buttonImage: '',
        buttonImageOnly: true
    });
});
function customRange(a) {
    var b = new Date();
    var c = new Date(b.getFullYear(), b.getMonth(), b.getDate()+2);
    if (a.id == 'ChkOut') {
        if ($('#ChkIn').datepicker('getDate') != null) {
            c = $('#ChkIn').datepicker('getDate');
        }
    }
    return {
        minDate: c
    }
}
