title: Angular, store only the date using myDatePicker (without epoc part)
body: <p>I need help to format a date input into <code>yyyy-mm-dd</code> when the form is submitted. I'm using <a href="https://github.com/kekeh/mydatepicker" rel="nofollow noreferrer">myDatePicker</a> package. Here is myDatepicker live <a href="http://kekeh.github.io/mydatepicker/" rel="nofollow noreferrer">demo</a>. In the right side we can see there is a field looks like this <code>Formatted: 01 Jan 2018 - epoc: 1514739600</code> when we pick a date (1st Jan of 2018), that's how the format by default. I just need to store the <code>formatted</code> part like the <code>DD MMM YYYY</code> part without the <code>epoc xxx</code> part.</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>form01: FormGroup;
  public myDatePickerOptions: IMyDpOptions = {
    dateFormat: 'dd/mm/yyyy',
  };
  
  setDate(): void {
    let date = new Date();
    this.form01.patchValue({
      DoB: {
        date: {
          year: date.getFullYear(),
          month: date.getMonth() + 1,
          day: date.getDate()
        }
      },
      DateSubmit: {
        date: {
          year: date.getFullYear(),
          month: date.getMonth() + 1,
          day: date.getDate()
        }
      }
    });
  }
  
  clearDate(): void {
    this.form01.patchValue({
      DoB: null,
      DateSubmit: null
    });
  }
  
  constructor(public builder: FormBuilder) {
      this.form01s = this.builder.group({
        DoB: [null, Validators.required],
        DateSubmit: [null, Validators.required]
      })
  
      pushForm01() {
        console.log(this.form01.controls.DoB.value);
        console.log(this.form01.controls.DateSubmit.value);
      }</code></pre>
  </div>
  </div>
  
  Here is what the <code>console.log</code> shows me <code>{date: {…}, jsdate: Sun Jan 28 2018 00:00:00 GMT+0700 (SE Asia Standard Time), formatted: "28/01/2018", epoc: 1517072400}</code>.
  I need to store the format into <code>yyyy-mm-dd</code> without the other part. Can anyone help me with this please?</p>