欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

struts标签判断日期是否过期

程序员文章站 2022-06-29 12:08:24
...
<s:set
				name="nowTime"
				value="new java.util.Date()"
			/>

<s:iterator
				var="row"
				value="list"
			>
				<div id="div_keyword_${row.keyWordId}">
					<div class="demo4_t"></div>
					<div class="demo4_c">
						<div class="listdl2">
							<div class="listdltitl2 fl">
								<a href="javascript:oneshowkey('${row.keyword}');">${row.keyword}</a>
							</div>
							<div class="fr ltdttxt2">
								匹配度
							</div>
							<div class="cl"></div>
							<dl class="fl">
								<dt class="dttxt">
									时间来源:
								</dt>
								<s:if test="#row.status == 'active'">
									<s:if test="#row.effectiveEnd.getTime() <= #nowTime.getTime()">
										<dd
											id="ddtxt2_${row.keyWordId}"
											class="ddtxt2"
										>
											过期
										</dd>
									</s:if>
									<s:else>
										<dd
											id="ddtxt2_${row.keyWordId}"
											class="ddtxt2"
											style="width: auto;"
										>
											${row.effectiveStart} ~ ${row.effectiveEnd}
										</dd>
									</s:else>
								</s:if>