title: MomentJs: How to convert string to date in Typescript?
body: <p>Im implementing Ag Gird in Angular 2. I have a date column and sorting of dates and Ag grid expects type of date in the format only. Thus I had to send it in the form of date for rendering. But my input is string.
  I have my dateString in the format 2017-01-19. I'm doing</p>
  
  <pre><code>let myDate:Date = moment(dateString).toDate();
  </code></pre>
  
  <p>But it's givimg me output as Thu Jan 19 2017 00:00 Indian Standard Time. I tried like this too</p>
  
  <pre><code>let myDate:Date = moment(dateString).format("DD/MM/YYYY");
  </code></pre>
  
  <p>This gives me error- string is not assignable to Date.</p>
  
  <p>Tried like this too</p>
  
  <pre><code>let myDate:Date = moment(dateString,"DD/MM/YYYY");
  </code></pre>
  
  <p>But no luck.
  What I want is, type of the output as date and in the form 19-01-2017</p>
  
  <p>Please suggest</p>