iview DatePicker 只能选本月
html
<FormItem label="活动时间" prop="activity_time">
<DatePicker
v-model="addForm.activity_time"
@on-change="param.activity_time=$event"
type="date"
format="yyyy-MM-dd"
:options="options"
placeholder="活动时间"
style="width: 214px"
:disabled="modalDisable"
></DatePicker>
</FormItem>
js
options: {
disabledDate(date) {
let dateTime = new Date();
let currentYear = dateTime.getFullYear();
let currentMonth = dateTime.getMonth();
let monthFirstDay = new Date(currentYear, currentMonth, 1);
let newMonth = ++currentMonth;
let newYear = currentYear;
if (newMonth >= 12) {
newMonth -= 12;
newYear++;
}
let nextMonthFirst = new Date(newYear, newMonth, 1);
let nonthLastDay = new Date(
nextMonthFirst.getTime() - 24 * 60 * 60 * 1000
);
return (
date.valueOf() < new Date(monthFirstDay).getTime() ||
date.valueOf() > new Date(nonthLastDay).getTime()
);
}
} //时间范围限制
iview DatePicker 只能选本月的更多相关文章
- iveiw DatePicker 只能选择本月之前的日期,本月包括之后都不能选择
日期判断只能选择本月之前的日期 <DatePicker type="date" :options="options3" format="yyyy ...
- ux.form.field.Month 只能选年、月的时间扩展
效果如图,亲测6.2.1版本可用,用法同时间选择控件 //月弹窗扩展 //只选月 Ext.define('ux.picker.Month', { extend: 'Ext.picker.Month', ...
- easyui-combotree 只能选叶子未级
easyui-combotree 只能选叶子未级 function edit_dg() { //选中一行,获取这一行的属性的值 var selected = $('#tbClientListBrows ...
- hdu2049 不容易系列之(4)——考新郎 错排+组合 一共有N对新婚夫妇,N个新娘随机坐成一排,每个新郎只能选一个, 其中有M个新郎找错了新娘,求发生这种情况一共有多少种可能.
不容易系列之(4)——考新郎 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)To ...
- Wdatepick控件只能选当前时间以前的时间
WdatePicker限制只能选当天,只能选以前的时间 (1)WdatePicker限制只能选以前的时间(不能选当天): onfocus="WdatePicker({startDate:'% ...
- iView - DatePicker组件神坑,如何处理?
最近使用iView - DatePicker组件时发现一些问题,明明设置是正常的日期时间格式,当需要使用这个时间的时候,页面却显示 Fri Jun 09 2017 12:00:10 GMT+0800 ...
- iview Checkbox 多选框 v-model 赋值方法 this.innerValueArr = [this.previousValue]
iview Checkbox 多选框 v-model 赋值方法 this.innerValueArr = [this.previousValue]
- CheckBoxList 只能选2个选项
// ////下面判断用户是否多选,每选择一次比较一次,看是否超过规定名额 //string ClickedItem = Request.Form["__EVENTTARGET"] ...
- VUE iview date-picker取时间范围...
x HTML <script src="//unpkg.com/vue/dist/vue.js"></script> <script src=&quo ...
随机推荐
- Python - Django - ORM QuerySet 方法补充
models.py: from django.db import models class Employee2(models.Model): name = models.CharField(max_l ...
- 【计算机视觉】OpenCV篇(4) - Pycharm+PyQt5+Python小项目实战
1.下载安装 (1)Pycharm:下载链接 (2)推荐使用Qt Designer来设计界面,如果你装的是Anaconda的话,就已经自带了designer.exe,我这里使用的是Pycharm的虚拟 ...
- typescript那些事儿
本篇文章介绍typescript那些. ts-loader会调用typescript去编译.ts,typescript会读取tsconfig.json配置来决定如何编译. 在tsx文件中使用样式,需要 ...
- 【ARTS】01_47_左耳听风-201900930~201901006
ARTS: Algrothm: leetcode算法题目 Review: 阅读并且点评一篇英文技术文章 Tip/Techni: 学习一个技术技巧 Share: 分享一篇有观点和思考的技术文章 Algo ...
- consul(一)什么是consul
1. consul的基本介绍 在分布式架构中,服务治理是一个重要的问题.在没有服务治理的分布式集群中,各个服务之间通过手工或者配置的方式进行服务关系管理,遇到服务关系变化或者增加服务的时候,人肉配置极 ...
- vue 跨域简记
0.服务端设置 app.use(function(req, res, next){ //设置跨域访问 res.header('Access-Control-Allow-Origin', '*'); r ...
- Python标准库: functools (cmp_to_key, lru_cache, total_ordering, partial, partialmethod, reduce, singledispatch, update_wrapper, wraps)
functools模块处理的对象都是其他的函数,任何可调用对象都可以被视为用于此模块的函数. 1. functools.cmp_to_key(func) 因为Python3不支持比较函数,cmp_to ...
- 如何使用C++实现单链表
线性表--链表 为什么假期也在发文章 //TODO NullGirlfrindException 请忽略以上两行无聊的事实...... 如何弥补顺序表的不足之处? 第一次学习线性表一定会马上接触到一种 ...
- pytorch1.0实现RNN for Regression
import torch from torch import nn import numpy as np import matplotlib.pyplot as plt # 超参数 # Hyper P ...
- DateTimeFormatter 的操作与使用 -- 通俗易懂
在上一章我们讲解了LocalDate.LocalTime.LocalDateTime.Instant的操作与使用,下面讲解它们之间是如何进行格式化 DateTimeFormatter这个类它只提供了时 ...