diff options
author | Matthew Lemon <y@yulqen.org> | 2023-10-05 08:26:14 +0100 |
---|---|---|
committer | Matthew Lemon <y@yulqen.org> | 2023-10-05 08:26:14 +0100 |
commit | 5b973b22d2a719ebabd9963a22837065e43c4633 (patch) | |
tree | 85fde90d3c4ca5634bedce0e4a5c57e9b39556e0 | |
parent | 8b3a1c7f81cf85f8b227b05f8905709f18933d91 (diff) |
Fixes leading zero bug resulting in historic logs not being processed
-rwxr-xr-x | calendar/dayplan_revised.pl | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/calendar/dayplan_revised.pl b/calendar/dayplan_revised.pl index 2d90f0e..bf03b97 100755 --- a/calendar/dayplan_revised.pl +++ b/calendar/dayplan_revised.pl @@ -38,12 +38,13 @@ sub search_in_tgz { sub this_day { my ($month, $day) = @_; + $day = "0$day" if $day < 10; my @out; my $archive_path = "/home/lemon/Documents/Notes/journal/archives/journal_archive_aug23.tgz"; my $tar = Archive::Tar->new; $tar->read($archive_path); foreach my $file ($tar->get_files) { - if ($file->name =~ /\d\d\d\d-$month-$day.md/) { + if ($file->name =~ /\d\d\d\d-$month-$day\.md/) { my @lines = split(/\n/, $file->get_content); foreach my $line (@lines) { if ($line =~ /^- \d\d:\d\d/) { |