@@ 301-313 (lines=13) @@ | ||
298 | * @param CultureFeed_Cdb_Data_Calendar_Timestamp $default |
|
299 | * @return CultureFeed_Cdb_Data_Calendar_Timestamp |
|
300 | */ |
|
301 | private function getLastTimestamp(array $timestampList, CultureFeed_Cdb_Data_Calendar_Timestamp $default) |
|
302 | { |
|
303 | $lastTimestamp = $default; |
|
304 | foreach ($timestampList as $timestamp) { |
|
305 | $currentEndDate = Chronos::parse($lastTimestamp->getEndDate()); |
|
306 | $endDate = Chronos::parse($timestamp->getEndDate()); |
|
307 | if ($currentEndDate->lt($endDate)) { |
|
308 | $lastTimestamp = $timestamp; |
|
309 | } |
|
310 | } |
|
311 | ||
312 | return $lastTimestamp; |
|
313 | } |
|
314 | ||
315 | /** |
|
316 | * @param CultureFeed_Cdb_Data_Calendar_Timestamp[] $timestampList |
|
@@ 320-332 (lines=13) @@ | ||
317 | * @param CultureFeed_Cdb_Data_Calendar_Timestamp $default |
|
318 | * @return CultureFeed_Cdb_Data_Calendar_Timestamp |
|
319 | */ |
|
320 | private function getFirstTimestamp(array $timestampList, CultureFeed_Cdb_Data_Calendar_Timestamp $default) |
|
321 | { |
|
322 | $firstTimestamp = $default; |
|
323 | foreach ($timestampList as $timestamp) { |
|
324 | $currentStartTime = Chronos::parse($firstTimestamp->getDate()); |
|
325 | $startTime = Chronos::parse($timestamp->getDate()); |
|
326 | if ($currentStartTime->gt($startTime)) { |
|
327 | $firstTimestamp = $timestamp; |
|
328 | } |
|
329 | } |
|
330 | ||
331 | return $firstTimestamp; |
|
332 | } |
|
333 | } |
|
334 |