List of usage examples for org.joda.time Partial compareTo
public int compareTo(ReadablePartial other)
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 ww w. j a va 2 s. co m*/ startMonthYear = startMonthYear.plus(Period.months(1)); } return result; }
From source file:se.inera.intyg.intygstjanst.persistence.model.dao.impl.DateFilter.java
License:Open Source License
/** * Checks if date is within interval (from, to). * * @param date date to check/* w w w . jav a 2s . c om*/ * @param from first date in interval * @param to last date in interval * * @return true if date is within interval */ private boolean isWithin(Partial date, LocalDate from, LocalDate to) { if (date == null) { return true; } return date.compareTo(from) >= 0 && date.compareTo(to) <= 0; }