$date = undef;
$time = undef;
}
- s/\s*\[[\.\d]+\]\s*\[[\.\d]+\]\s*$//;
- my $string = $_;
- my ($d1,$d2) = map {s/^\s*\*\s*//;
- UnixDate(ParseDate($_),'%s')
- } split /\s*-\s*/;
+ s/\s*\[[\.\d]+\]\s*\[[\.\d]+\]\s*$//;
+ my ($d1,$d2);
+ if (/\s*\*\s*CLOCK:\s+\[([^\]]+)\]--\[([^\]]+)\]/) {
+ $d1 = UnixDate(ParseDate($1),'%s');
+ $d2 = UnixDate(ParseDate($2),'%s');
+ } else {
+ ($d1,$d2) = map {s/^\s*\*\s*//;
+ UnixDate(ParseDate($_),'%s')
+ } split /\s*-\s*/;
+ }
+ my $string = '* '.strftime('%A, %B %e, %H:%M:%S',localtime($d1)).' - '.
+ strftime('%A, %B %e, %H:%M:%S',localtime($d2));
if (not defined $first_date) {
$first_date = $d1;
}
}
$time = $hours;
$totaldelta += $delta;
- $calc_log .= qq($string [).sprintf('%.2f',$hours).qq(] [).sprintf('%.2f',$totaldelta/(60*60)).qq(]\n);
+ $calc_log .= $string.q( [).sprintf('%.2f',$hours).qq(] [).sprintf('%.2f',$totaldelta/(60*60)).qq(]\n);
}
elsif (/^\s+-\s*(.+)/) {
my $event = $1;