Fix #2544
This commit is contained in:
parent
cf199cbdba
commit
0d92db9a0f
|
@ -244,17 +244,15 @@ sub get_duration {
|
|||
my ($self, %options) = @_;
|
||||
|
||||
# Format: [[dd-]hh:]mm:ss
|
||||
my ($seconds, $min, $lpart) = split /:/, $options{elapsed};
|
||||
my $total_seconds_elapsed = $seconds + ($min * 60);
|
||||
if (defined($lpart)) {
|
||||
my ($day, $hour) = split /-/, $lpart;
|
||||
$options{elapsed} =~ /(?:(\d+)-)?(?:(\d+):)?(\d+):(\d+)/;
|
||||
my ($day, $hour, $min, $sec) = ($1, $2, $3, $4);
|
||||
my $total_seconds_elapsed = $sec + ($min * 60);
|
||||
if (defined($hour)) {
|
||||
$total_seconds_elapsed += ($hour * 60 * 60);
|
||||
}
|
||||
if (defined($day)) {
|
||||
$total_seconds_elapsed += ($day * 86400);
|
||||
}
|
||||
}
|
||||
|
||||
return $total_seconds_elapsed;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue