I would like to block my user from selecting a date that happened in the past in a lightning-input of type date. For this I would like to use the min attribute of the type date.
This is the html code for the lightning-input :
<lightning-input name="fromDate" label='From Date' type="date" min={todaysDate} onchange=dateEventHandler}
value={fromDate} date-style="short" required>
</lightning-input>
And here is the js code to get the date
get todaysDate() {
var today = new Date();
return today.toISOString();
}
Unfortunately, it doesn't work when I select the current date :
Any Idea how to solve it ?