1// Use Javascript
2var today = new Date();
3var dd = today.getDate();
4var mm = today.getMonth()+1; //January is 0 so need to add 1 to make it 1!
5var yyyy = today.getFullYear();
6if(dd<10){
7 dd='0'+dd
8}
9if(mm<10){
10 mm='0'+mm
11}
12
13today = yyyy+'-'+mm+'-'+dd;
14document.getElementById("datefield").setAttribute("min", today);