private void processWorkWeekDay ( byte [ ] data , int offset , ProjectCalendarWeek week , Day day ) { //System.out.println(ByteArrayHelper.hexdump(data, offset, 60, false)); int dayType = MPPUtility . getShort ( data , offset + 0 ) ; if ( dayType == 1 ) { week . setWorkingDay ( day , DayType . DEFAULT ) ; } else { ProjectCalendarHours hours = week . addCalendarHours ( day ) ; int rangeCount = MPPUtility . getShort ( data , offset + 2 ) ; if ( rangeCount == 0 ) { week . setWorkingDay ( day , DayType . NON_WORKING ) ; } else { week . setWorkingDay ( day , DayType . WORKING ) ; Calendar cal = DateHelper . popCalendar ( ) ; for ( int index = 0 ; index < rangeCount ; index ++ ) { Date startTime = DateHelper . getCanonicalTime ( MPPUtility . getTime ( data , offset + 8 + ( index * 2 ) ) ) ; int durationInSeconds = MPPUtility . getInt ( data , offset + 20 + ( index * 4 ) ) * 6 ; cal . setTime ( startTime ) ; cal . add ( Calendar . SECOND , durationInSeconds ) ; Date finishTime = DateHelper . getCanonicalTime ( cal . getTime ( ) ) ; hours . addRange ( new DateRange ( startTime , finishTime ) ) ; } DateHelper . pushCalendar ( cal ) ; } } }
Process an individual work week day .