summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonas Smedegaard <dr@jones.dk>2021-05-20 21:21:19 +0200
committerJonas Smedegaard <dr@jones.dk>2021-05-20 21:21:19 +0200
commit8b9e43598b0151e00d2ef3642e1f9fd61e037f92 (patch)
treea7052c21d82f57257fbae85c12e978c7e2ee5d57
parent0f7f1df7ca760f54911453a842a79500360e65d3 (diff)
tidy: define scope start and end when used
-rwxr-xr-xbin/events2md.pl4
1 files changed, 2 insertions, 2 deletions
diff --git a/bin/events2md.pl b/bin/events2md.pl
index 89bf43f..9253050 100755
--- a/bin/events2md.pl
+++ b/bin/events2md.pl
@@ -90,8 +90,6 @@ $log->debugf( 'resolved credentials for user %s', $user );
# fetch and parse calendar data
$log->debug('fetch and parse calendar data...');
-my $start = DateTime->now;
-my $end = $start->clone->add( months => 1 );
my $calendar = Cal::DAV->new(
user => $user,
pass => $pass,
@@ -132,6 +130,8 @@ if ( $log->is_trace ) {
# serialize calendar events
$log->debug('serialize calendar events...');
+my $start = DateTime->now;
+my $end = $start->clone->add( months => 1 );
my $parser = iCal::Parser->new( start => $start, end => $end );
my $events = $parser->parse_strings( $calendar->as_string );
if ( $log->is_trace ) {