Java Code Examples for org.joda.time.LocalDate.plusYears()

The following are Jave code examples for showing how to use plusYears() of the org.joda.time.LocalDate class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
Example 1
Project: moneytracking   File: MoneyReminder.java   Source Code and License Vote up 6 votes
private Date createPlannedDate(String type, Date d) {
    LocalDate lo = LocalDate.fromDateFields(d);
    switch (type) {
        case "Daily":
            lo = lo.plusDays(1);
            break;
        case "Weekly":
            lo = lo.plusWeeks(1);
            break;
        case "Monthly":
            lo = lo.plusMonths(1);
            break;
        case "Yearly":
            lo = lo.plusYears(1);
            break;
    }
    return lo.toDate();
}