Check out example codes for "stackoverflow ngbdate angular". It will help you in understanding the concepts better.

Code Example 1

import {NgbCalendar, NgbDate} from "@ng-bootstrap/ng-bootstrap";
fromDate: NgbDate;
toDate: NgbDate;
constructor(calendar: NgbCalendar) {
    this.fromDate = calendar.getToday();
    this.toDate = calendar.getNext(calendar.getToday(), 'd', 10);
    }

Learn ReactJs, React Native from akashmittal.com