Example usage for org.joda.time Partial isAfter

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

Introduction

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

Prototype

public boolean isAfter(ReadablePartial partial) 

Source Link

Document

Is this partial later than the specified partial.

Usage

From source file:net.sourceforge.fenixedu.domain.Qualification.java

License:Open Source License

private void checkAttendedPartials(Partial attendedBegin, Partial attendedEnd) {
    if (attendedBegin != null && attendedEnd != null && attendedBegin.isAfter(attendedEnd)) {
        throw new DomainException("error.Qualification.invalid.attended.dates");
    }/*from   w w  w. j  av a 2 s. c o m*/
}

From source file:org.opencastproject.scheduler.impl.persistence.SchedulerServiceDatabaseImpl.java

License:Educational Community License

/**
 * Add the correct start and end value for the given quarter count query
 * <p/>//w  w w .ja  v a  2s .co  m
 * Please note that the start instant is inclusive while the end instant is exclusive.
 *
 * @param query
 *          The query where the parameters have to be added
 * @return the same query instance
 */
private Query setDateForQuarterQuery(Query query) {
    final DateTime today = new DateTime().withTimeAtStartOfDay();
    final Partial partialToday = partialize(today);
    final DateTime quarterBeginning = mlist(quarterBeginnings)
            .foldl(quarterBeginnings.get(0), new Function2<Partial, Partial, Partial>() {
                @Override
                public Partial apply(Partial sum, Partial quarterBeginning) {
                    return partialToday.isAfter(quarterBeginning) ? quarterBeginning : sum;
                }
            }).toDateTime(today);
    return query.setParameter("start", quarterBeginning.toDate()).setParameter("end",
            quarterBeginning.plusMonths(3).toDate());
}