Examples of plusYears()


Examples of org.joda.time.DateTime.plusYears()

        assertFunction("date_add('hour', 3, " + seconds + ")", getSeconds(dateTime.plusHours(3)));
        assertFunction("date_add('day', 3, " + seconds + ")", getSeconds(dateTime.plusDays(3)));
        assertFunction("date_add('week', 3, " + seconds + ")", getSeconds(dateTime.plusWeeks(3)));
        assertFunction("date_add('month', 3, " + seconds + ")", getSeconds(dateTime.plusMonths(3)));
        assertFunction("date_add('quarter', 3, " + seconds + ")", getSeconds(dateTime.plusMonths(3 * 3)));
        assertFunction("date_add('year', 3, " + seconds + ")", getSeconds(dateTime.plusYears(3)));
        assertFunction("date_add('century', 3, " + seconds + ")", fromMillis(CENTURY_FIELD.add(dateTime.getMillis(), 3)));
    }

    @Test
    public void testDateDiff()
View Full Code Here

Examples of org.joda.time.LocalDate.plusYears()

           
            // create the HolidayCalendar
            LocalDate startDate = holidayDates.get(0);
            LocalDate endDate = holidayDates.get(holidayDates.size() - 1);
            HolidayCalendar<LocalDate> calendar = new DefaultHolidayCalendar<LocalDate>(
                new HashSet<LocalDate>(holidayDates), startDate.minusYears(100), endDate.plusYears(1000));
             
            return calendar;
        }
       
        /**
 
View Full Code Here

Examples of org.joda.time.LocalDate.plusYears()

                end = max(end, loadTimeLine.getEnd());
            }
        }
        if (timeLines.isEmpty() || start == null || end == null) {
            LocalDate localDateNow = new LocalDate();
            return new Interval(localDateNow, localDateNow.plusYears(5));
        }
        return new Interval(start.toLocalDate(), end.asExclusiveEnd());
    }

    private static GanttDate max(GanttDate one, GanttDate other) {
View Full Code Here

Examples of org.joda.time.LocalDate.plusYears()

      break;
    case ANNUAL:
      if (financialYearBeginningMonth < monthOfYear) {
        periodEndDate = periodStartDate
            .withMonthOfYear(financialYearBeginningMonth);
        periodEndDate = periodEndDate.plusYears(1);
      } else {
        periodEndDate = periodStartDate
            .withMonthOfYear(financialYearBeginningMonth);
      }
      periodEndDate = periodEndDate.dayOfMonth().withMaximumValue();
View Full Code Here

Examples of org.joda.time.LocalDate.plusYears()

                        startDate = startDate.plusMonths(1);
                    }
                } else if (frequencyType.isYearly()) {
                    startDate = startDate.withDayOfMonth(data.recurrenceOnDay()).withMonthOfYear(data.recurrenceOnMonth());
                    if (startDate.isBefore(data.validFrom())) {
                        startDate = startDate.plusYears(1);
                    }
                }
                isDueForTransfer = scheduledDateGenerator.isDateFallsInSchedule(frequencyType, data.recurrenceInterval(), startDate,
                        transactionDate);
View Full Code Here

Examples of org.joda.time.LocalDate.plusYears()

                }
            } else {
                // end date is null then fetch meeting dates tillDate
                periodEndDate = tillDate;
            }
        } else if (endDate == null || endDate.isAfter(currentDate.plusYears(1))) {
            periodEndDate = currentDate.plusYears(1);
        }
        return periodEndDate;
    }
View Full Code Here

Examples of org.joda.time.LocalDate.plusYears()

            } else {
                // end date is null then fetch meeting dates tillDate
                periodEndDate = tillDate;
            }
        } else if (endDate == null || endDate.isAfter(currentDate.plusYears(1))) {
            periodEndDate = currentDate.plusYears(1);
        }
        return periodEndDate;
    }

    @Override
View Full Code Here

Examples of org.joda.time.LocalDate.plusYears()

        } else if (recur.getFrequency().equals(Recur.WEEKLY)) {
            currentDate = currentDate.plusWeeks(recur.getInterval());
        } else if (recur.getFrequency().equals(Recur.MONTHLY)) {
            currentDate = currentDate.plusMonths(recur.getInterval());
        } else if (recur.getFrequency().equals(Recur.YEARLY)) {
            currentDate = currentDate.plusYears(recur.getInterval());
        }

        return getNextRecurringDate(recur, seedDate, currentDate);
    }
View Full Code Here

Examples of org.joda.time.Period.plusYears()

      int value = get(index);

      int years  = (value / org.apache.drill.exec.expr.fn.impl.DateUtility.yearsToMonths);
      int months = (value % org.apache.drill.exec.expr.fn.impl.DateUtility.yearsToMonths);
      Period p = new Period();
      return p.plusYears(years).plusMonths(months);
    }

    public StringBuilder getAsStringBuilder(int index) {

      int months  = data.getInt(index);
View Full Code Here

Examples of org.joda.time.Period.plusYears()

      int value = get(index);

      int years  = (value / org.apache.drill.exec.expr.fn.impl.DateUtility.yearsToMonths);
      int months = (value % org.apache.drill.exec.expr.fn.impl.DateUtility.yearsToMonths);
      Period p = new Period();
      return p.plusYears(years).plusMonths(months);
    }

    public StringBuilder getAsStringBuilder(int index) {

      int months  = data.getInt(index);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.