2 # Discordian date support fnord ikiwiki.
3 package IkiWiki::Plugin::ddate;
9 hook(type => "getsetup", id => "ddate", call => \&getsetup);
10 hook(type => "checkconfig", id => "ddate", call => \&checkconfig);
21 sub checkconfig () { #{{{
22 if (! defined $config{timeformat} ||
23 $config{timeformat} eq '%c') {
24 $config{timeformat}='on %A, the %e of %B, %Y. %N%nCelebrate %H';
28 sub IkiWiki::displaytime ($;$) { #{{{
31 if (! defined $format) {
32 $format=$config{timeformat};
36 use DateTime::Calendar::Discordian;
39 return "some time or other ($@ -- hail Eris!)";
41 my $dt = DateTime->from_epoch(epoch => $time);
42 my $dd = DateTime::Calendar::Discordian->from_object(object => $dt);
43 return $dd->strftime($format);