I have a requirement wherein the user enters a data and if the date is more than 30 days then I show a validation error msg in lightning component. Below is the code I have done
<aura:attribute name="todayDate" type="date" description="date" default="" />
<lightning:input type="date" aura:id="IssuedDate"
name="IssuedDate" label="Issued Date to" max="{!v.todayDate}"
messageWhenRangeOverflow="Service To Date cannot be greater than 30 days the current date" />
In the Load event of lightning component I am doing as follows:
var todayDate = $A.localizationService.formatDate(new Date(), "YYYY-MM-DD");
component.set("v.todayDate",d.setMonth(1));
But its not working as expected. Please let me know.