title: Angular 2 - date.getMonth is not a function
body: <p>I'm using this <a href="https://github.com/koleary94/Angular-2-Datepicker" rel="nofollow noreferrer">Angular-2-datepicker</a>. Everything works, however everytime I try to set the [(date)] attribute, it gives me the error.</p>
  
  <blockquote>
    <p>date.getMonth is not a function</p>
  </blockquote>
  
  <p>I've looked up some info and found out it could be because my variable is not of type date, however mine is, so I'm right now I'm stuck and cant find a solution.</p>
  
  <p><strong>My HTML:</strong></p>
  
  <pre><code>...
  &lt;material-datepicker dateFormat="DD-MM-YYYY" weekStart="1" [(date)]="definitionDetails.From"&gt;&lt;/material-datepicker&gt;
  ...
  </code></pre>
  
  <p><strong>My Model:</strong></p>
  
  <pre><code>export class ClosingDayDefinition implements Serializable&lt;ClosingDayDefinition&gt; {
  
      ID: number;
      DescriptionID: number;
      Info: models.DefinitionDetailInfo;
      Description: models.DefinitionDescription;
      CodeId: number;
      From: Date;
      To: Date;
      Recurring: boolean;
      Holiday: boolean;
      Groups: Array&lt;models.ClosingDayGroup&gt;;
      TypeName: string;
  </code></pre>
  
  <p><strong>My Component:</strong></p>
  
  <pre><code>...
  public definitionDetails: models.ClosingDayDefinition;
  ...
  </code></pre>
  
  <p><strong>Var Log:</strong></p>
  
  <p><a href="https://i.stack.imgur.com/Wtpeq.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Wtpeq.png" alt="enter image description here"></a></p>