daterangepicker 双日历/格式化日期/日期限制minDate,maxDate
var locale = {
"format": 'YYYY/MM/DD',
"separator": " - ",
"applyLabel": "确定",
"cancelLabel": "取消",
"fromLabel": "起始时间",
"toLabel": "结束时间'",
"customRangeLabel": "自定义",
"weekLabel": "W",
"daysOfWeek": ["日", "一", "二", "三", "四", "五", "六"],
"monthNames": ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"],
"firstDay": 1
};
注意:format 格式化日期格式时必须大写,遇到过小写获取不到日期的情况。
$('#stedDate').daterangepicker(
{
"minDate":moment().subtract(90,'days'),
"maxDate":moment().add(90,'days'),
//"singleDatePicker": true,
"autoApply": true,
"startDate": "moment()",
"endDate": "moment()",
"locale": locale,
}
);
还有一种选择日期范围的
$('#scopeDate').daterangepicker(
{
"ranges": {
'今天': [moment(), moment()],
'一周内': [moment().subtract(6, 'days'), moment()],
'一个月内': [moment().subtract(1, 'month').startOf('month'), moment().subtract('month')],
'两个月内': [moment().subtract(2, 'month').startOf('month'), moment().subtract('month')],
'三个月内': [moment().subtract(3, 'month').startOf('month'), moment().subtract('month')]
},
"showCustomRangeLabel": false,
"locale": locale,
});
此方法如果想让input内显示“今天”,“一周内”,“一个月内”等等文字的话可以在写一个input 定位覆盖在上方给,把获取到的值传去
$('.ranges ul li').click(function () {
$('#scopeDates').val($(this).html())
});
daterangepicker 双日历/格式化日期/日期限制minDate,maxDate的更多相关文章
- JAVA格式化时间日期
JAVA格式化时间日期 import java.util.Date; import java.text.DateFormat; /** * 格式化时间类 * DateFormat.FULL = 0 * ...
- 格式化angularjs日期'/Date(-62135596800000)/'
在实现在angularjs时,发现经序列化后的日期需要格式化显示. 翻看以前的博客,似乎有写过一篇有关js方面的解决办法<格式化json日期'/Date(-62135596800000)/'&g ...
- js 格式化时间日期函数小结
下面是脚本之家为大家整理的一些格式化时间日期的函数代码,需要的朋友可以参考下. 代码如下: Date.prototype.format = function(format){ var o = { &q ...
- java笔记--String类格式化当天日期转换符文档
String类格式化当天日期 --如果朋友您想转载本文章请注明转载地址"http://www.cnblogs.com/XHJT/p/3877389.html "谢谢-- 转换符:% ...
- Bind("入库日期", "{0:yyyy-MM-dd}") 关于asp.net格式化数据库日期字符串
Bind("入库日期", "{0:yyyy-MM-dd}") 关于asp.net格式化数据库日期字符串,删除多余的000:0:00
- 在Jquery里格式化Date日期时间数据
在Jquery里格式化Date日期时间数据: $(function(){ //当前时间格式化yyyy-MM-dd HH:mm:ss alert(timeStamp2String(new Date(). ...
- Java自学-日期 日期格式化
Java中使用SimpleDateFormat 进行日期格式化类 SimpleDateFormat 日期格式化类 示例 1 : 日期转字符串 y 代表年 M 代表月 d 代表日 H 代表24进制的小时 ...
- DELPHI解析JSON格式化的日期
DELPHI解析JSON格式化的日期 json返回的日期是 /Date(1560355200000)/ 这样的格式. 这个1560355200000,是指1970年以后的秒数. DELPHI如何解析这 ...
- 使用Python将字符串转换为格式化的日期时间字符串
我正在尝试将字符串“20091229050936”转换为“2009年12月29日(UTC)” >>>import time >>>s = time.strptime ...
随机推荐
- lodash源码(2)
1.flatten 对深层嵌套数组的抹平 _.flatten([1, [2, 3, [4]]]);* // => [1, 2, 3, [4]]** // using `isDeep`* _.fl ...
- [译]SpringMVC自定义验证注解(SpringMVC custom validation annotations)
在基于SpringMVC框架的开发中,我们经常要对用户提交的字段进行合法性验证,比如整数类型的字段有个范围约束,我们会用@Range(min=1, max=4).在实际应用开发中,我们经常碰到一些自己 ...
- sdutoj 2610 Boring Counting
http://acm.sdut.edu.cn/sdutoj/problem.php?action=showproblem&problemid=2610 Boring Counting Time ...
- ssh安装与配置
SSH 为 Secure Shell 的缩写,由 IETF 的网络工作小组(Network Working Group)所制定:SSH 为建立在应用层和传输层基础上的安全协议. 传统的网络服务程序,如 ...
- paper 100:何恺明经典去雾算法
一:由简至美的最佳论文(作者:何恺明 视觉计算组) [视觉机器人:个人感觉学习他的经典算法固然很重要,但是他的解决问题的思路也是非常值得我们学习的] 那是2009年4月24日的早上,我收到了一封不同 ...
- 函数nvl 和decode
decode(nvl(kkc.category, 'one'),'one','普通','two','精品','three','行业','four','白金')
- :enabled 匹配所有可用元素
描述: 查找所有可用的input元素 HTML 代码: <form> <input name="email" disabled="disabled&qu ...
- CI 框架访问 http://[::1]/yourproject/
Chances are you have left the base url blank/* |---------------------------------------------------- ...
- linux下配置redis
安装redis 1.下载文件 wget http://download.redis.io/releases/redis-2.8.12.tar.gz 2.解压文件 tar zxvf redis-2.8 ...
- mac上安装opencv3
转载于:http://blog.csdn.net/sanwandoujiang/article/details/51159983 在macosx上安装opencv2 brew tap homebrew ...