zoukankan      html  css  js  c++  java
  • elementUI 日期 周一、周二、周三、周四、周五、周六、周日快捷键

    <el-date-picker
    v-model="ruleForm.pickDateMeal"
    type="daterange"
    align="right"
    :range-separator="$t('message.To')"
    :start-placeholder="$t('message.Start_date')"
    :end-placeholder="$t('message.End_date')"
    @change="getDateHandler"
    value-format="yyyy-MM-dd"
    format="yyyy-MM-dd"
    :picker-options="pickerOptions2"
    :default-value="defalutDate"
    >
    </el-date-picker>

    pickerOptions2: {
    shortcuts: [{
    text: '星期一',
    onClick (picker) {
    const end = new Date()
    const start = new Date()
    _this.getDaysMonday(start, 90, 2, 1, _this.allDays)
    picker.$emit('pick', [start, end])
    }
    }, {
    text: '星期二',
    onClick (picker) {
    const end = new Date()
    const start = new Date()
    _this.getDaysMonday(start, 90, 2, 2, _this.allDays)
    picker.$emit('pick', [start, end])
    }
    }, {
    text: '星期三',
    onClick (picker) {
    const end = new Date()
    const start = new Date()
    _this.getDaysMonday(start, 90, 2, 3, _this.allDays)
    picker.$emit('pick', [start, end])
    }
    }, {
    text: '星期四',
    onClick (picker) {
    const end = new Date()
    const start = new Date()
    _this.getDaysMonday(start, 90, 2, 4, _this.allDays)
    picker.$emit('pick', [start, end])
    }
    }, {
    text: '星期五',
    onClick (picker) {
    const end = new Date()
    const start = new Date()
    _this.getDaysMonday(start, 90, 2, 5, _this.allDays)
    picker.$emit('pick', [start, end])
    }
    }, {
    text: '星期六',
    onClick (picker) {
    const end = new Date()
    const start = new Date()
    _this.getDaysMonday(start, 90, 2, 6, _this.allDays)
    picker.$emit('pick', [start, end])
    }
    }, {
    text: '星期日',
    onClick (picker) {
    const end = new Date()
    const start = new Date()
    _this.getDaysMonday(start, 90, 2, 0, _this.allDays)
    picker.$emit('pick', [start, end])
    }
    }, {
    text: '今天',
    onClick (picker) {
    picker.$emit('pick', new Date())
    }
    }
    ],
    // 设置选择今天以及今天之后的日期
    disabledDate (time) {
    return time.getTime() < Date.now() - 8.64e7
    }
    }
  • 相关阅读:
    PAT——1007. 素数对猜想
    PAT——1006. 换个格式输出整数
    PAT——1005. 继续(3n+1)猜想 (25)
    PAT——1003. 我要通过!
    PAT——1002. 写出这个数
    PAT——1001. 害死人不偿命的(3n+1)猜想
    PAT——年会抽奖(错位 排序 )
    PAT——年会抽奖(错位 排序)
    PAT——不吉利的日期(java中date和Calendar使用)
    MapReduce的输入格式
  • 原文地址:https://www.cnblogs.com/langqq/p/9172078.html
Copyright © 2011-2022 走看看