var first = new Date();//获取当前月 如7月
first.setDate(1);//设置为第一天 如7月1日
var last = new Date();
last.setMonth(first.getMonth()+1);//在当前月的基础上增加一个月 如6+1=7即8月
last.setDate(0);//取上个月的最后一天,也就是本月的最大一天,也就是7月的最大一天
$("#paymentTimeStart").val(formatDate(first,'yyyy-MM-dd'))
$("#paymentTimeEnd").val(formatDate(last,'yyyy-MM-dd'))
first.setDate(1);//设置为第一天 如7月1日
var last = new Date();
last.setMonth(first.getMonth()+1);//在当前月的基础上增加一个月 如6+1=7即8月
last.setDate(0);//取上个月的最后一天,也就是本月的最大一天,也就是7月的最大一天
$("#paymentTimeStart").val(formatDate(first,'yyyy-MM-dd'))
$("#paymentTimeEnd").val(formatDate(last,'yyyy-MM-dd'))
574

被折叠的 条评论
为什么被折叠?



