页面,在body下面加这块
<body>
<script>
sd_body_init();
</script>
页面里:
<td align="right">时间段:</td>
<td width="200px">
<input name="startTime" id="startTime" readonly type="text" value="<#if startTime?exists>${startTime?string("yyyy-MM-dd")}</#if>" class="dateinput" οnclick="sd_showdate(this,'','',document.getElementById('startTime'),event)" style="cursor:pointer">
到:<input name="endTime" id="endTime" readonly type="text" value="<#if endTime?exists>${endTime?string("yyyy-MM-dd")}</#if>" class="dateinput" οnclick="sd_showdate(this,'','',document.getElementById('endTime'),event)" style="cursor:pointer">
</td>
详细代码见:showdate.js括弧,存在网盘里。