如何在jsp

时间:2016-05-28 07:42:40

标签: java jsp

如何限制第二天它一直比第一天更大?

<%
    SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
    Calendar c = Calendar.getInstance();
    String today = dateFormat.format(c.getTime());
    c.add(Calendar.DATE, 1);
    String tomorrow = dateFormat.format(c.getTime());
%>
<p><input type="date" name="from" min="<%=today%>" value="<%=today%>"/></p>
<p><input type="date" name="to" min="<%=tomorrow%>" value="<%=tomorrow%>"/></p>

0 个答案:

没有答案