summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xbin/events2md.pl17
1 files changed, 11 insertions, 6 deletions
diff --git a/bin/events2md.pl b/bin/events2md.pl
index c758577..9c10ce0 100755
--- a/bin/events2md.pl
+++ b/bin/events2md.pl
@@ -171,9 +171,14 @@ sub print_event
}
}
my $location = get_property_string( $entry, 'location' );
- my $time_begin = ucfirst( $start->strftime('%A') );
- $time_begin .= $start->strftime(' %e. %B kl. %k.%M');
- my $time_end = $end->strftime('%k.%M');
+ my $date_begin = $start->strftime('%A %e. %B');
+ my $time_begin = $start->strftime('%k.%M');
+ my $time_end = $end->strftime('%k.%M');
+ my $time_brief = ucfirst("$date_begin kl. $time_begin");
+ my $timespan
+ = $time_end
+ ? ucfirst("$date_begin kl. $time_begin-$time_end")
+ : undef;
my %attachments;
if ( $entry->property('attach') ) {
for ( @{ $entry->property('attach') } ) {
@@ -185,7 +190,7 @@ sub print_event
}
}
- $_ = "### $time_begin.";
+ $_ = "### $time_brief.";
$_ .= " $summary"
if $summary;
$_ .= "\n$description";
@@ -193,8 +198,8 @@ sub print_event
if @attendees;
$_ .= " \n**Mødested:** $location"
if $location;
- $_ .= " \n**Tid:** ${time_begin}-${time_end}."
- if $time_begin and $time_end;
+ $_ .= " \n**Tid:** $timespan."
+ if $timespan;
$_ .= " \n**Pris:** $price"
if $price;
$_ .= " \n[Køb billet på Billetto]($attachments{'billetto.dk'}[0])"