LWC lightnig input type date max value dynamically I'm trying to add max Date as 2 years from now. Getting the error ass add_years is not defined
Any suggestion would be great..
Html:
<lightning-input class="dateBoxWidth" type="date" date-style="short" value={select.recordValue} onchange={handleChnage} min={todayDate} max={renewExpiryDate}></lightning-input>
<lightning-input class="dateBoxWidth" type="date" date-style="short" value={select.recordValue} onchange={handleChnage} min={todayDate} max={renewExpiryDate}></lightning-input>
js:
var newDate = new Date();
this.todayDate = newDate.toLocaleDateString();
var ExpiryDate = new Date();
this.renewExpiryDate = add_years(ExpiryDate, 2).toLocaleDateString();
add_years()
defined? If you have defined it at class level, then call it usingthis.
– rahul gawale Oct 18 '20 at 8:42