Note that as a side effect, dates will now be displayed using the local
timezone, not as GMT.
adminuser => undef,
adminemail => undef,
plugin => [qw{inline htmlscrubber}],
adminuser => undef,
adminemail => undef,
plugin => [qw{inline htmlscrubber}],
} #}}}
sub checkconfig () { #{{{
} #}}}
sub checkconfig () { #{{{
$template->param(pagelink => htmllink($params{page}, $params{page}, $page));
$template->param(content => get_inline_content($params{page}, $page))
if $params{archive} eq "no";
$template->param(pagelink => htmllink($params{page}, $params{page}, $page));
$template->param(content => get_inline_content($params{page}, $page))
if $params{archive} eq "no";
- $template->param(ctime => scalar(gmtime($pagectime{$page})));
+ $template->param(ctime => displaytime($pagectime{$page}));
$ret.=$template->output;
}
$ret.=$template->output;
}
parentlinks => [parentlinks($page)],
content => $content,
backlinks => [backlinks($page)],
parentlinks => [parentlinks($page)],
content => $content,
backlinks => [backlinks($page)],
- mtime => scalar(gmtime($mtime)),
+ mtime => displaytime($mtime),
styleurl => styleurl($page),
);
styleurl => styleurl($page),
);
+sub displaytime ($) { #{{{
+ my $time=shift;
+
+ if ($config{timeformat} eq '%c') {
+ return scalar(localtime($time)); # optimisation
+ }
+ else {
+ eval q{use POSIX};
+ return POSIX::strftime($config{timeformat}, localtime($time));
+ }
+} #}}}
+
sub mtime ($) { #{{{
my $file=shift;
sub mtime ($) { #{{{
my $file=shift;
+ikiwiki (1.5) UNRELEASED; urgency=low
+
+ * Add --timeformat config option to allow changing how dates are displayed.
+ Note that as a side effect, dates will now be displayed using the local
+ timezone, not as GMT.
+
+ -- Joey Hess <joeyh@debian.org> Mon, 29 May 2006 00:50:34 -0400
+
ikiwiki (1.4) unstable; urgency=low
* Tell HTML::Scrubber to treat "/" as a valid attribute which is its
ikiwiki (1.4) unstable; urgency=low
* Tell HTML::Scrubber to treat "/" as a valid attribute which is its
rss => 1,
# Include discussion links on all pages?
discussion => 1,
rss => 1,
# Include discussion links on all pages?
discussion => 1,
+ # Time format (for strftime)
+ #timeformat => '%c',
# To change the enabled plugins, edit this list
#plugin => [qw{pagecount inline brokenlinks search smiley
# htmlscrubber}],
# To change the enabled plugins, edit this list
#plugin => [qw{pagecount inline brokenlinks search smiley
# htmlscrubber}],
--- /dev/null
+There should be a --strftime switch that controls how all the dates are
+formatted.
+++ /dev/null
-There should be a --strftime switch that controls how all the dates are
-formatted.
Enables or disables "Discussion" links from being added to the header of
every page. The links are enabled by default.
Enables or disables "Discussion" links from being added to the header of
every page. The links are enabled by default.
+* --timeformat format
+
+ Specify how to display the time or date. The format string is passed to the
+ strftime(3) function.
+
* --verbose
Be vebose about what is being done.
* --verbose
Be vebose about what is being done.
"svnrepo" => \$config{svnrepo},
"svnpath" => \$config{svnpath},
"adminemail=s" => \$config{adminemail},
"svnrepo" => \$config{svnrepo},
"svnpath" => \$config{svnpath},
"adminemail=s" => \$config{adminemail},
+ "timeformat=s" => \$config{timeformat},
"exclude=s@" => sub {
$config{wiki_file_prune_regexp}=qr/$config{wiki_file_prune_regexp}|$_[1]/;
},
"exclude=s@" => sub {
$config{wiki_file_prune_regexp}=qr/$config{wiki_file_prune_regexp}|$_[1]/;
},