moment add 30 days
moment().add(30, 'days');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:
- check if two rectangles overlap javascript canvas
- process.stdin.on("data", function (input) { _input += input; });
- js innerHTML
- how to chunk a base 64 in javascript
- update angular cli 10
- beautiful day at the movies hackerrank solution
- javascript to help find overflow elements
- click select option to update div jquery
- Javascript object to JSON string
- addEnd Point js
- get hash from url
- javascript try catch finally
- how to turn decimales into percents with javascript
- find element in javascript array
- vuex getter root state
- sum of number using reduce
- convert string to number javascript
- set label text in jquery
- trim whitespace javascript
- chart js y axis integer
- sort data according to date in js
- enzynme not support react 17
- How to write on a web page javascript
- js getelementbyid