I have been using Angular for only a week now, and in my Angular 7 application I have integrated an owl date picker. The issue I am facing is that after selecting a date from the date picker, I need to increment it by 3 months. Let's assume that 'Value' represents the selected date. However, whenever I try executing value.getMonth()
, it always returns 11. To resolve this problem, I attempted utilizing moment.js.
import * as moment from 'moment'
..........
newDate :moment.Moment
newDate= value
constructor(){
this.newDate .add(3,'months');
}
This code unfortunately results in an error: "_this.nwrdate.add is not a function". I feel stuck at this point and seem unable to move forward with this basic task!