s: convertDateTime在h中不起作用:选择Many复选框



我在Seam中使用JSF 1.2,并试图在h:selectManyCheckbox中获得格式为dd/MM/yyyy的日期。h:selectManyCheckbox的功能本身就很好——只是它没有正确显示日期。

<h:selectManyCheckbox id="paymentDates" value="#{entity.selectedPaymentDates}" layout="pageDirection" styleClass="radio">
    <s:convertDateTime type="date" dateStyle="short" pattern="dd/MM/yyyy"/>
    <s:selectItems value="#{entity.calculatedPaymentDates}" var="entity" label="#{entity}" hideNoSelection="true" />
</h:selectManyCheckbox>

非常感谢任何想法!

AJ

日期是如何显示的?您正在使用带模式的dateStyle。使用其中一个,而不是同时使用short"将日期格式化为:

2007年5月14日下午12:55:42

尽管我认为你必须使用style="both"来获得时间部分。

如果你想使用特定的模式,请尝试:

<s:convertDateTime type="date" pattern="dd/MM/yyyy"/>

或者:

<s:convertDateTime type="both" pattern="dd/MM/yyyy"/>

最新更新