0

I am using the calender from the link: http://razum.si/jQuery-calendar/TimeCalendar.html

but i want one extra function setting min and max date range.

i have two input feilds and set the range with one another.

in my JS i have like this

$("#datepicker1").calendar({ fieldSettings :customRange});
$("#datepicker2").calendar({ fieldSettings :customRange});

function customRange(input) {
    return { 
        minDate : (input.id == 'datepicker2' ? (getDate(jq11('#datepicker1').val())) : null),
        maxDate :(input.id == 'datepicker1' ? (getDate(jq11('#datepicker2').val())) : null)
    } 
}

but it is not working. Please help me

Thanks in advance

4

1 回答 1

0

如果要限制日期范围,可以使用jqueryuiDatepicker中的小部件。页面上有完整的代码示例,但我将粘贴其用法的摘录:

<script>
  $(function() {
    $( "#datepicker" ).datepicker({ minDate: -20, maxDate: "+1M +10D" });
  });
</script>
于 2013-01-29T08:34:04.600 回答