简体   繁体   中英

g:timeZoneSelect in Grails 2.0

I am using the following in a .gsp file

<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:

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 . Please vote.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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