eval { parse_calendar_event($text); };
if (my $err = $@) {
return undef if $noerr;
- die "invalid calendar event '$text'\n";
+ die "invalid calendar event '$text' - $err\n";
}
return $text;
}
if ($time_spec =~ m/^($chars+):($chars+)$/) {
my ($p1, $p2) = ($1, $2);
- $parse_single_timespec->($p1, 24, \$matchall_hours, $hours_hash);
- $parse_single_timespec->($p2, 60, \$matchall_minutes, $minutes_hash);
+ foreach my $p (split(',', $p1)) {
+ $parse_single_timespec->($p, 24, \$matchall_hours, $hours_hash);
+ }
+ foreach my $p (split(',', $p2)) {
+ $parse_single_timespec->($p, 60, \$matchall_minutes, $minutes_hash);
+ }
} elsif ($time_spec =~ m/^($chars)+$/) { # minutes only
$matchall_hours = 1;
foreach my $p (split(',', $time_spec)) {
if ($utc) {
(undef, $min, $hour, $mday, $mon, $year, $wday) = gmtime($last);
+ # gmtime and timegm interpret two-digit years differently
+ $year += 1900;
$startofday = timegm(0, 0, 0, $mday, $mon, $year);
} else {
(undef, $min, $hour, $mday, $mon, $year, $wday) = localtime($last);
+ # localtime and timelocal interpret two-digit years differently
+ $year += 1900;
$startofday = timelocal(0, 0, 0, $mday, $mon, $year);
}