我的系统是订酒店。
在选择日期时候from(入住日期)和to(离开日期), 我想把离开日期设计为入住日期的后一天,以下是代码,求大神改下,小弟,不懂js。求帮助
----------------------------------------------------------------------
<script src="jquery/ui/jquery.ui.core.js"></script>
<script src="jquery/ui/jquery.ui.widget.js"></script>
<script src="jquery/ui/jquery.ui.datepicker.js"></script>
<script type="text/javascript">
$(function() {
$( "#from" ).datepicker({
onSelect: function( selectedDate ) {
$( "#to" ).datepicker( "option", "minDate", selectedDate );
}
});
$( "#to" ).datepicker({
onSelect: function( selectedDate ) {
$( "#from" ).datepicker( "option", "maxDate", selectedDate );
}
});
var datepicker_CurrentInput = '';
$.datepicker.setDefaults({
showAnim : "show",
defaultDate: "+1w",
changeMonth: true,
changeYear: true,
numberOfMonths: 1,
showButtonPanel: true,
closeText : "Clear"
});
$("button.ui-datepicker-close").live("click", function(){
$.datepicker._clearDate($.datepicker._curInst.input);
});
$('button.ui-datepicker-current').live('click',function(){
$($.datepicker._curInst.input).val($.datepicker._formatDate($.datepicker._curInst));
});
});
</script>
在选择日期时候from(入住日期)和to(离开日期), 我想把离开日期设计为入住日期的后一天,以下是代码,求大神改下,小弟,不懂js。求帮助
----------------------------------------------------------------------
<script src="jquery/ui/jquery.ui.core.js"></script>
<script src="jquery/ui/jquery.ui.widget.js"></script>
<script src="jquery/ui/jquery.ui.datepicker.js"></script>
<script type="text/javascript">
$(function() {
$( "#from" ).datepicker({
onSelect: function( selectedDate ) {
$( "#to" ).datepicker( "option", "minDate", selectedDate );
}
});
$( "#to" ).datepicker({
onSelect: function( selectedDate ) {
$( "#from" ).datepicker( "option", "maxDate", selectedDate );
}
});
var datepicker_CurrentInput = '';
$.datepicker.setDefaults({
showAnim : "show",
defaultDate: "+1w",
changeMonth: true,
changeYear: true,
numberOfMonths: 1,
showButtonPanel: true,
closeText : "Clear"
});
$("button.ui-datepicker-close").live("click", function(){
$.datepicker._clearDate($.datepicker._curInst.input);
});
$('button.ui-datepicker-current').live('click',function(){
$($.datepicker._curInst.input).val($.datepicker._formatDate($.datepicker._curInst));
});
});
</script>