From 78c750f2d28f23e7cfc56890999bcd313cf711c7 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 24 Mar 2011 13:36:16 -0400 Subject: [PATCH] Add timezone setting in setup file. This alows time zone to be configured via the web. --- IkiWiki.pm | 14 ++++++++++++++ debian/changelog | 7 +++++++ doc/todo/configurable_timezones.mdwn | 5 +---- 3 files changed, 22 insertions(+), 4 deletions(-) diff --git a/IkiWiki.pm b/IkiWiki.pm index 9de25a4b3..1c05a7aa5 100644 --- a/IkiWiki.pm +++ b/IkiWiki.pm @@ -336,6 +336,14 @@ sub getsetup () { safe => 0, # paranoia rebuild => 0, }, + timezone => { + type => "string", + default => "", + example => "US/Eastern", + description => "time zone name", + safe => 1, + rebuild => 1, + }, include => { type => "string", default => undef, @@ -529,6 +537,12 @@ sub checkconfig () { $ENV{$val}=$config{ENV}{$val}; } } + if (defined $config{timezone} && length $config{timezone}) { + $ENV{TZ}=$config{timezone}; + } + else { + $config{timezone}=$ENV{TZ}; + } if ($config{w3mmode}) { eval q{use Cwd q{abs_path}}; diff --git a/debian/changelog b/debian/changelog index b8a6c8c88..b483c29cc 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +ikiwiki (3.20110322) UNRELEASED; urgency=low + + * Add timezone setting in setup file. This alows time zone to be configured + via the web. + + -- Joey Hess Thu, 24 Mar 2011 13:34:34 -0400 + ikiwiki (3.20110321) unstable; urgency=low * comment: Don't show comments of subpages on parent pages. diff --git a/doc/todo/configurable_timezones.mdwn b/doc/todo/configurable_timezones.mdwn index f8b1dbbab..36f2e9dbb 100644 --- a/doc/todo/configurable_timezones.mdwn +++ b/doc/todo/configurable_timezones.mdwn @@ -4,7 +4,4 @@ This is nice for shared hosting, and other situation where the user doesn't have > [[done]] via the ENV setting in the setup file. --[[Joey]] - -Example (ikiwiki.setup): - - ENV => { TZ => "Europe/Sofia" } +>> Now via a timezone setting that is web configurable. --[[Joey]]