简体   繁体   中英

how to set default date in jQuery UI datepicker

i want to configure jQuery UI that they never set date who already gone. means only futurewise date allowed or the value i want to set is now. means current [today]'s date.

$("#datepicker").datepicker({ minDate : new Date(Date.now()), defaultDate: new Date(Date.now()) });

how i can set default date because code i posted not worked

<script type="text/javascript">
var d=new Date();
var today = (d.getMonth() + 1) + "/" + d.getDate() + "/" + d.getFullYear();
$(function() {               
    $("#birthdate" ).datepicker({
        defaultDate: today
    });
});
</script>

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