简体   繁体   English

g:timeZoneSelect在Grails 2.0中

[英]g:timeZoneSelect in Grails 2.0

I am using the following in a .gsp file 我在.gsp文件中使用以下内容

<g:timeZoneSelect name="timezone" value="${user?.timezone}"/>

But the ending list given for selection has many, many repeating values for each timezone for example I count at least 14 choices for: 但是给出的用于选择的结束列表对于每个时区有很多很多重复的值,例如,我为至少14个选择计数:

MST, Mountain Standard Time -7:00

Am I doing something wrong or is this a bug? 我是在做错什么还是错误?

If you look at the source for the controller, it's because they are rendering a slot for each timezone region. 如果您查看控制器的来源,那是因为它们正在为每个时区区域渲染一个插槽。 For example: 例如:

<option value="America/Boise" >MST, Mountain Standard Time -7:0.0</option>
<option value="America/Cambridge_Bay" >MST, Mountain Standard Time -7:0.0</option>
<option value="America/Chihuahua" >MST, Mountain Standard Time -7:0.0</option>
<option value="America/Dawson_Creek" >MST, Mountain Standard Time -7:0.0</option>
<option value="America/Denver" >MST, Mountain Standard Time -7:0.0</option>
<option value="America/Edmonton" >MST, Mountain Standard Time -7:0.0</option>
<option value="America/Hermosillo" >MST, Mountain Standard Time -7:0.0</option>
<option value="America/Inuvik" >MST, Mountain Standard Time -7:0.0</option>

I would say this is a bug. 我会说这是一个错误。 I think it should either include the city names, or collapse repeat values, because there is no way to differentiate them. 我认为它应该包括城市名称,或折叠重复值,因为没有办法区分它们。

There is a JIRA open for this . 为此有一个JIRA Please vote. 请投票。

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

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