How should I disable past dates in the datepicker only using HTML?
Example: Suppose today it's 2000/12/21, this is how the datepicker should look.
HTML5 supports the min and max attribute.
Play around with the example below and you'll understand how it works!
Enter a date before 2000-12-21:
<input type="date" name="example1" max="2000-12-20"><br>
Enter a date after 2000-12-21:
<input type="date" name="example2" min="2000-12-22"><br>
Just use PHP to automatically update the datepicker to the current date:
<input type="date" name="example3" min="<?= date('Y-m-d') ?>">
NOTE: Internet Explorer 9 (and lower) doesn't support this feature.
<input type="date" name="example3" min="{{ 'now'|date('Y-m-d') }}">