public boolean evaluateSprintLength ( String startDate , String endDate , int maxKanbanIterationLength ) { boolean sprintIndicator = false ; Calendar startCalendar = Calendar . getInstance ( ) ; Calendar endCalendar = Calendar . getInstance ( ) ; if ( ! StringUtils . isAnyEmpty ( startDate ) && ! StringUtils . isAnyEmpty ( endDate ) ) { Date strDt = convertIntoDate ( startDate . substring ( 0 , 4 ) + "-" + startDate . substring ( 5 , 7 ) + "-" + startDate . substring ( 8 , 10 ) , "yyyy-MM-dd" ) ; Date endDt = convertIntoDate ( endDate . substring ( 0 , 4 ) + "-" + endDate . substring ( 5 , 7 ) + "-" + endDate . substring ( 8 , 10 ) , "yyyy-MM-dd" ) ; if ( strDt != null && endDate != null ) { startCalendar . setTime ( strDt ) ; endCalendar . setTime ( endDt ) ; long diffMill = endCalendar . getTimeInMillis ( ) - startCalendar . getTimeInMillis ( ) ; long diffDays = TimeUnit . DAYS . convert ( diffMill , TimeUnit . MILLISECONDS ) ; if ( diffDays <= maxKanbanIterationLength ) { // Scrum-enough sprintIndicator = true ; } } } else { // Default to kanban sprintIndicator = false ; } return sprintIndicator ; }
Evaluates whether a sprint length appears to be kanban or scrum