We have a problem regarding the generated logs on our application. And the solution is we need to get the first day of the next month even if the selected day is on the middle of the month.
Tried to read docs on Moment but I couldn't found any possible solution.
var currentDate = new Date();
var start_date = new Date(); //Wed Jun 05 2019 13:23:06 GMT+0800 (Philippine Standard Time)
console.log(start_date);
start_date.setDate(start_date.getDate() - 365); //1496640186958
console.log(start_date.setDate(start_date.getDate() - 365)); //Monday, June 5, 2017 1:23:06.958 PM GMT+08:00
// this output should be July 1, 2017, how can I get the first day of next month here?
start_date = customizeDate.formatDateToString(start_date);
var end_date = dateRange.endDate;