My97DatePicker设置默认时间
<%@ page language="java" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>My97DatePicker日期控件使用</title>
<script type="text/javascript" src="My97DatePicker/WdatePicker.js"></script>
<script type="text/javascript" src="js/jquery-easyui-1.3.6/jquery-1.8.0.min.js"></script>
<!-- 设置默认时间为当前时间 -->
<script type="text/javascript">
$(document).ready(function(){
var d = new Date();
function addzero(v) {if (v < 10) return '0' + v;return v.toString();}
var s = d.getFullYear().toString() + '-'+addzero(d.getMonth() + 1);
document.getElementById('txtStartTime').value=s;
});
</script>
</head>
<body>
<center>
<h2>My97DatePicker日期控件的使用</h2>
</center>
基本用法:<input id="txtStartTime" type="text" onfocus="WdatePicker({readOnly:true})" class="Wdate"/><br><br>
只能选择今天以前的日期:
<input id="" class="Wdate" onfocus="WdatePicker({readOnly:true,maxDate:'%y-%M-%d'})" /><br><br>
使用运算表达式 只能选择 20小时前 至 30小时后 的日期
<input id="" class="Wdate" onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm',minDate:'%y-%M-%d {%H-20}:%m:%s',maxDate:'%y-%M-%d {%H+30}:%m:%s'})" /><br><br>
开始,结束日期:
<input id="sdate" class="Wdate" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd',readOnly:true,maxDate:'#F{$dp.$D(\'edate\')}'})" />
-
<input id="edate" class="Wdate" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd',readOnly:true,minDate:'#F{$dp.$D(\'sdate\')}',startDate:'#F{$dp.$D(\'sdate\',{d:+1})}'})" /><br><br>
</body>
</html>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>My97DatePicker日期控件使用</title>
<script type="text/javascript" src="My97DatePicker/WdatePicker.js"></script>
<script type="text/javascript" src="js/jquery-easyui-1.3.6/jquery-1.8.0.min.js"></script>
<!-- 设置默认时间为当前时间 -->
<script type="text/javascript">
$(document).ready(function(){
var d = new Date();
function addzero(v) {if (v < 10) return '0' + v;return v.toString();}
var s = d.getFullYear().toString() + '-'+addzero(d.getMonth() + 1);
document.getElementById('txtStartTime').value=s;
});
</script>
</head>
<body>
<center>
<h2>My97DatePicker日期控件的使用</h2>
</center>
基本用法:<input id="txtStartTime" type="text" onfocus="WdatePicker({readOnly:true})" class="Wdate"/><br><br>
只能选择今天以前的日期:
<input id="" class="Wdate" onfocus="WdatePicker({readOnly:true,maxDate:'%y-%M-%d'})" /><br><br>
使用运算表达式 只能选择 20小时前 至 30小时后 的日期
<input id="" class="Wdate" onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm',minDate:'%y-%M-%d {%H-20}:%m:%s',maxDate:'%y-%M-%d {%H+30}:%m:%s'})" /><br><br>
开始,结束日期:
<input id="sdate" class="Wdate" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd',readOnly:true,maxDate:'#F{$dp.$D(\'edate\')}'})" />
-
<input id="edate" class="Wdate" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd',readOnly:true,minDate:'#F{$dp.$D(\'sdate\')}',startDate:'#F{$dp.$D(\'sdate\',{d:+1})}'})" /><br><br>
</body>
</html>