I\'m struggling in using moment.js library inside an Angular 2 Typescript app. Even after reading the answer to this question I can\'t get it to work.
This is what I did
From your index.html add
In your component use:
declare var moment: any; ... this.startDate = moment().subtract(15, 'days').format('DD-MM-YYYY'); this.endDate = moment().format('DD-MM-YYYY');