diff --git a/src/TimeTableCatalog/XMLReader.cc b/src/TimeTableCatalog/XMLReader.cc index 2065629..e3b4d88 100644 --- a/src/TimeTableCatalog/XMLReader.cc +++ b/src/TimeTableCatalog/XMLReader.cc @@ -29,7 +29,22 @@ void XMLReader::read(TimeTable& pTT) { // -- parse xml file and process nodes parse(pTT); - + // update listStopDate and listStartDate + if(pTT._listStopDate <=0 || pTT._listStartDate <=0){ + double startDate=std::numeric_limits::max(); + double stopDate = -1; + + for (auto intrval : pTT.getIntervals()){ + if(intrval._startTime stopDate) + stopDate = intrval._stopTime; + } + if(pTT._listStopDate <=0) + pTT._listStopDate = stopDate; + if(pTT._listStartDate <=0) + pTT._listStartDate = startDate; + } // -- cleanup function for the XML library. xmlCleanupParser(); } -- libgit2 0.21.2