title: Not validating two dates,Even if both are of date type using angular js
body: <p>I know its too silly to ask this,But am confused y is this not working.Even though every values looks fine in debug mode.</p>
  
  <p>Actually what I want to achieve is to display error if <code>productionStartFrom</code> is less than current date.</p>
  
  <p><strong>Controller</strong></p>
  
  <pre><code>scope.currentDate={};
  scope.checkDate=function(productionStartFrom){
            currentDate = $filter('date')(new Date(), "dd/MM/yyyy", "UTC");
            console.log(currentDate); //28/04/2017
            console.log(productionStartFrom); //05/04/2017
            if(currentDate &gt; productionStartFrom){
                scope.dateErrMsg="Date cant be less than today";
                alert("Invalid Date");
                scope.myForm.$invalid="true";
            }
            else if(currentDate &lt; productionStartFrom){
                scope.dateErrMsg="";
            }
      }
  </code></pre>
  
  <p><strong>html page</strong></p>
  
  <pre><code>&lt;datepicker date-format="dd/MM/yyyy" selector="form-control"&gt;
  &lt;input name="productionStartFrom" type="text" ng-model="produce.productionStartFrom"                                                                                  pattern="(0[1-9]|1[0-9]|2[0-9]|3[01])/(0[1-9]|1[012])/[0-9]{4}"
  ng-minlength="10" maxlength="10" x-ng-change="checkDate(produce.productionStartFrom)"                                /&gt; &lt;/datepicker&gt;
  </code></pre>