Created
June 24, 2014 02:33
-
-
Save yangl/afa21de3575ae0ef6366 to your computer and use it in GitHub Desktop.
laydate 日期控件,注意要放到input的下边,加载顺序
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<tr> | |
<th> | |
<span class="requiredField">*</span>开始时间: | |
</th> | |
<td> | |
<input type="text" id="startTime" name="startTime" class="laydate-icon" | |
value="$!dateTool.format("yyyy-MM-dd HH:mm:ss",$!act.startTime)" | |
/> | |
</td> | |
</tr> | |
<tr> | |
<th> | |
<span class="requiredField">*</span>结束时间: | |
</th> | |
<td> | |
<input type="text" id="endTime" name="endTime" class="laydate-icon" | |
value="$!dateTool.format("yyyy-MM-dd HH:mm:ss",$!act.endTime)" | |
/> | |
</td> | |
</tr> | |
<!-- laydate 日期控件,注意要放到input的下边,加载顺序 --> | |
<!-- http://sentsin.com/layui/laydate/api.html --> | |
<script type="text/javascript"> | |
var start = { | |
elem: '#startTime', | |
format: 'YYYY-MM-DD hh:mm:ss', | |
max: $("#endTime").val(), | |
event: 'focus', | |
istime: true, | |
istoday: true, | |
choose: function (datas) { | |
end.min = datas; //开始日选好后,重置结束日的最小日期 | |
} | |
}; | |
var end = { | |
elem: '#endTime', | |
format: 'YYYY-MM-DD hh:mm:ss', | |
min: $("#startTime").val(), | |
event: 'focus', | |
istime: true, | |
istoday: true, | |
choose: function (datas) { | |
start.max = datas; //结束日选好后,充值开始日的最大日期 | |
} | |
}; | |
laydate(start); | |
laydate(end); | |
laydate.skin("dahong"); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment