0
使用时区创建Customer时,timeZone具有该值。当我显示时区时,我想显示选定的选项。如何在grails中显示timeZone选择标签的选项
例如,我想显示SST,萨摩亚标准时间-11:0.0(当前选项)而非太平洋/中途(值)。
我必须在此功能的显示页面中进行更改?
一流的客户{
static constraints = {
}
String name
String timeZone
}
在create.gsp:
在show.gsp<div class="fieldcontain ${hasErrors(bean: customerInstance, field: 'timeZone', 'error')} ">
<label for="timeZone">
<g:message code="customer.timeZone.label" default="timeZone" />
</label>
<g:if test="${customerInstance?.timeZone}">
<g:timeZoneSelect name="timeZone" value="${TimeZone.getTimeZone(customerInstance?.timeZone)}" />
</g:if>
<g:else>
<g:timeZoneSelect name="timeZone" value="${customerInstance?.timeZone}" />
</g:else>
</div>
:
<span class="property-value" aria-labelledby="timeZone-label"><g:fieldValue bean="${customerInstance}" field="timeZone"/></span>