JSP页面的日期控件可以弹出选择框选择日期
input框的如下
<input type="text" name="starttime" readonly="readonly"/>
<input type="text" name="buildtime" readonly="readonly"/>
<input type="text" name="endtime" readonly="readonly"/>
JSP页面的日期控件,顺带转换格式,使用的时候,以下代码直接拿过来用即可
<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath }/datejs/jQuery-Timepicker-Addon/demos.css">
<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath }/datejs/jQuery-Timepicker-Addon/jquery-ui-timepicker-addon.css">
<link href="https://cdn.bootcss.com/jqueryui/1.12.1/jquery-ui.css" rel="stylesheet">
<script src="https://cdn.bootcss.com/jqueryui/1.12.1/jquery-ui.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath }/datejs/jQuery-Timepicker-Addon/jquery-ui-timepicker-addon.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath }/datejs/js/jquery.ui.datepicker-zh-CN.js.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath }/datejs/js/jquery-ui-timepicker-zh-CN.js"></script>
<script type="text/javascript">
/* name="sdate" */
$(function(){
$('input[name="starttime"],input[name="buildtime"],input[name="endtime"]').datepicker({
dateFormat: "yy-mm-dd"
});
})
</script>