# HG changeset patch # User Pranshu Sharma # Date 1736689778 -36000 # Node ID b339b5ef7c977bd7f6a10dddce5b2a9f6a6c5950 # Parent dc1add4ee5259212b283f2b0168327a1530535d0 please don't look at diff diff -r dc1add4ee525 -r b339b5ef7c97 genorg.pl --- a/genorg.pl Sun Jan 12 16:14:26 2025 +1000 +++ b/genorg.pl Sun Jan 12 23:49:38 2025 +1000 @@ -635,7 +635,8 @@ for ($dom->findnodes('/html/body/div[@id="postamble"]/p[@class="date"]')) { my $text = $_->to_literal; if ($text =~ /^Date: (\d+)-(\d+)-(\d+)/) { - my $date = PDate->new($1, $2, $3); + # Well, at least you will learn something new + my $date = PDate->new(@{^CAPTURE}); $data{date} = $date; my $p = $_->parentNode; $p->parentNode->removeChild($p); @@ -708,8 +709,8 @@ qw(January Febuary March April May June July August September November October December); my $n = $self->{day}; if ($n == 1) { $n = '1st' } - elsif (($n - 2) % 10 == 0) { $n = "${n}nd" } - elsif (($n - 3) % 10 == 0) { $n = "${n}rd" } + elsif ($n == 22 || $n == 2) { $n = "${n}nd" } + elsif ($n == 23 || $n == 3) { $n = "${n}rd" } else { $n = "${n}th" } $months[$self->{month} - 1] . " $n, " . $self->{year} }