Hey Jon,

Is there any reason you're not using the basic TimeZone class that  
comes bundled with rails? Also the third argument to time_zone_select  
is "priority zones", or zones that will be moved to the top of the list.

When I do:
<%= time_zone_select 'user', 'time_zone', nil, :include_blank => true %>
It shows a much smaller list of time zones, while still including  
international zones.


If that's not an option, and you need the full list. The best  
solution will likely be jumping to the time zone section that the  
user is most likely to pick via some JS.

(new Date().getTimezoneOffset()/60)

gives me my correct timezone offset, so you could correctly jump me  
to the california section but not the San Diego section using code  
like that. Unfortunately this solution will require having the  
offsets available in the html somewhere, and the code you're using  
does not.


Hopefully that helps, either way I'd love to hear what you end up  
going with... perhaps you can show me at next months meet up?

Cheers,
David



On Jan 17, 2008, at 3:02 PM, Jon Buda wrote:
> hey all,
>
> haven't been too active in the group yet, but I'll try to make the
> next meeting. It's been tough getting there on time. certainly some
> good info flying around the list.
>
> I've implemented tzinfo_timezone plugin in a project of mine and
> everything is working just fine as far as time zone conversions go,
> but I was wondering if anyone who has used it knows of a way to reduce
> the size of the drop-down menu created from plugin. Currently I am
> doing:
>
> <%= time_zone_select 'user', 'time_zone',
> TZInfo::Timezone.all.sort, :model => TZInfo::Timezone, :include_blank
> => true %>
>
> This results in a drop-down menu several hundred items long which
> seems like overkill to me. I could reduce it down to just listing the
> GMT offsets, but seriously how many people know their GMT offset? I
> know I don't without looking it up. It's an international site so I
> can't just limit it to US time zones.
>
> Any ideas on how to make this thing a little more user friendly?
>
> Thanks in advance,
> Jon Buda
>
> >


--~--~---------~--~----~------------~-------~--~----~
SD Ruby mailing list
[email protected]
http://groups.google.com/group/sdruby
-~----------~----~----~----~------~----~------~--~---

Reply via email to