moment js get date 1 month
var currentDate = moment('2015-10-30');
var futureMonth = moment(currentDate).add(1, 'M');
var futureMonthEnd = moment(futureMonth).endOf('month');
if(currentDate.date() != futureMonth.date() && futureMonth.isSame(futureMonthEnd.format('YYYY-MM-DD'))) {
futureMonth = futureMonth.add(1, 'd');
}
console.log(currentDate);
console.log(futureMonth);
Also in JavaScript:
- javascript regex email
- react merge two objects
- acces store from vue console javascript
- javascript syntax for check null or undefined or empty
- infinite image slider with react and node js
- get date and change format and increase date or month in javascript jquery
- Limit text to specified number of words using Javascript
- flutter betterplayer get aspect ratio
- Javascript convert html entity to string
- localecompare javascript
- on click jqueyr
- react native textinput not show cursor
- como criar uma modal jquery
- javascript reverse array without modifying
- v-switch vuex store
- how to send authorization in header of HTTP GET using ajax
- add style js without overwrite
- js random number
- get date now javascript
- nodejs self quit program
- trim whitespace javascript
- angular route change scroll to top
- how to create json file in android programmatically
- jquery toggle show hide