From 5b973b22d2a719ebabd9963a22837065e43c4633 Mon Sep 17 00:00:00 2001 From: Matthew Lemon Date: Thu, 5 Oct 2023 08:26:14 +0100 Subject: Fixes leading zero bug resulting in historic logs not being processed --- calendar/dayplan_revised.pl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'calendar/dayplan_revised.pl') 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/) { -- cgit v1.2.3