WdatePicker minDate取值:WdatePicker值与当前系统时间较小值
来源:互联网 发布:闲鱼淘宝二手家具 编辑:程序博客网 时间:2024/06/03 22:00
<html>
<body>
<form>
<input type="hidden" id="currentTime" name="currentTime" />
<input type="text" id="startTime" name="startTime" class="Wdate" onclick="WdatePicker({startDate: '%y-%M-%d 00:00:00',dateFmt:'yyyy-MM-dd HH:mm:ss', minDate:'#F{($dp.$(\'currentTime\').value < $dp.cal.getDateStr(\'yyyy-MM-dd 00:00:00\')) ? $dp.$(\'currentTime\').value : $dp.cal.getDateStr(\'yyyy-MM-dd 00:00:00\')}'})"/>
</form>
</body>
<script src="jquery-1.7.2.min.js" type="text/javascript"></script>
<script src="WdatePicker.js" type="text/javascript"></script>
<script type="text/javascript">
//---------------------------------------------------
// 日期格式化
// 格式 YYYY/yyyy/YY/yy 表示年份
// MM/M 月份
// W/w 星期
// dd/DD/d/D 日期
// hh/HH/h/H 时间
// mm/m 分钟
// ss/SS/s/S 秒
//---------------------------------------------------
Date.prototype.Format = function(formatStr)
{
var str = formatStr;
var Week = ['日','一','二','三','四','五','六'];
str=str.replace(/yyyy|YYYY/,this.getFullYear());
str=str.replace(/yy|YY/,(this.getYear() % 100)>9?(this.getYear() % 100).toString():'0' + (this.getYear() % 100));
var month = this.getMonth() + 1;// 月从0开始
str=str.replace(/MM/,month>9?month.toString():'0' + month);
str=str.replace(/M/g,month);
str=str.replace(/w|W/g,Week[this.getDay()]);
str=str.replace(/dd|DD/,this.getDate()>9?this.getDate().toString():'0' + this.getDate());
str=str.replace(/d|D/g,this.getDate());
str=str.replace(/hh|HH/,this.getHours()>9?this.getHours().toString():'0' + this.getHours());
str=str.replace(/h|H/g,this.getHours());
str=str.replace(/mm/,this.getMinutes()>9?this.getMinutes().toString():'0' + this.getMinutes());
str=str.replace(/m/g,this.getMinutes());
str=str.replace(/ss|SS/,this.getSeconds()>9?this.getSeconds().toString():'0' + this.getSeconds());
str=str.replace(/s|S/g,this.getSeconds());
return str;
}
$("#currentTime").val(new Date().Format('yyyy-MM-dd 00:00:00'));
$("#startTime").val('2017-12-01 00:00:00');
</script>
</html>
<body>
<form>
<input type="hidden" id="currentTime" name="currentTime" />
<input type="text" id="startTime" name="startTime" class="Wdate" onclick="WdatePicker({startDate: '%y-%M-%d 00:00:00',dateFmt:'yyyy-MM-dd HH:mm:ss', minDate:'#F{($dp.$(\'currentTime\').value < $dp.cal.getDateStr(\'yyyy-MM-dd 00:00:00\')) ? $dp.$(\'currentTime\').value : $dp.cal.getDateStr(\'yyyy-MM-dd 00:00:00\')}'})"/>
</form>
</body>
<script src="jquery-1.7.2.min.js" type="text/javascript"></script>
<script src="WdatePicker.js" type="text/javascript"></script>
<script type="text/javascript">
//---------------------------------------------------
// 日期格式化
// 格式 YYYY/yyyy/YY/yy 表示年份
// MM/M 月份
// W/w 星期
// dd/DD/d/D 日期
// hh/HH/h/H 时间
// mm/m 分钟
// ss/SS/s/S 秒
//---------------------------------------------------
Date.prototype.Format = function(formatStr)
{
var str = formatStr;
var Week = ['日','一','二','三','四','五','六'];
str=str.replace(/yyyy|YYYY/,this.getFullYear());
str=str.replace(/yy|YY/,(this.getYear() % 100)>9?(this.getYear() % 100).toString():'0' + (this.getYear() % 100));
var month = this.getMonth() + 1;// 月从0开始
str=str.replace(/MM/,month>9?month.toString():'0' + month);
str=str.replace(/M/g,month);
str=str.replace(/w|W/g,Week[this.getDay()]);
str=str.replace(/dd|DD/,this.getDate()>9?this.getDate().toString():'0' + this.getDate());
str=str.replace(/d|D/g,this.getDate());
str=str.replace(/hh|HH/,this.getHours()>9?this.getHours().toString():'0' + this.getHours());
str=str.replace(/h|H/g,this.getHours());
str=str.replace(/mm/,this.getMinutes()>9?this.getMinutes().toString():'0' + this.getMinutes());
str=str.replace(/m/g,this.getMinutes());
str=str.replace(/ss|SS/,this.getSeconds()>9?this.getSeconds().toString():'0' + this.getSeconds());
str=str.replace(/s|S/g,this.getSeconds());
return str;
}
$("#currentTime").val(new Date().Format('yyyy-MM-dd 00:00:00'));
$("#startTime").val('2017-12-01 00:00:00');
</script>
</html>
阅读全文
0 0
- WdatePicker minDate取值:WdatePicker值与当前系统时间较小值
- WdatePicker
- WdatePicker
- wdatepicker
- wdatepicker
- WdatePicker
- jsp里input中获取当前时间,与WdatePicker配合使用
- 时间控件之WdatePicker
- WdatePicker获取时间
- WdatePicker时间选择插件
- WdatePicker时间插件
- wdatepicker,自定义时间限制
- WdatePicker 时间插件
- Wdatepicker时间控件
- 时间控件WdatePicker
- wdatepicker动态设置时间
- 时间控件WdatePicker应用
- 时间控件之WdatePicker
- 拓扑排序
- [Java面试二]Java基础知识精华部分
- Spark踩坑记——Spark Streaming+Kafka
- 程序内存分配
- linux ssh 转发端口及使用
- WdatePicker minDate取值:WdatePicker值与当前系统时间较小值
- Spring Boot 之Hello SpringBoot
- Docker的应用场景
- Flyerinternational谈谈2018年外汇市场新玩法 不可不知的内幕
- Nginx与PHP交互详解——被百度怼了很长时间!!!
- Maven多环境配置:开发环境、测试环境、生产环境打包配置
- 动态规划原理解析
- popover()方法无效
- 谷歌浏览器扩展工具---eye dropper取色器使用