function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
smita bhargavasmita bhargava 

restrict past dates in lightning:input type=dateTime

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());     

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.

If anybody can sh
VinayVinay (Salesforce Developers) 
Hi Smita,

Review below working examples which can help you.

Vinay Kumar