title: angularjs date format validation on input type date
body: <p>I'm trying to create date using AngularJS and as per the documentation</p>
  
  <blockquote>
    <p>Input with date validation and transformation. In browsers that do not
    yet support the HTML5 date input, a text element will be used. In that
    case, text must be entered in a valid ISO-8601 date format
    (yyyy-MM-dd), for example: 2009-01-06. Since many modern browsers do
    not yet support this input type, it is important to provide cues to
    users on the expected input format via a placeholder or label.</p>
  </blockquote>
  
  <p>it only accepts valid ISO-8601 date format (yyyy-MM-dd).</p>
  
  <p>I've tried to define the new date format in the <code>pattern</code>'s attribute as shown in the following code:</p>
  
  <pre><code>&lt;div ng-app=""&gt;
    &lt;form name="frmSPA" novalidate&gt;
      &lt;input type="date" placeholder="Enter SPA Date" pattern="dd/MM/yyyy" name="SPADate" ng-model="SPADate" ng-required="true" /&gt;
      &lt;span ng-show="frmSPA.SPADate.$touched &amp;&amp; frmSPA.SPADate.$error.required"&gt;SPA Date is required&lt;/span&gt;
      &lt;span ng-show="frmSPA.SPADate.$touched &amp;&amp; frmSPA.SPADate.$error.date"&gt;Not a valid date&lt;/span&gt;
    &lt;/form&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>but it doesn't work.</p>
  
  <p>So how to change the default date format into <code>dd/MM/yyyy</code>. Here is the <a href="https://jsfiddle.net/o8b3dxbn/" rel="nofollow">jsfiddle</a>.</p>