title: How to set custom date programmatically using ng bootstrap & angular 6?
body: <p>Here I am trying to set a date programmatically using <code>ng-bootstrap</code> date picker </p>
  
  <p>I tried some thing like this putting the custom date </p>
  
  <pre><code>this.model= {
    "year": 2018,
    "month": 8,
    "day": 15
  }
  </code></pre>
  
  <p>I know it is not efficient way and there is one issue is that after selecting the giving the date picker is not navigating to that particular month. </p>
  
  <p>Suppose If I choose 2nd jan 2018 then also it is staying in the current month it is not moving to jan. How can i solve these issues?</p>
  
  <p>Below is my code &amp; <a href="https://stackblitz.com/edit/angular-11qnzw" rel="nofollow noreferrer">stack blitz link</a></p>
  
  <p><strong>.ts code</strong></p>
  
  <pre><code>model: NgbDateStruct;
    date: {year: number, month: number};
    constructor(private calendar: NgbCalendar){
  
    }
  
     selectToday() {
      this.model = this.calendar.getToday();
    }
  
    select(){
      this.model= {
    "year": 2018,
    "month": 8,
    "day": 15
  }
  </code></pre>
  
  <p><strong>.html file</strong></p>
  
  <pre><code>&lt;ngb-datepicker #dp [(ngModel)]="model" (navigate)="date = $event.next"&gt;&lt;/ngb-datepicker&gt;
  </code></pre>