最近一年记录
<div class="block info-content">
<span class="demonstration">查询日期:</span>
<el-date-picker v-model="value1"
type="daterange"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
value-format="yyyy-MM-dd">
</el-date-picker>
<el-button id="search"
class="btnSearch"
type="primary"
ecols-button
@mouseup.native="onBeforeSubmit('search',$event)">查询
</el-button>
</div>
................
value1: []
................
//获取最近一年时间
getDate() {
var today = new Date();
var y = today.getFullYear();
var m = today.getMonth();
var d = today.getDate();
var StartDate=y-1 + '-' + m + '-' + d;
var EndDate=y + '-' + m + '-' + d;
console.log("today=" + today);
console.log("StartDate=" + StartDate);
console.log("EndDate=" + EndDate);
// this.value1=[StartDate,EndDate];
this.value1[0]=StartDate;
this.value1[1]=EndDate;
console.log(this.value1);
}