zoukankan      html  css  js  c++  java
  • element ui 时间控件

     pickerOptions: {
            shortcuts: [
              {
                text: "昨天",
                onClick(picker) {
                  const end = new Date();
                  const start = new Date();
                  start.setTime(start.getTime() - 3600 * 1000 * 24 * 1);
                  picker.$emit("pick", [start, end]);
                }
              },
              {
                text: "最近一周",
                onClick(picker) {
                  const end = new Date();
                  const start = new Date();
                  start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
                  picker.$emit("pick", [start, end]);
                }
              },
              {
                text: "最近一个月",
                onClick(picker) {
                  const end = new Date();
                  const start = new Date();
                  start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
                  picker.$emit("pick", [start, end]);
                }
              },
              {
                text: "本月",
                onClick(picker) {
                  const now = new Date();
                  const end = new Date();
                  const start = new Date(now.setDate(1));
                  end.setTime(new Date(now.getFullYear(), now.getMonth() + 1, 0));
                  picker.$emit("pick", [start, end]);
                }
              }
            ]
          },
     
     pickerOptions: {
            shortcuts: [
              {
                text: "昨天",
                onClick(picker) {
                  const end = new Date();
                  const start = new Date();
                  start.setTime(start.getTime() - 3600 * 1000 * 24 * 1);
                  picker.$emit("pick", [start, end]);
                }
              },
              {
                text: "最近一周",
                onClick(picker) {
                  const end = new Date();
                  const start = new Date();
                  start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
                  picker.$emit("pick", [start, end]);
                }
              },
              {
                text: "最近一个月",
                onClick(picker) {
                  const end = new Date();
                  const start = new Date();
                  start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
                  picker.$emit("pick", [start, end]);
                }
              },
              {
                text: "本月",
                onClick(picker) {
                  const now = new Date();
                  const end = new Date();
                  const start = new Date(now.setDate(1));
                  end.setTime(new Date(now.getFullYear(), now.getMonth() + 1, 0));
                  picker.$emit("pick", [start, end]);
                }
              }
            ]
          },
    

      

  • 相关阅读:
    转:JMeter5的If Controller操作解析
    .NET Core优秀的应用逻辑分层框架设计
    socket阻塞导致拿不到信息
    2018年开始了,我们还是说说2017吧
    PHP 学习 遇到坑的第一章
    记一次高并发情况,服务器和代码修改过程记录。
    IIS 提高连接的并发数,和CPU的使用率。
    2017年总结
    在 safari 浏览器 onclick 出现延迟的现象
    微信JS-api 注意事项
  • 原文地址:https://www.cnblogs.com/maomao-Sunshine/p/14667684.html
Copyright © 2011-2022 走看看