一个关于日期的问题,恳请高手赐教!!!
以前我写的代码是实现一个时间段的查询,若要实现查询某一天的功能只能在两个日期选择框都选择那个日期,现在想实现在这两个日期选择框中任意在一个框中填入某个日期,都能显示那一天的,而不是显示大于等于或者小于等于某个日期的所有数据。
查询日期从:
<INPUT class= "text " type= "text "
name= "search_adddate@start__cp_ge_tp_String " size= "10 ">
<img id= "calBegin " src= "/psm/components/calendar/skins/aqua/cal.gif "
border= "0 " alt= "选取起始日期 " style= "cursor:pointer ">
<script type= "text/javascript ">
new calendar( "search_adddate@start__cp_ge_tp_String ", "calBegin ", "%Y%m%d ");
</script>
到
<input class= "text " type= "text "
name= "search_adddate@end__cp_le_tp_String " size= "10 ">
<img id= "calEnd " src= "/psm/components/calendar/skins/aqua/cal.gif "
border= "0 " alt= "选取结束日期 " style= "cursor:pointer ">
<script type= "text/javascript ">
new calendar( "search_adddate@end__cp_le_tp_String ", "calEnd ", "%Y%m%d ");
</script>
<%@include file= "/common/queryButton.jsp "%>
加入判断条件后代码为:
查询日期从(若查询某一天的情况,则在两个日期中都选择那天):
<INPUT class= "text " type= "text "
name= "search_adddate@start__cp_ge_tp_String " size= "10 ">
<img id= "calBegin " src= "/psm/components/calendar/skins/aqua/cal.gif "
border= "0 " alt= "选取起始日期 " style= "cursor:pointer ">
<script type= "text/javascript ">
new calendar( "search_adddate@start__cp_ge_tp_String ", "calBegin ", "%Y%m%d ");
</script>
到
<input class= "text " type= "text "
name= "search_adddate@end__cp_le_tp_String " size= "10 ">
<img id= "calEnd "