js简略获取当月的第一天和最初一天:

//获得当月第一天和最初一天var firstDate = new Date();firstDate.setDate(1); //第一天var endDate = new Date(firstDate);endDate.setMonth(firstDate.getMonth() + 1);endDate.setDate(0);console.log(firstDate,'------------',endDate)