В js я совсем новичек, вот такой вот код получился)
<form>
<input type="date" id="calendarForTasks">
</form>
<script type="text/javascript">
function showCurrentDate()
{
var getCurrentDay = new Date();
var year = getCurrentDay.getFullYear();
var month = '';
var month1 = getCurrentDay.getMonth() + 1;
if(month1 < 10){
month = '0' + month1 ;
}else{
month = month1;
}
var day = '';
if(getCurrentDay.getDate() < 10){
day = '0' + getCurrentDay.getDate();
}
else{
day = getCurrentDay.getDate();
}
var value1 = year + "-" + month + "-" + day ;
value1.toString();
var valueOld = document.getElementById("calendarForTasks");
valueOld.setAttribute('value', value1);
}
showCurrentDate();
</script>