Example usage for org.joda.time YearMonthDay isBefore

List of usage examples for org.joda.time YearMonthDay isBefore

Introduction

In this page you can find the example usage for org.joda.time YearMonthDay isBefore.

Prototype

public boolean isBefore(ReadablePartial partial) 

Source Link

Document

Is this partial earlier than the specified partial.

Usage

From source file:net.sourceforge.fenixedu.applicationTier.Factory.RoomSiteComponentBuilder.java

License:Open Source License

private void getLessonInstanceOccupations(List<InfoObject> infoShowOccupations,
        YearMonthDay weekStartYearMonthDay, YearMonthDay weekEndYearMonthDay,
        Collection<LessonInstance> lessonInstances) {

    if (lessonInstances != null) {
        for (LessonInstance lessonInstance : lessonInstances) {
            final YearMonthDay lessonInstanceDay = lessonInstance.getDay();
            if (!lessonInstanceDay.isBefore(weekStartYearMonthDay)
                    && !lessonInstanceDay.isAfter(weekEndYearMonthDay)) {
                InfoLessonInstance infoLessonInstance = new InfoLessonInstance(lessonInstance);
                infoShowOccupations.add(infoLessonInstance);
            }/*  w w w  .  j  a v a  2 s.c o  m*/
        }
    }
}

From source file:net.sourceforge.fenixedu.applicationTier.Factory.RoomSiteComponentBuilder.java

License:Open Source License

private void getWrittenEvaluationRoomOccupations(List<InfoObject> infoShowOccupations,
        final YearMonthDay weekStartYearMonthDay, final YearMonthDay weekEndYearMonthDay,
        final Collection<WrittenEvaluation> writtenEvaluations) {

    if (writtenEvaluations != null) {

        for (WrittenEvaluation writtenEvaluation : writtenEvaluations) {

            final YearMonthDay evaluationDate = writtenEvaluation.getDayDateYearMonthDay();

            if (!evaluationDate.isBefore(weekStartYearMonthDay)
                    && !evaluationDate.isAfter(weekEndYearMonthDay)) {

                if (writtenEvaluation instanceof Exam) {
                    final Exam exam = (Exam) writtenEvaluation;
                    infoShowOccupations.add(InfoExam.newInfoFromDomain(exam));

                } else if (writtenEvaluation instanceof WrittenTest) {
                    final WrittenTest writtenTest = (WrittenTest) writtenEvaluation;
                    infoShowOccupations.add(InfoWrittenTest.newInfoFromDomain(writtenTest));
                }/* w ww.j  ava2  s  .  c  o  m*/
            }
        }
    }
}

From source file:net.sourceforge.fenixedu.domain.accounting.events.AdministrativeOfficeFeeAndInsuranceEvent.java

License:Open Source License

private YearMonthDay calculatePaymentCodeEndDate() {
    final YearMonthDay today = new YearMonthDay();
    final YearMonthDay administrativeOfficeFeePaymentLimitDate = getAdministrativeOfficeFeePaymentLimitDate();
    return today.isBefore(administrativeOfficeFeePaymentLimitDate) ? administrativeOfficeFeePaymentLimitDate
            : calculateNextEndDate(today);
}

From source file:net.sourceforge.fenixedu.domain.accounting.events.gratuity.GratuityEventWithPaymentPlan.java

License:Open Source License

private YearMonthDay calculateInstallmentPaymentCodeEndDate(final Installment installment) {
    final YearMonthDay today = new YearMonthDay();
    final YearMonthDay installmentEndDate = new YearMonthDay(installment.getEndDate(this));
    return today.isBefore(installmentEndDate) ? installmentEndDate : calculateNextEndDate(today);
}

From source file:net.sourceforge.fenixedu.domain.accounting.events.gratuity.GratuityEventWithPaymentPlan.java

License:Open Source License

private YearMonthDay calculateFullPaymentCodeEndDate() {
    final YearMonthDay today = new YearMonthDay();
    final LocalDate endDate = getFirstInstallment().getEndDate(this);
    final YearMonthDay totalEndDate = new YearMonthDay(getFirstInstallment().getEndDate(this).getYear(),
            getFirstInstallment().getEndDate(this).getMonthOfYear(),
            getFirstInstallment().getEndDate(this).getDayOfMonth());
    return today.isBefore(totalEndDate) ? totalEndDate : calculateNextEndDate(today);
}

From source file:net.sourceforge.fenixedu.domain.elections.DelegateElection.java

License:Open Source License

public boolean hasCandidacyPeriodIntersecting(YearMonthDay startDate, YearMonthDay endDate) {
    if (!(startDate.isAfter(getCandidacyEndDate()) || startDate.isEqual(getCandidacyEndDate())
            || endDate.isBefore(getCandidacyStartDate()) || endDate.isEqual(getCandidacyStartDate()))) {
        return true;
    }// w  ww .  j  a va  2  s  . co  m
    return false;
}

From source file:net.sourceforge.fenixedu.domain.elections.DelegateElection.java

License:Open Source License

public boolean hasVotingPeriodIntersecting(YearMonthDay startDate, YearMonthDay endDate) {
    if (!(startDate.isAfter(getLastVotingEndDate()) || startDate.isEqual(getLastVotingEndDate())
            || endDate.isBefore(getLastVotingStartDate()) || endDate.isEqual(getLastVotingStartDate()))) {
        return true;
    }// w  ww . jav a2 s.c o  m
    return false;
}

From source file:net.sourceforge.fenixedu.domain.elections.DelegateElectionPeriod.java

License:Open Source License

@Override
public void setEndDate(YearMonthDay endDate) {
    if (getStartDate() != null && endDate.isBefore(getStartDate())) {
        throw new DomainException("error.elections.create.invalidEndDate");
    }/* ww w  .  j a v  a 2 s  . c o m*/

    super.setEndDate(endDate);
}

From source file:net.sourceforge.fenixedu.domain.elections.DelegateElectionPeriod.java

License:Open Source License

public boolean isCurrentPeriod() {
    YearMonthDay currentDate = new YearMonthDay();
    return (!currentDate.isBefore(getStartDate()) && !currentDate.isAfter(getEndDate()) ? true : false);
}

From source file:net.sourceforge.fenixedu.domain.elections.DelegateElectionPeriod.java

License:Open Source License

public boolean containsPeriod(YearMonthDay startDate, YearMonthDay endDate) {
    if (startDate == null || endDate == null) {
        return false;
    }//w  ww.ja v a  2 s.  c om
    if (((startDate.isAfter(getStartDate()) || startDate.isEqual(getStartDate()))
            && (endDate.isBefore(getEndDate()) || endDate.isEqual(getEndDate())))) {
        return true;
    }
    return false;

}