export const subtractMonthsFromDate = ( date , nofMonths ) : Date => { const thisMonth = date . getMonth ( ) ; const newDate = new Date ( date ) ; newDate . setMonth ( thisMonth - nofMonths ) ; newDate . setDate ( 1 ) ; return newDate ; } ;