- sub { decode_entities($_) foreach @_ }->($location, $summary, defined $more ? $more : ());
- sub { $_ = encode('UTF-8', $_) foreach @_ }->($location, $summary, defined $more ? $more : ());
-
- my $offset = $Config->{offset} ? $Config->{offset} : ((localtime)[8] ? '+0200' : '+0100');
-
+ my $get_offset = sub
+ {
+ my ($hour, $minute) = @_;
+ return $Config->{offset} if $Config->{offset};
+ my $dt = DateTime->new(
+ year => $year,
+ month => $month,
+ day => $day,
+ hour => $hour,
+ minute => $minute,
+ time_zone => 'Europe/Zurich',
+ );
+ return $dt->is_dst() ? '+0200' : '+0100';
+ };