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$ 

Thanks for the patch! I've reviewed it, and here's what I think.

I can see the value of accepting more date formats for the field. But, I'd like to see some concrete examples of useful forms that are not currently accepted: both in terms of user-facing documentation (update meta; in particular references to TimeDate) and test coverage (./t/meta.pl).

The cost of this feature is an additional dependency on the relevant Perl module Debian package libdate-manip-perl, ~11.7MiB). Therefore, part of evaluating the patch is weighing up the costs and benefits. Spelling out the benefits better would help me.

If/when that's done, that new Date::Manip dependency should be recorded explicitly in the right places, which raises the question: what are the right places? I think Bundle/Ikiwiki.pm needs updating, perhaps other places (ignore ikiwiki.spec and debian/* for now).

Jon, 2024-03-07