I need the date of last September with moment.js - but dynamically.
Current Date
currentDate:string = moment().format('YYYY-MM'); // This will be 2017-10
How to know when the last september was from the current date? I need somethink like this:
lastSteptember = moment(this.currentDate).getDateOfLast('september').format('YYYY-MM');
So the result from now would be:
2017-09
But 3 months ago the result would have been another:
2016-09
How do I can handle this with moment.js?