0

I am using p:cellEditor, but when I am editing my date field it changes with selected date with time as 00:00:00:0

I want only date to be displayed , I dont know how to remove time . '

<p:dataTable  id="foodTableId" var="v" value="#{dashboardBean.myFoodList}" paginator="true"rows="#{msg['dashboard.product.mapping.datatable.rows']}" editable="true" >

                                                            <p:ajax event="rowEdit" listener="#{dashboardBean.onEdit}" />
                                                            <p:ajax event="rowEditCancel" listener="#{dashboardBean.onCancel}" />



                                <p:column sortBy="#{v.promoDate}"  headerText="Action Date">
                                                                <p:cellEditor>
                                                                    <f:facet name="output">
                                                                        <h:outputText
                                                                            value="#{v.promoDate}" />
                                                                    </f:facet>
                                                                    <f:facet name="input">
                                                                        <p:calendar value="#{v.promoDate}" />
                                                                    </f:facet>
                                                                </p:cellEditor>
                                                            </p:column>

                                                            <p:column headerText="#{msg['product.label.edit']}"
                                                                style="width:20%">
                                                                <p:rowEditor />
                                                            </p:column>


                                                        </p:dataTable>
4

1 回答 1

2

您需要添加属性pattern。这样的事情会做:

<p:calendar pattern="MMM dd, yyyy" value="#{v.promoDate}" />

看来您还没有触及文档:)。它不会咬人:P

于 2013-11-12T05:53:39.760 回答