Example usage for org.joda.time YearMonthDay toDateMidnight

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

Introduction

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

Prototype

public DateMidnight toDateMidnight() 

Source Link

Document

Converts this object to a DateMidnight in the default time zone.

Usage

From source file:com.moss.joda.swing.PopupCalendar.java

License:Open Source License

public void setDate(YearMonthDay date) {
    if (date == null) {
        view.setSelectedDate(null);// w ww.j  a  v  a 2s. c o  m
    } else {
        view.setSelectedDate(date.toDateMidnight().toDate());
        view.setFirstDisplayedDay(date.toDateMidnight().toDate());
    }
    value = date;
}

From source file:net.sourceforge.fenixedu.dataTransferObject.InfoLessonInstanceAggregation.java

License:Open Source License

public InfoLessonInstanceAggregation(final Shift shift, final Lesson lesson, final YearMonthDay yearMonthDay) {
    this.shift = shift;
    this.weekDay = yearMonthDay.toDateMidnight().getDayOfWeek();
    this.begin = lesson.getBeginHourMinuteSecond();
    this.end = lesson.getEndHourMinuteSecond();
    this.allocatableSpace = lesson.getSala();
}

From source file:net.sourceforge.fenixedu.dataTransferObject.InfoLessonInstanceAggregation.java

License:Open Source License

private static String key(final Lesson lesson, final YearMonthDay yearMonthDay) {
    final StringBuilder key = new StringBuilder();
    key.append(yearMonthDay.toDateMidnight().getDayOfWeek());
    key.append('_');
    key.append(lesson.getBeginHourMinuteSecond().toString("HH:mm"));
    key.append('_');
    key.append(lesson.getEndHourMinuteSecond().toString("HH:mm"));
    key.append('_');
    key.append(lesson.getSala() == null ? "" : lesson.getSala().getExternalId());
    return key.toString();
}

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

License:Open Source License

public List<Teacher> getAllTeachers(YearMonthDay begin, YearMonthDay end) {
    Unit departmentUnit = getDepartmentUnit();
    List<Teacher> list = (departmentUnit != null) ? departmentUnit.getAllTeachers(begin, end)
            : new ArrayList<Teacher>(0);
    for (ExternalTeacherAuthorization teacherAuthorization : this.getTeacherAuthorizationsAuthorizedSet()) {
        if (teacherAuthorization.getActive()
                && teacherAuthorization.getExecutionSemester().getAcademicInterval()
                        .overlaps(new Interval(begin.toDateMidnight(), end.toDateMidnight()))
                && !list.contains(teacherAuthorization.getTeacher())) {
            list.add(teacherAuthorization.getTeacher());
        }/*from  w ww .j  a v  a2  s.  c  om*/
    }
    return list;
}

From source file:net.sourceforge.fenixedu.util.date.IntervalTools.java

License:Open Source License

@Deprecated
public static Interval getInterval(YearMonthDay startDate, YearMonthDay endDate) {
    long start = startDate == null ? Long.MIN_VALUE : startDate.toDateMidnight().getMillis();
    long end = endDate == null ? Long.MAX_VALUE
            : endDate.toDateMidnight().toDateTime().withTime(23, 59, 59, 999).getMillis();

    return new Interval(start, end);
}

From source file:net.sourceforge.fenixedu.util.date.IntervalTools.java

License:Open Source License

@Deprecated
public static Interval intervalWithStart(Interval originalInterval, YearMonthDay day) {
    long millis = day.toDateMidnight().getMillis();
    return new Interval(millis, originalInterval.getEndMillis());
}

From source file:net.sourceforge.fenixedu.util.date.IntervalTools.java

License:Open Source License

@Deprecated
public static Interval intervalWithEnd(Interval originalInterval, YearMonthDay day) {
    long millis = day.toDateMidnight().toDateTime().withTime(23, 59, 59, 999).getMillis();
    return new Interval(originalInterval.getStartMillis(), millis);
}

From source file:org.fenixedu.academic.domain.candidacyProcess.IndividualCandidacy.java

License:Open Source License

protected YearMonthDay getStartDate() {
    final ExecutionInterval interval = getCandidacyExecutionInterval();
    final YearMonthDay today = new YearMonthDay();
    return interval.isCurrent() && interval.getAcademicInterval().contains(today.toDateMidnight()) ? today
            : interval.getBeginDateYearMonthDay();
}

From source file:org.fenixedu.academic.domain.candidacyProcess.standalone.StandaloneIndividualCandidacy.java

License:Open Source License

@Override
protected YearMonthDay getStartDate() {
    final ExecutionInterval interval = getCandidacyExecutionInterval().getExecutionYear();
    final YearMonthDay today = new YearMonthDay();
    return interval.isCurrent() && interval.getAcademicInterval().contains(today.toDateMidnight()) ? today
            : interval.getBeginDateYearMonthDay();
}

From source file:org.fenixedu.ulisboa.specifications.ui.firstTimeCandidacy.PersonalInformationFormController.java

License:Open Source License

protected PersonalInformationForm createPersonalInformationForm(final ExecutionYear executionYear,
        final Student student) {
    final Person person = student.getPerson();
    PersonalInformationForm form;//from w w w . j a v  a 2  s.c  om
    form = new PersonalInformationForm();

    form.setDocumentIdEmissionLocation(person.getEmissionLocationOfDocumentId());
    YearMonthDay emissionDateOfDocumentIdYearMonthDay = person.getEmissionDateOfDocumentIdYearMonthDay();
    YearMonthDay expirationDateOfDocumentIdYearMonthDay = person.getExpirationDateOfDocumentIdYearMonthDay();
    form.setDocumentIdEmissionDate(emissionDateOfDocumentIdYearMonthDay != null
            ? new LocalDate(person.getEmissionDateOfDocumentIdYearMonthDay().toDateMidnight())
            : null);
    form.setDocumentIdExpirationDate(expirationDateOfDocumentIdYearMonthDay != null
            ? new LocalDate(expirationDateOfDocumentIdYearMonthDay.toDateMidnight())
            : null);

    form.setSocialSecurityNumber(person.getSocialSecurityNumber());

    form.setDocumentIdNumber(person.getDocumentIdNumber());
    form.setIdDocumentType(person.getIdDocumentType());

    final String digitControl = IdentityCardUtils.getDigitControlFromPerson(person);
    if (!Strings.isNullOrEmpty(digitControl)) {
        form.setIdentificationDocumentSeriesNumber(digitControl);
    }

    PersonUlisboaSpecifications personUl = person.getPersonUlisboaSpecifications();
    if (personUl != null) {

        Unit institution = personUl.getFirstOptionInstitution();
        if (institution != null) {
            form.setFirstOptionInstitution(institution);

            String degreeDesignationName = personUl.getFirstOptionDegreeDesignation();
            Predicate<DegreeDesignation> matchesName = dd -> dd.getDescription()
                    .equalsIgnoreCase(degreeDesignationName);
            DegreeDesignation degreeDesignation = institution.getDegreeDesignationSet().stream()
                    .filter(matchesName).findFirst().orElse(null);
            form.setFirstOptionDegreeDesignation(degreeDesignation);
        }
    }

    form.setCountryHighSchool(person.getCountryHighSchool());

    form.setGender(student.getPerson().getGender());

    fillstaticformdata(executionYear, student, form);

    return form;
}