Example usage for org.joda.time Partial plus

List of usage examples for org.joda.time Partial plus

Introduction

In this page you can find the example usage for org.joda.time Partial plus.

Prototype

public Partial plus(ReadablePeriod period) 

Source Link

Document

Gets a copy of this instance with the specified period added.

Usage

From source file:net.sourceforge.fenixedu.presentationTier.renderers.providers.coordinator.tutor.MonthYearsProviderTutorshipManagement.java

License:Open Source License

@Override
public Object provide(Object source, Object currentValue) {

    List<String> result = new ArrayList<String>();

    ChangeTutorshipBean tutorshipBean = (ChangeTutorshipBean) source;

    Partial startMonthYear = tutorshipBean.getTutorship().getStartDate();
    startMonthYear = startMonthYear.plus(Period.years(2));

    Partial endMonthYear = startMonthYear.plus(Period.years(Tutorship.TUTORSHIP_MAX_PERIOD));

    while (startMonthYear.compareTo(endMonthYear) < 0) {
        String line = tutorshipBean.generateMonthYearOption(startMonthYear.get(DateTimeFieldType.monthOfYear()),
                startMonthYear.get(DateTimeFieldType.year()));
        result.add(line);//from  w  w w  .java  2s.co m

        startMonthYear = startMonthYear.plus(Period.months(1));
    }

    return result;
}