views:

346

answers:

1

Hi! I am developing a groovy application and I am having problems when showing a Date field.

If I use the following notation:

<g:formatDate format="dd.MM.yyyy" date="${fieldValue(bean: incidentTicketSLAInstance, field: "erstellungsDatum")}"/>

I am getting the actual date instead of what is saved at the DB.

When I use this notation it works properly.

<g:formatDate format="dd.MM.yyyy" date="${incidentTicketSLAInstance?.erstellungsDatum}" />

am I doing something wrong here? Are not both notations equivalent? (BTW, the instance DO exists and erstellungsDatum is NOT null)

Thanks in advance,

Luis

+1  A: 

the fieldValue call will return a String, not a Date object, which the makes formatDate not work correctly

You have to use the second notation (as you spotted)

tim_yates
thanks for your answer, Luis
Luixv