Chris V. Chris V. - 1 year ago 65
Ruby Question

Filter out TZInfo:Timezone Ruby results to exclude

I want to filter out the timezones TZInfo provides so I can exclude the values that are formatted like

(GMT +03:00) Nairobi
which are not compatible with the 95% of the locations there (Europe - Sofia, US - Central etc.).

<%= f.time_zone_select :system_locale, TZInfo::Timezone.all.sort, {}, {:class => 'ui fluid search dropdown'} %>

How can I achieve this ?

Answer Source

You can try this: {|k| !"GMT")}
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download