简体   繁体   English

s:convertDateTime在h:selectManyCheckbox中不起作用

[英]s:convertDateTime not working in h:selectManyCheckbox

I'm using JSF 1.2 with Seam and am trying to get a date formatted as dd/MM/yyyy within an h:selectManyCheckbox. 我在Seam中使用JSF 1.2,并试图在h:selectManyCheckbox中获取格式化为dd / MM / yyyy的日期。 The functionality of the h:selectManyCheckbox works fine in itself - it's just that it doesn't display the date correctly. 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>

Any ideas greatfully appreciated! 任何想法表示赞赏!

AJ AJ

How is the date displayed? 日期如何显示? you're using dateStyle with pattern. 您正在使用带样式的dateStyle。 Use one or the other, not both. 使用一个或另一个,不要同时使用。 'short" will format the date as: 'short'将日期格式化为:

5/14/07 12:55:42 PM 2007/5/14下午12:55:42

Though I think you'd have to use style="both" to get the time portion. 虽然我认为您必须使用style =“ both”来获取时间部分。

If you want to use a specific pattern try: 如果要使用特定模式,请尝试:

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

or maybe: 或者可能:

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM