We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
判断一个日期(date),是否在一个时间区间内(beginDate,endDate)
自定义标签参数说明:
注:
示例:
<%@ taglib prefix="feilong" uri="http://java.feilong.com/tags-common"%>
场景描述: 循环输出100个商品,每个商品上线时间onlinetime在(当前时间-31天,当前时间)之间,那么显示"新品"
<% request.setAttribute("onlineTime", DateUtil.string2Date("2012年10月31日 10:00:00", "yyyy年MM月dd日 HH:mm:ss")); //如果现在是 2012-10-31 16:45 Date endDate = new Date(); request.setAttribute("beginDate", DateUtil.addDay(endDate, -31)); request.setAttribute("endDate", endDate); %> <feilong:isInTime date="${onlineTime}" beginDate="${beginDate }" endDate="${endDate}"> bingo </feilong:isInTime>
springmvc将<%%>代码移动到 controller 里面
<feilong:isInTime beginDateString="2010年8月15日 00:00:00" endDateString="2016年8月15日 23:59:59" pattern="yyyy年MM月dd日 HH:mm:ss"> bingo beginDateString+endDateString+pattern </feilong:isInTime>