1. 首先获取当前时间的月份值
var
e=
new
Date()
2. 然后从当前时间获取年份跟月份进行拼接,分开始时间和结束时间(本月初到下个月月初即本个月的值)
this.
startTime=
e.
getFullYear()+
"-"+(
e.
getMonth()+
1)+
"-1";
if((
e.
getMonth+
1)==
12){
this.
endTime=
e.
getFullYear()+
"-"+(
e.
getMonth()+
1)+
"-31"
}
else{
this.
endTime=
e.
getFullYear()+
"-"+(
e.
getMonth()+
1+
1)+
"-1"
}
3.如果想获取到天
e.
getDate()