aboutsummaryrefslogtreecommitdiff
path: root/bin/events2md.pl
diff options
context:
space:
mode:
Diffstat (limited to 'bin/events2md.pl')
-rwxr-xr-xbin/events2md.pl12
1 files changed, 10 insertions, 2 deletions
diff --git a/bin/events2md.pl b/bin/events2md.pl
index 6d73768..4272291 100755
--- a/bin/events2md.pl
+++ b/bin/events2md.pl
@@ -213,12 +213,20 @@ sub resolve_event
my $location = get_property_string( $entry, 'location' );
my $date_begin = $start->strftime('%A %e. %B');
my $time_begin = $start->strftime('%k.%M');
+ my $date_end = $end->strftime('%A %e. %B');
my $time_end = $end->strftime('%k.%M');
- my $time_brief = ucfirst("$date_begin kl. $time_begin");
+ my $datespan
+ = ( defined($end) and $date_end ne $date_begin )
+ ? ucfirst("$date_begin - $date_end")
+ : ucfirst("$date_begin");
my $timespan
- = $time_end
+ = ( defined($end) and not $_->all_day )
? ucfirst("$date_begin kl. $time_begin-$time_end")
: undef;
+ my $time_brief
+ = $_->all_day
+ ? $datespan
+ : ucfirst("$date_begin kl. $time_begin");
my @attachments;
if ( $entry->property('attach') ) {