Input Date
Deprecated as of API version 47.0. We recommend migrating to Lightning Web Components and using the lightning-input component.
Descriptor
ui:inputDateTargets
Lightning Experience, Experience Builder Sites, Salesforce Mobile App, Lightning Out / Visualforce, Standalone Lightning App
Example Options
Using ui:inputDateThis example sets today's date on a ui:inputDate component, retrieves its value, and displays it using ui:outputDate. To apply Lightning Design System styling, we recommend that you use lightning:input with type="date" instead of ui:inputDate. The init handler initializes and sets the date on the component.
Using ui:inputDate
Code
<aura:component> <aura:handler name="init" value="{!this}" action="{!c.doInit}"/> <aura:attribute name="today" type="Date" default=""/> <ui:inputDate aura:id="expdate" label="Today's Date" class="field" value="{!v.today}" displayDatePicker="true" /> <ui:button class="btn" label="Submit" press="{!c.setOutput}"/> <div aura:id="msg" class="hide"> You entered: <ui:outputDate aura:id="oDate" value="" /> </div> </aura:component>