From 3c1d777891d053ff80c91cfdc90d7c28fdc78a91 Mon Sep 17 00:00:00 2001 From: Jonathan Kamens Date: Tue, 25 Feb 2020 10:44:31 -0500 Subject: [PATCH 1/2] Can't specify DURATION without AT The current version of remind doesn't allow DURATION to be specified by AT, so we can't do that. --- ical2rem.pl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ical2rem.pl b/ical2rem.pl index 736b559..e8ab28c 100644 --- a/ical2rem.pl +++ b/ical2rem.pl @@ -322,12 +322,12 @@ sub _process_todos { print $start->month_abbr." ".$start->day." ".$start->year; } print " $leadtime "; - if ($start->hour > 0 or $start->minute > 0) { + if ($duration or $start->hour > 0 or $start->minute > 0) { print " AT "; print $start->strftime("%H:%M"); print " SCHED _sfun ${duration} MSG %a %2 "; } else { - print "${duration} MSG %a "; + print "MSG %a "; } print "%\"", "e($event->{'SUMMARY'}); print(" at ", "e($event->{'LOCATION'})) From f8344b2c96ba82cfc52b46a3ce19482b8442f01e Mon Sep 17 00:00:00 2001 From: Jonathan Kamens Date: Tue, 25 Feb 2020 10:45:11 -0500 Subject: [PATCH 2/2] Remove unnecessary spaces in output --- ical2rem.pl | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/ical2rem.pl b/ical2rem.pl index e8ab28c..0e053f7 100644 --- a/ical2rem.pl +++ b/ical2rem.pl @@ -313,19 +313,19 @@ sub _process_todos { my $minutes = int($seconds / 60); my $hours = int($minutes / 60); $minutes -= $hours * 60; - $duration = sprintf("DURATION %d:%02d", $hours, $minutes); + $duration = sprintf("DURATION %d:%02d ", $hours, $minutes); } print "REM "; if ($iso8601) { - print $start->strftime("%F"); + print $start->strftime("%F "); } else { - print $start->month_abbr." ".$start->day." ".$start->year; + print $start->month_abbr." ".$start->day." ".$start->year." "; } - print " $leadtime "; + print "$leadtime "; if ($duration or $start->hour > 0 or $start->minute > 0) { - print " AT "; + print "AT "; print $start->strftime("%H:%M"); - print " SCHED _sfun ${duration} MSG %a %2 "; + print " SCHED _sfun ${duration}MSG %a %2 "; } else { print "MSG %a "; }