如何禁用未来日期(日期范围01/04/2015至2016年3月31日)但不需要24/06 / 2015,25 / 06/2015等(从今天开始)

时间:2015-06-24 12:33:22

标签: javascript jquery date datepicker

我不需要将来的日期,包括从日期开始的日期范围

$(function() {
        var financial_year=2015-2016;
        //financial_year=document.getElementById("financial_year").value;   
        var first = financial_year.substring(0, 4);
        var second = financial_year.substring(5, 9);
        var minYear=first;
        var maxYear=second;
        $( "#datepicker" ).datepicker({ 
            changeYear: true,
             dateFormat: "dd/mm/yy",
             changeMonth: true,
             changeYear: true,
             minDate: new Date(minYear,3,01),
             maxDate: new Date(maxYear,3,01),
             dateFormat: "dd/mm/yy"
         });
    });

请告诉我

1 个答案:

答案 0 :(得分:0)

您可以实施自己的beforeShowDay option

与此http://davidwalsh.name/jquery-datepicker-disable-days

类似
ContentControl

您也可以将其写入禁用日期范围:

       inputSearch.addTextChangedListener(new TextWatcher() {

        @Override
        public void onTextChanged(CharSequence s, int start, int before,
                int count) {
            // TODO Auto-generated method stub
            adapter_members.getFilter().filter(s.toString());
        }

        @Override
        public void beforeTextChanged(CharSequence s, int start, int count,
                int after) {
            // TODO Auto-generated method stub

        }

        @Override
        public void afterTextChanged(Editable s) {
            // TODO Auto-generated method stub

        }