You need to sign in to do that
Don't have an account?
smita bhargava
restrict past dates in lightning:input type=dateTime
Hello
My requirement is to restrict the past dates to the user, so it show start with the current date only.
I have as follows inside lightning component::
<aura:attribute name="todayDate" type="Date" description="Today's Date"/>
<lightning:input type="datetime" aura:id ="dateTime" label="Follow Up Date and Time" name="date" min="{!v.todayDate}"/>
doInit : function(component, event, helper) {
component.set("v.todayDate",new Date());
alert(component.get("v.todayDate"));
}
so when the component loads it will NOT show previous dates but only the current date to the user.Please let me know why this isn't working?
If any change in the markup I have to do pls let me know without too much coding in the controller.
Thanks
smita
If anybody can sh
My requirement is to restrict the past dates to the user, so it show start with the current date only.
I have as follows inside lightning component::
<aura:attribute name="todayDate" type="Date" description="Today's Date"/>
<lightning:input type="datetime" aura:id ="dateTime" label="Follow Up Date and Time" name="date" min="{!v.todayDate}"/>
doInit : function(component, event, helper) {
component.set("v.todayDate",new Date());
alert(component.get("v.todayDate"));
}
so when the component loads it will NOT show previous dates but only the current date to the user.Please let me know why this isn't working?
If any change in the markup I have to do pls let me know without too much coding in the controller.
Thanks
smita
If anybody can sh
Review below working examples which can help you.
https://salesforce.stackexchange.com/questions/229171/lightning-input-datetime-prevent-value-issue
https://sfdcmonkey.com/2018/02/23/restrict-past-dates-lightning-component/
https://salesforce.stackexchange.com/questions/313388/restrict-past-dates-in-lightninginput
Thanks,
Vinay Kumar