2 # Discordian date support fnord ikiwiki.
3 package IkiWiki::Plugin::ddate;
8 hook(type => "checkconfig", id => "skeleton", call => \&checkconfig);
11 sub checkconfig () { #{{{
12 if (! defined $config{timeformat} ||
13 $config{timeformat} eq '%c') {
14 $config{timeformat}='on %A, the %e of %B, %Y. %N%nCelebrate %H';
18 sub IkiWiki::displaytime ($) { #{{{
22 use DateTime::Calendar::Discordian;
25 return "some time or other ($@ -- hail Eris!)";
27 my $dt = DateTime->from_epoch(epoch => $time);
28 my $dd = DateTime::Calendar::Discordian->from_object(object => $dt);
29 return $dd->strftime($IkiWiki::config{timeformat});