Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 816673
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T01:52:19+00:00 2026-05-15T01:52:19+00:00

I am wanting to use the g:timeZoneSelect tag within my application, problem is im

  • 0

I am wanting to use the g:timeZoneSelect tag within my application, problem is im finding the resulting html select to be quite overwhelming.

  1. Over 600 options are being displayed, IMHO this is to much to display to the user. Maybe someone could point me to an example of a much more manageable list of timezones? Maybe you have seen a site that does timezone selection well? Im sure over 600 option is “technically” correct, but this will just look like noise to the user.

  2. The display value of the timezone is to long.

E.g. “CST, Central Standard Time (South Australia/New South Wales) 9.5:30.0”

Just “CST, Central Standard Time” or “Australia/Broken_Hill” would be better

Is there a way to address these issues via tag attributes of some sort (cant find any in the docs) or config that I am unaware of?

Or, is my best bet to wrap an html select within a custom tag lib and “roll my own” solution (Id prefer not to).

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T01:52:19+00:00Added an answer on May 15, 2026 at 1:52 am

    Having a look at the source, there’s no way to override the “optionValue” attribute, as it is set in the taglib method itself

    So I guess you’d have to roll your own 🙁

    The source for the original tag is here, which should be a good starting point. You’d probably need something like this:

    class MyNewTagLib {
        static namespace = 'my'
        def tzSelect = { attrs ->
            attrs['from'] = TimeZone.getAvailableIDs();
            attrs['value'] = (attrs['value'] ? attrs['value'].ID : TimeZone.getDefault().ID)
            def date = new Date()
    
            // set the option value as a closure that formats the TimeZone for display
            attrs['optionValue'] = {
                TimeZone tz = TimeZone.getTimeZone(it);
                def shortName = tz.getDisplayName(tz.inDaylightTime(date), TimeZone.SHORT);
                def longName = tz.getDisplayName(tz.inDaylightTime(date), TimeZone.LONG);
    
                return "${shortName}/${longName}"
            }
    
            // use generic select
            out << g.select(attrs)
        }
    }
    

    Then you could do:

    <my:tzSelect/>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm wanting to use http_build_query to change an array to html tag properties. Problem
I'm developing a new ASP.NET MVC 2.0 application and wanting to use the new
I'm wanting to use a bunch of client-side EJS (or jQuery) HTML Templates in
I'm trying to write a java application in Eclipse. I'm really wanting to use
I am wanting to use keywords within a large string. These keywords start and
I am wanting to use the Facebox plugin for JQuery but am having a
I'm wanting to use jQuery to wrap a mailto: anchor around an email address,
I'm wanting to use google maps and see a million ways to do it
I am wanting to use jquery to do a show/hide of a DIV from
I'm wanting to use the jquery dialog to open a modal dialog, and in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.