Commit eefe1e26fcc5357cb4991ea2ca265462d9a8585f

Authored by Nathanaël Jourdane
1 parent efb57954

Improve DOY parsing

Showing 1 changed file with 1 additions and 1 deletions   Show diff stats
php/classes/TimeTableMgr.php
... ... @@ -339,7 +339,7 @@ class TimeTableMgr extends AmdaObjectMgr
339 339 } else {
340 340 $isoFormat = 'Y-m-dTH:i:s';
341 341 $doyFormat = 'Y z H i s';
342   - $doyRegex = '(\d{4}) (\d{3}) (\d{2}) (\d{2}) (\d{2})';
  342 + $doyRegex = '(\d{4}) (\d{2,3}) (\d{2}) (\d{2}) (\d{2})( \d{2})?';
343 343  
344 344 if (preg_match('/^' . $doyRegex . ' ' . $doyRegex . '$/', $line)) {
345 345 $startDate = DateTime::createFromFormat($doyFormat, substr($line, 0, 17))->format($isoFormat);
... ...