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