From gpdambra at gmail.com Wed Apr 16 03:24:17 2008 From: gpdambra at gmail.com (Gianpaolo D'Ambra) Date: Wed, 16 Apr 2008 09:24:17 +0200 Subject: [TZInfo-users] GMT definitions Message-ID: <94b26c1b0804160024y3d580ff4ma7990c30b286f2c7@mail.gmail.com> Hi to everybody! My problem with tzinfo is about definitions. If I choose from my select list Content and city name like "Europe - Athens" (list value "Europe/Athens") everything works fine, but If I choose somenthig like "(GMT+02:00) Athens" (so the list value "Athens") my app gives this error when it try to define the timezone: no such file to load -- tzinfo/definitions/Athens RAILS_ROOT: ../config/.. /usr/lib/ruby/gems/1.8/gems/tzinfo-0.3.4/lib/tzinfo/timezone.rb:108:in `get' /usr/lib/ruby/gems/1.8/gems/tzinfo-0.3.4/lib/tzinfo/timezone.rb:128:in `new' (eval):3:in `tz' Thanks to every answer.. Bye Gp -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/tzinfo-users/attachments/20080416/900872eb/attachment.html From phil.ross at gmail.com Wed Apr 16 05:12:46 2008 From: phil.ross at gmail.com (Philip Ross) Date: Wed, 16 Apr 2008 10:12:46 +0100 Subject: [TZInfo-users] GMT definitions In-Reply-To: <94b26c1b0804160024y3d580ff4ma7990c30b286f2c7@mail.gmail.com> References: <94b26c1b0804160024y3d580ff4ma7990c30b286f2c7@mail.gmail.com> Message-ID: <4ac540410804160212p3c607c06ra8cd9f28b452b5c4@mail.gmail.com> Hi, On 16/04/2008, Gianpaolo D'Ambra wrote: > Hi to everybody! My problem with tzinfo is about definitions. If I choose > from my select list Content and city name like "Europe - Athens" (list value > "Europe/Athens") everything works fine, but If I choose somenthig like > "(GMT+02:00) Athens" (so the list value "Athens") my app gives this error > when it try to define the timezone: > > no such file to load -- tzinfo/definitions/Athens 'Athens' isn't a valid timezone identifier. If you're using TZInfo directly, you'll need to use the actual identifier, 'Europe/Athens' in this case. What are you using to display the list of timezones for selection? You should be able to arrange to display strings like '(GMT+02:00) Athens' but have the value of the associated timezone identifier ('Europe/Athens'). Regards, Phil -- Phil Ross http://tzinfo.rubyforge.org/ -- DST-aware timezone library for Ruby From gpdambra at gmail.com Wed Apr 16 05:32:22 2008 From: gpdambra at gmail.com (Gianpaolo D'Ambra) Date: Wed, 16 Apr 2008 11:32:22 +0200 Subject: [TZInfo-users] GMT definitions In-Reply-To: <4ac540410804160212p3c607c06ra8cd9f28b452b5c4@mail.gmail.com> References: <94b26c1b0804160024y3d580ff4ma7990c30b286f2c7@mail.gmail.com> <4ac540410804160212p3c607c06ra8cd9f28b452b5c4@mail.gmail.com> Message-ID: <94b26c1b0804160232h458134c9q21f656470ee3c2b4@mail.gmail.com> Hi Philip, thank you for the support. I use this for generating my list: <%= time_zone_options_for_select (current_user.time_zone, TZInfo::Timezone.all_country_zones.sort) %> At the moment I didn't find anything better. "My wish" is to list only '(GMT+02:00) *city*' but with th correct values, but I haven't found anything googling. Could you help me? Thank you, Gp On Wed, Apr 16, 2008 at 11:12 AM, Philip Ross wrote: > Hi, > > On 16/04/2008, Gianpaolo D'Ambra wrote: > > Hi to everybody! My problem with tzinfo is about definitions. If I > choose > > from my select list Content and city name like "Europe - Athens" (list > value > > "Europe/Athens") everything works fine, but If I choose somenthig like > > "(GMT+02:00) Athens" (so the list value "Athens") my app gives this > error > > when it try to define the timezone: > > > > no such file to load -- tzinfo/definitions/Athens > > 'Athens' isn't a valid timezone identifier. If you're using TZInfo > directly, you'll need to use the actual identifier, 'Europe/Athens' in > this case. > > What are you using to display the list of timezones for selection? You > should be able to arrange to display strings like '(GMT+02:00) Athens' > but have the value of the associated timezone identifier > ('Europe/Athens'). > > Regards, > > Phil > > -- > Phil Ross > http://tzinfo.rubyforge.org/ -- DST-aware timezone library for Ruby > _______________________________________________ > TZInfo-users mailing list > TZInfo-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/tzinfo-users > -- GP -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/tzinfo-users/attachments/20080416/08ea60fe/attachment-0001.html From phil.ross at gmail.com Wed Apr 16 06:52:38 2008 From: phil.ross at gmail.com (Philip Ross) Date: Wed, 16 Apr 2008 11:52:38 +0100 Subject: [TZInfo-users] GMT definitions In-Reply-To: <94b26c1b0804160232h458134c9q21f656470ee3c2b4@mail.gmail.com> References: <94b26c1b0804160024y3d580ff4ma7990c30b286f2c7@mail.gmail.com> <4ac540410804160212p3c607c06ra8cd9f28b452b5c4@mail.gmail.com> <94b26c1b0804160232h458134c9q21f656470ee3c2b4@mail.gmail.com> Message-ID: <4ac540410804160352l77ff976bt5b6935bb8907207@mail.gmail.com> Hi, On 16/04/2008, Gianpaolo D'Ambra wrote: > I use this for generating my list: > > <%= time_zone_options_for_select (current_user.time_zone, > TZInfo::Timezone.all_country_zones.sort) %> You need to specify the model parameter to make time_zone_options_for_select work with TZInfo: <%= time_zone_options_for_select(current_user.time_zone, nil, TZInfo::Timezone) %> The second parameter is actually a list of priority zones rather than the complete list, so does not need to be specified. > At the moment I didn't find anything better. "My wish" is to list only > '(GMT+02:00) *city*' but with th correct values, but I haven't found > anything googling. Could you help me? The above code will give you a list of all the timezones, but probably not in the format you want. You may want to take a look at the Rails TzinfoTimezone and TzTime plugins to see if they do what you need. Regards, Phil -- Phil Ross http://tzinfo.rubyforge.org/ -- DST-aware timezone library for Ruby From gpdambra at gmail.com Wed Apr 16 07:56:56 2008 From: gpdambra at gmail.com (Gianpaolo D'Ambra) Date: Wed, 16 Apr 2008 13:56:56 +0200 Subject: [TZInfo-users] GMT definitions In-Reply-To: <4ac540410804160352l77ff976bt5b6935bb8907207@mail.gmail.com> References: <94b26c1b0804160024y3d580ff4ma7990c30b286f2c7@mail.gmail.com> <4ac540410804160212p3c607c06ra8cd9f28b452b5c4@mail.gmail.com> <94b26c1b0804160232h458134c9q21f656470ee3c2b4@mail.gmail.com> <4ac540410804160352l77ff976bt5b6935bb8907207@mail.gmail.com> Message-ID: <94b26c1b0804160456g1a937c6cib7a9d106dc02e070@mail.gmail.com> Hi, On Wed, Apr 16, 2008 at 12:52 PM, Philip Ross wrote: > Hi, > > On 16/04/2008, Gianpaolo D'Ambra wrote: > > I use this for generating my list: > > > > <%= time_zone_options_for_select (current_user.time_zone, > > TZInfo::Timezone.all_country_zones.sort) %> > > You need to specify the model parameter to make > time_zone_options_for_select work with TZInfo: > > <%= time_zone_options_for_select(current_user.time_zone, nil, > TZInfo::Timezone) %> > > The second parameter is actually a list of priority zones rather than > the complete list, so does not need to be specified. > > > At the moment I didn't find anything better. "My wish" is to list only > > '(GMT+02:00) *city*' but with th correct values, but I haven't found > > anything googling. Could you help me? > > The above code will give you a list of all the timezones, but probably > not in the format you want. You may want to take a look at the Rails > TzinfoTimezone and TzTime plugins to see if they do what you need. > > Regards, > > Phil > > -- > Phil Ross > http://tzinfo.rubyforge.org/ -- DST-aware timezone library for Ruby > _______________________________________________ > TZInfo-users mailing list > TZInfo-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/tzinfo-users > thanks Phil! I have to specify a model! Now everything is working well! Thank you very much for your help! Bye Gp -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/tzinfo-users/attachments/20080416/e61c121d/attachment.html