You need to sign in to do that
Don't have an account?
Rahul Chauhan 33
I want to apply validate on Lightning Input date field. How can i achieve this..??
My requirement is to apply validation for lightning Input date filed that user can select only today or yesterday date ..??
How can i achieve this
Thnks in advance..!!
How can i achieve this
Thnks in advance..!!
<lightning:input aura:id="yesterday" class="slds-size_1-of-4" name="Work Day" type="date" label="Workday" max="{!v.today}" messageWhenBadInput="You cannot fill old date time entry" value="{!v.work}" format="DD-MM-YYYY" required="true" /> Js controller: var pastday =component.find("v.yesterday"); var fordate =pastday.get("v.value"); if(pastday< $today.getDate()-1){ pastday.set("v.errors", [{message:" You cannot fill time sheet of previous day "}]); }
Refer this link
http://sfdcmonkey.com/2017/12/26/validation-past-date-lightning-component/