From eefe1e26fcc5357cb4991ea2ca265462d9a8585f Mon Sep 17 00:00:00 2001 From: Nathanaƫl Jourdane Date: Thu, 14 Jun 2018 16:15:29 +0200 Subject: [PATCH] Improve DOY parsing --- php/classes/TimeTableMgr.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/php/classes/TimeTableMgr.php b/php/classes/TimeTableMgr.php index 824e788..181cc7b 100644 --- a/php/classes/TimeTableMgr.php +++ b/php/classes/TimeTableMgr.php @@ -339,7 +339,7 @@ class TimeTableMgr extends AmdaObjectMgr } else { $isoFormat = 'Y-m-dTH:i:s'; $doyFormat = 'Y z H i s'; - $doyRegex = '(\d{4}) (\d{3}) (\d{2}) (\d{2}) (\d{2})'; + $doyRegex = '(\d{4}) (\d{2,3}) (\d{2}) (\d{2}) (\d{2})( \d{2})?'; if (preg_match('/^' . $doyRegex . ' ' . $doyRegex . '$/', $line)) { $startDate = DateTime::createFromFormat($doyFormat, substr($line, 0, 17))->format($isoFormat); -- libgit2 0.21.2