Skip to content

Commit

Permalink
Merge pull request #6 from jikamens/no_duration_without_at
Browse files Browse the repository at this point in the history
Can't use DURATION without AT, plus remove unnecessary spaces from output
  • Loading branch information
jbalcorn authored Feb 27, 2020
2 parents d4d11a4 + f8344b2 commit a144cbd
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions ical2rem.pl
Original file line number Diff line number Diff line change
Expand Up @@ -313,21 +313,21 @@ 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 ";
if ($start->hour > 0 or $start->minute > 0) {
print " AT ";
print "$leadtime ";
if ($duration or $start->hour > 0 or $start->minute > 0) {
print "AT ";
print $start->strftime("%H:%M");
print " SCHED _sfun ${duration} MSG %a %2 ";
print " SCHED _sfun ${duration}MSG %a %2 ";
} else {
print "${duration} MSG %a ";
print "MSG %a ";
}
print "%\"", &quote($event->{'SUMMARY'});
print(" at ", &quote($event->{'LOCATION'}))
Expand Down

0 comments on commit a144cbd

Please sign in to comment.