Example usage for org.joda.time Partial Partial

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

Introduction

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

Prototype

public Partial() 

Source Link

Document

Constructs a Partial with no fields or values, which can be considered to represent any date.

Usage

From source file:net.sourceforge.fenixedu.dataTransferObject.phd.YearMonth.java

License:Open Source License

public Partial getPartial() {
    return new Partial().with(DateTimeFieldType.monthOfYear(), getNumberOfMonth())
            .with(DateTimeFieldType.year(), getYear());
}

From source file:net.sourceforge.fenixedu.domain.phd.debts.PhdGratuityPaymentPeriod.java

License:Open Source License

public PhdGratuityPaymentPeriod(int dayStart, int monthStart, int dayEnd, int monthEnd, int dayLastPayment,
        int monthLastPayment) {
    super();/*from  w  w w .ja va 2  s.  c  o m*/
    init(new Partial().with(DateTimeFieldType.monthOfYear(), monthStart).with(DateTimeFieldType.dayOfYear(),
            dayStart),
            new Partial().with(DateTimeFieldType.monthOfYear(), monthEnd).with(DateTimeFieldType.dayOfYear(),
                    dayEnd),
            new Partial().with(DateTimeFieldType.monthOfYear(), monthLastPayment)
                    .with(DateTimeFieldType.dayOfYear(), dayLastPayment));
}

From source file:net.sourceforge.fenixedu.domain.student.curriculum.ExtraCurricularActivity.java

License:Open Source License

public Partial getStart() {
    DateTime start = getActivityInterval().getStart();
    return new Partial().with(DateTimeFieldType.year(), start.getYear()).with(DateTimeFieldType.monthOfYear(),
            start.getMonthOfYear());//ww w  .j  ava2 s  .  c o m
}

From source file:net.sourceforge.fenixedu.domain.student.curriculum.ExtraCurricularActivity.java

License:Open Source License

public Partial getEnd() {
    DateTime end = getActivityInterval().getEnd();
    return new Partial().with(DateTimeFieldType.year(), end.getYear()).with(DateTimeFieldType.monthOfYear(),
            end.getMonthOfYear());// w  w w  .  j  a  va 2 s  .  co m
}

From source file:pt.ist.fenixedu.integration.api.FenixAPIv1.java

License:Open Source License

private SummariesManagementBean fillSummaryManagementBean(ExecutionCourse executionCourse, Shift shift,
        Space space, String date, JsonObject title, JsonObject content, Boolean taught, int attendance) {

    MultiLanguageString titleMLS, contentMLS;
    try {//w w  w  . ja  v a 2  s .com
        titleMLS = MultiLanguageString.fromLocalizedString(LocalizedString.fromJson(title));
        contentMLS = MultiLanguageString.fromLocalizedString(LocalizedString.fromJson(content));
    } catch (Exception e) {
        throw newApplicationError(Status.PRECONDITION_FAILED, "invalid parameters",
                "'title' or 'content' is not a valid multi-language string");
    }

    DateTime lessonDateTime = DateTimeFormat.forPattern(dayHourSecondPattern).parseDateTime(date);
    YearMonthDay lessonDate = lessonDateTime.toYearMonthDay();
    Partial lessonTime = new Partial().with(DateTimeFieldType.hourOfDay(), lessonDateTime.getHourOfDay())
            .with(DateTimeFieldType.minuteOfHour(), lessonDateTime.getMinuteOfHour())
            .with(DateTimeFieldType.secondOfDay(), lessonDateTime.getSecondOfMinute());

    Optional<Lesson> lesson = shift.getAssociatedLessonsSet().stream()
            .filter(l -> l.getAllLessonDates().stream().anyMatch(lessonDate::equals))
            .filter(l -> l.getSala().equals(space)).findFirst();

    if (!lesson.isPresent()) {
        throw newApplicationError(Status.PRECONDITION_FAILED, "invalid parameters",
                "invalid lesson date or room");
    }

    Person person = getPerson();
    Professorship professorship = executionCourse.getProfessorship(person);
    String teacherName = person.getName();
    LessonInstance lessonInstance = lesson.get().getLessonInstanceFor(lessonDate);
    Summary summary = lessonInstance != null ? lessonInstance.getSummary() : null;
    ShiftType shiftType = shift.getSortedTypes().first();

    return new SummariesManagementBean(titleMLS, contentMLS, attendance, NORMAL_SUMMARY, professorship,
            teacherName, null, shift, lesson.get(), lessonDate, space, lessonTime, summary, professorship,
            shiftType, taught);
}

From source file:siia.booking.domain.flight.FlightSchedule.java

License:Apache License

public FlightSchedule(DateTime validFromInclusive, DateTime validUntilExclusive, int flightHourOfDay,
        int flightMinuteOfHour) {
    this.validFromInclusive = validFromInclusive;
    this.validUntilInclusive = validUntilExclusive;
    flightTimeOfDay = new Partial().with(DateTimeFieldType.hourOfDay(), 12)
            .with(DateTimeFieldType.minuteOfHour(), 30);

}

From source file:TVShowTimelineMaker.ui.ConstraintEditors.PartialTimeConstraintEditor.java

public PartialTimeConstraintEditor() {
    this(new PartialTimeConstraint(Main.myShow.getTimeLine().anyEventOfType(DayEvent.class), new Partial()));
}

From source file:TVShowTimelineMaker.ui.Joda.PartialEditor.java

public PartialEditor() {
    this(new Partial());
}