本文实例为大家分享了vue按时间段查询的案例,效果图如下
html代码
- 今天
- 昨天
- 本周
- 上周
- 本月
- 上月
查询
vue.js代码 点击事件
//获取时间、
//时间解析;
time:function(now) {
let year=new date(now).getfullyear();
let month=new date(now).getmonth()+1;
let date=new date(now).getdate();
if (month < 10) month = "0" + month;
if (date < 10) date = "0" + date;
return year+"-"+month+"-"+date
},
//本周第一天;
showweekfirstday:function()
{
let nowdate=new date();
let weekfirstday=new date(nowdate-(nowdate.getday()-1)*86400000);
let m=number(weekfirstday.getmonth())+1;
if(m<