From e0792e512fe781f2f67afcfe55ce3c2bd138630c Mon Sep 17 00:00:00 2001 From: "luke.schierer@502bb1c5e3da2bf0a6a8c76f17674b51d178247b" Date: Wed, 11 Nov 2020 16:48:01 -0400 Subject: [PATCH] --- ...he_date_parameter_for_the_meta_plugin.mdwn | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/doc/todo/more_flexibility_in_the_date_parameter_for_the_meta_plugin.mdwn b/doc/todo/more_flexibility_in_the_date_parameter_for_the_meta_plugin.mdwn index a4ed2d849..0ec1bdb63 100644 --- a/doc/todo/more_flexibility_in_the_date_parameter_for_the_meta_plugin.mdwn +++ b/doc/todo/more_flexibility_in_the_date_parameter_for_the_meta_plugin.mdwn @@ -1 +1,35 @@ Changing from perl Date::Parse to Date::Manip causes it to accept some strings that it otherwise could not. This is mostly dealing with situations where it has to infer values from partial date strings, but sometimes that is useful. + +``` +luke@schierer@opus001:~/src/ikiwiki/ikiwiki$ cat meta_date_manip.patch +diff --git a/IkiWiki/Plugin/meta.pm b/IkiWiki/Plugin/meta.pm +index cd367da70..dbcf99aea 100644 +--- a/IkiWiki/Plugin/meta.pm ++++ b/IkiWiki/Plugin/meta.pm +@@ -152,9 +152,9 @@ sub preprocess (@) { + # fallthrough + } + elsif ($key eq 'date') { +- eval q{use Date::Parse}; ++ eval q{use Date::Manip}; + if (! $@) { +- my $time = str2time($value); ++ my $time = UnixDate( ParseDate($value), "%s"); + if (defined $time) { + $IkiWiki::pagectime{$page}=$time; + } +@@ -167,9 +167,9 @@ sub preprocess (@) { + } + } + elsif ($key eq 'updated') { +- eval q{use Date::Parse}; ++ eval q{use Date::Manip}; + if (! $@) { +- my $time = str2time($value); ++ my $time = UnixDate ( ParseDate($value), "%s"); + if (defined $time) { + $pagestate{$page}{meta}{updated}=$time; + } +luke@schierer@opus001:~/src/ikiwiki/ikiwiki$ +``` + -- 2.39.2