TimeZone adjustment & display

First let me say that I’m just getting started using Radiant; it looks
very cool and will be useful to the client I’m setting it up for.

I wanted to note the method I used to set the timezone for my
installation so it will be in the mailing list archives, and to make a
very small suggestion.

I found the details regarding setting the timezone in
app/models/radiant/config.rb which pointed me to
http://api.rubyonrails.org/classes/TimeZone.html for details on TimeZone
specification in Rails. For my installation I did:

$ ./script/console production

Radiant::Config[“local.timezone”] = “Pacific Time (US & Canada)”

It was useful to find a to_hash method as well:

Radiant::Config.to_hash
=> {“defaults.page.parts”=>“body, extended”,
“defaults.page.status”=>“draft”, “admin.title”=>“Radiant CMS”,
“admin.subtitle”=>“Publishing for Small Teams”,
“local.timezone”=>“Pacific Time (US & Canada)”}

My suggestion would be to alter the updated_at string that shows in the
page edit view (app/views/admin/page/edit.rhtml) to show the timezone.
It gets the string from the timestamp method in
app/helpers/application_helper.rb which looks like:
adjust_time(time).strftime("%I:%M %p on %B %d, %Y")

If it was
adjust_time(time).strftime("%I:%M %p %Z on %B %d, %Y")

then the time zone would also appear on the “page editing” page. I
expect we’ll have people in multiple time zones editing pages, and this
would help them.

Thanks for a very cool app! Bill

On Thu, 2007-12-27 at 20:16 -0800, Bill B. wrote:

I found the details regarding setting the timezone in
app/models/radiant/config.rb which pointed me to
http://api.rubyonrails.org/classes/TimeZone.html for details on TimeZone
specification in Rails. For my installation I did:

$ ./script/console production

Radiant::Config[“local.timezone”] = “Pacific Time (US & Canada)”

I’ve been finding lots of little gems in the mailing list. Like what
should have been obvious… A better place than the console for setting
configuration data is, duh… in config/environment.rb. At the bottom I
put:

require ‘radiant/config’
Radiant::Config[“local.timezone”] = “Pacific Time (US & Canada)”

Bill

On 1/9/08, Bill B. [email protected] wrote:

I’ve been finding lots of little gems in the mailing list. Like what
should have been obvious…

If anyone feels like they would have the time to put together lots of
little “How To” articles detailing techniques of this nature, I would
love to give you access to the Radiant Blog so that you could do that
there. E-mail me personally if this sounds like something up your
alley.


John L.
http://wiseheartdesign.com

“John L.” [email protected] writes:

On 1/9/08, Bill B. [email protected] wrote:

I’ve been finding lots of little gems in the mailing list. Like what
should have been obvious…

If anyone feels like they would have the time to put together lots of
little “How To” articles detailing techniques of this nature, I would
love to give you access to the Radiant Blog so that you could do that
there. E-mail me personally if this sounds like something up your
alley.

We could at least start getting this all on the wiki.

A community effort to finish the Radiant Handbook could also do
wonders for bringing on new users. That actually brings me to a
question: should we all feel impowered to just directly work on
additions to the wiki handbook or should we post revisions here first?


J Aaron F. jadetower.com [US] +1 724-964-4515
馮傑仁 cubiclemuses.com [HK] +852 8123-7905

On Jan 9, 2008, at 9:35 AM, J Aaron F. wrote:

alley.

We could at least start getting this all on the wiki.

I’d rather see at least an intro to the HowTo appear on the Blog. It’s
nice to have fresh content there.

A community effort to finish the Radiant Handbook could also do
wonders for bringing on new users. That actually brings me to a
question: should we all feel impowered to just directly work on
additions to the wiki handbook or should we post revisions here first?

Feel empowered. Bless you my son. :slight_smile:


John L.
http://wiseheartdesign.com

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs