我有一个下拉列表,我需要在spring freemarker(.ftl文件)中显示cid-date(以dd M yyyy)格式。 我的下拉代码......
<td>:  
<select id="appshift" name="shift" onchange="doFetch()">
<option value="">-select-</option>
<#list extshiftcode as shiftList>
<option value="${shiftList.cid}">${shiftList.cid} -${shiftList.fromDate} </option>
</#list>
</select>
</td>
任何人都可以建议我如何以dd M yyyy格式显示日期。 我也在使用Jquery,如果有任何想法使用jquery在.ftl文件中更改日期格式。
请建议我。
感谢。
答案 0 :(得分:1)
<option value="${shiftList.cid}">${shiftList.cid} -${shiftList.fromDate?string("dd M yyyy")} </option>
如果 shiftList.fromDate 是日期。