Darcy Darcy - 1 year ago 105
Javascript Question

HTML input type=date weekdays

Is there any ways to make html input date only allow to pick weekdays calendar?
I wish to prevent past dates as well. Can i do this without using jquery datepicker?

input type="date" name="date" id="date"

Answer Source

You can prevent past dates by setting min attribute.

And I think you cannot disable the weekends with javascript.

var today = new Date().toISOString().split('T')[0];
document.getElementsByName("date")[0].setAttribute('min', today);
<input type="date" name="date" id="date">