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
Faisal BahadurFaisal Bahadur 

How can I handle the datepicker event has selected date is change on an ui:inputDate field in Lightning

<ui:inputDate aura:id="dateValue" label="d" change="c.dateHandler" displayDatePicker="true"/> , I noticed the change event is not fired if you select the date via the date picker. ? any other suggestion 
Best Answer chosen by Faisal Bahadur
SkipSaulsSkipSauls
I've replied on the Partner Community, but here it is again as others may find it useful:

You can handle the "change" event on an attribute. In your component or app, add something like this:

    <aura:attribute name="date" type="Date" access="GLOBAL"/>
    <aura:handler name="change" value="{!v.date}" action="{!c.dateChange}"/>    
    <ui:inputDate aura:id="dateValue" value="{!v.date}" label="d" displayDatePicker="true"/>

In the controller add the dateChange function:

    dateChange: function(component, event, helper) {
        console.warn("dateChange");
        var date = component.get("v.date");
        console.warn("date is: ", date);
    }

Let me know if this isn't what you are trying to do.

All Answers

SkipSaulsSkipSauls
I've replied on the Partner Community, but here it is again as others may find it useful:

You can handle the "change" event on an attribute. In your component or app, add something like this:

    <aura:attribute name="date" type="Date" access="GLOBAL"/>
    <aura:handler name="change" value="{!v.date}" action="{!c.dateChange}"/>    
    <ui:inputDate aura:id="dateValue" value="{!v.date}" label="d" displayDatePicker="true"/>

In the controller add the dateChange function:

    dateChange: function(component, event, helper) {
        console.warn("dateChange");
        var date = component.get("v.date");
        console.warn("date is: ", date);
    }

Let me know if this isn't what you are trying to do.
This was selected as the best answer
Faisal BahadurFaisal Bahadur

Hi @SkikpSauls ,

thanks it works for me with little bit changes i just add change event on input field as well.

<ui:inputDate aura:id="dateValue" class="hideinput" label="d"  change="{!c.dateChange}" value="{!v.date}" displayDatePicker="true"/>

Srini GrandhiSrini Grandhi
It did not work for me.