简体   繁体   中英

setting max date and min date in html 3months max

<input type='date' class="form-control" id ="datepicker11" />

 <script> $('#datepicker11').datepicker({   maxDate: '+3m',   minDate: '+1d' })  </script>

我只想将最小日期设置为从当前日期开始的一天,将最大值设置为从当前日期开始的3个月。

You can do this as follows:

$(function() {

    $( "#datepicker11" ).datepicker({ 
        changeYear: true,
        minDate: '+1D',
        maxDate: '+3M',
    });
});

here is working Fiddle

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM