首页 > 其他 > 详细

起止时间控制,显示格式控制

时间:2016-01-09 06:11:23      阅读:301      评论:0      收藏:0      [点我收藏+]

//<script src="<!--{$smarty.const.BASE_PATH}-->/js/public/My97DatePicker/WdatePicker.js"></script>

html中引入WdatePicker.js文件

一、开始结束时间相互限制

例1.两个input中时间相关联

<tr>
<td>开始时间<label class="must-tag">*</label></td>
<td>
<input type="text" name="start_time" id="start_time" value="" class="input-normal search Wdate" onclick="WdatePicker({maxDate:‘#F{$dp.$D(\‘end_time\‘)}‘})">
</td>
<td></td>
</tr>
<tr>
<td>结束时间<label class="must-tag">*</label></td>
<td>
<input type="text" name="end_time" id="end_time" value="" class="input-normal search Wdate" onclick="WdatePicker({minDate:‘#F{$dp.$D(\‘start_time\‘)}‘})">
</td>
<td></td>
</tr>

例2:和现在时间相关联

<td width="140px">
<input id="startTime" name="startTime" type="text" class="input-normal search Wdate"

onclick="WdatePicker({maxDate:‘#F{$dp.$D(\‘endTime\‘)||\‘new Date()\‘}‘})" />
</td>
<td width="140px">
<input id="endTime" name="endTime" type="text" class="input-normal search Wdate" onclick="WdatePicker({minDate:‘#F{$dp.$D(\‘startTime\‘)}‘,maxDate:new Date()})" />
</td>

二、显示格式

格式和时间控制相结合

<td width="140px">
<input id="startTime" name="startTime" type="text" class="input-normal search Wdate"

onclick="WdatePicker({dateFmt:‘yyyy-MM‘,maxDate:‘#F{$dp.$D(\‘endTime\‘)||\‘new Date()\‘}‘})" />
</td>
<td width="40px">
<label for="endTime">至:</label>
</td>
<td width="140px">
<input id="endTime" name="endTime" type="text" class="input-normal search Wdate"

onclick="WdatePicker({dateFmt:‘yyyy-MM‘,minDate:‘#F{$dp.$D(\‘startTime\‘)}‘,maxDate:new Date()})" />
</td>

起止时间控制,显示格式控制

原文:http://www.cnblogs.com/xiaoliu520/p/5115345.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!