Skip to content
Snippets Groups Projects
Commit ab165a7f authored by Cornelius Amzar's avatar Cornelius Amzar Committed by Robert Lange
Browse files

Better implementation of getPlayingTimes in MarcAdvancedTrait (#1751)

parent 9a973cca
No related merge requests found
...@@ -291,12 +291,13 @@ trait MarcAdvancedTrait ...@@ -291,12 +291,13 @@ trait MarcAdvancedTrait
$times = $this->getFieldArray('306', ['a'], false); $times = $this->getFieldArray('306', ['a'], false);
// Format the times to include colons ("HH:MM:SS" format). // Format the times to include colons ("HH:MM:SS" format).
for ($x = 0; $x < count($times); $x++) { foreach ($times as $x => $time) {
$times[$x] = substr($times[$x], 0, 2) . ':' . if (!preg_match('/\d\d:\d\d:\d\d/', $time)) {
substr($times[$x], 2, 2) . ':' . $times[$x] = substr($time, 0, 2) . ':' .
substr($times[$x], 4, 2); substr($time, 2, 2) . ':' .
substr($time, 4, 2);
}
} }
return $times; return $times;
} }
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment