public Date getStartDate ( ) { Date startDate = null ; for ( Task task : m_tasks ) { // // If a hidden "summary" task is present we ignore it // if ( NumberHelper . getInt ( task . getUniqueID ( ) ) == 0 ) { continue ; } // // Select the actual or forecast start date. Note that the // behaviour is different for milestones. The milestone end date // is always correct, the milestone start date may be different // to reflect a missed deadline. // Date taskStartDate ; if ( task . getMilestone ( ) == true ) { taskStartDate = task . getActualFinish ( ) ; if ( taskStartDate == null ) { taskStartDate = task . getFinish ( ) ; } } else { taskStartDate = task . getActualStart ( ) ; if ( taskStartDate == null ) { taskStartDate = task . getStart ( ) ; } } if ( taskStartDate != null ) { if ( startDate == null ) { startDate = taskStartDate ; } else { if ( taskStartDate . getTime ( ) < startDate . getTime ( ) ) { startDate = taskStartDate ; } } } } return ( startDate ) ; }
Find the earliest task start date . We treat this as the start date for the project .