With the fields plugin things are a bit different. I have /grails-app/views/_fields/date/_displayWrapper.gsp. This file contains only this:
<%@ page defaultCodec="html" %>
<g:formatDate format="${constraints.format}" date="${value}" />
<%-- This works for the list view, but not the show view --%>
As the comment says, it works perfectly in the list/index view, but not the show view. The format is supplied in the domain class constraints. Getting the date pickers to render as I want them works perfectly with _widget.gsp. I found what it needed on the web. This is what it contains:
<%@ page defaultCodec="html" %>
<g:if test="${constraints.nullable == true}">
<g:datePicker name="${property}" value="${value}" precision="${constraints.attributes.precision}" years="${constraints.attributes.years}" default="none" noSelection="['': '']" />
</g:if>
<g:else>
<g:datePicker name="${property}" value="${value}" precision="${constraints.attributes.precision}" years="${constraints.attributes.years}"/>
</g:else>
Without the _displayWrapper.gsp the domain class constraint format doesn't work at all. Any idea how to get the dates to show in the right format in the show view?
Thanks.
Chris