private void getYearlyAbsoluteDates ( Calendar calendar , List < Date > dates ) { long startDate = calendar . getTimeInMillis ( ) ; calendar . set ( Calendar . DAY_OF_MONTH , 1 ) ; calendar . set ( Calendar . MONTH , NumberHelper . getInt ( m_monthNumber ) - 1 ) ; int requiredDayNumber = NumberHelper . getInt ( m_dayNumber ) ; while ( moreDates ( calendar , dates ) ) { int useDayNumber = requiredDayNumber ; int maxDayNumber = calendar . getActualMaximum ( Calendar . DAY_OF_MONTH ) ; if ( useDayNumber > maxDayNumber ) { useDayNumber = maxDayNumber ; } calendar . set ( Calendar . DAY_OF_MONTH , useDayNumber ) ; if ( calendar . getTimeInMillis ( ) < startDate ) { calendar . add ( Calendar . YEAR , 1 ) ; } dates . add ( calendar . getTime ( ) ) ; calendar . set ( Calendar . DAY_OF_MONTH , 1 ) ; calendar . add ( Calendar . YEAR , 1 ) ; } }
Calculate start dates for a yearly absolute recurrence .