Package org.joda.time

Examples of org.joda.time.YearMonthDay


    private boolean isBetweenWarnPeriod(EnrolmentPeriod enrolmentPeriod) {
        if (enrolmentPeriod == null) {
            return false;
        }
        YearMonthDay startWarnPeriod =
                YearMonthDay.fromDateFields(enrolmentPeriod.getStartDate()).minusDays(NUMBER_OF_DAYS_BEFORE_PERIOD_TO_WARN);
        YearMonthDay endWarnPeriod =
                YearMonthDay.fromDateFields(enrolmentPeriod.getEndDate()).plusDays(NUMBER_OF_DAYS_AFTER_PERIOD_TO_WARN);
        Date now = new Date();
        if (startWarnPeriod.toDateTimeAtMidnight().toDate().before(now)
                && endWarnPeriod.toDateTimeAtMidnight().toDate().after(now)) {
            return true;
        } else {
            return false;
        }
    }
View Full Code Here


            qualification.setPerson(dfaCandidacy.getPerson());
            qualification.setMark(dfaCandidacy.getPrecedentDegreeInformation().getConclusionGrade());
            qualification.setSchool(dfaCandidacy.getPrecedentDegreeInformation().getInstitutionName());
            qualification.setDegree(dfaCandidacy.getPrecedentDegreeInformation().getDegreeDesignation());
            if (dfaCandidacy.getPrecedentDegreeInformation().getConclusionYear() != null) {
                qualification.setDateYearMonthDay(new YearMonthDay(dfaCandidacy.getPrecedentDegreeInformation()
                        .getConclusionYear(), 1, 1));
            }
            qualification.setCountry(dfaCandidacy.getPrecedentDegreeInformation().getCountry());
        }
    }
View Full Code Here

    protected void enrolStudentInCurricularCourses(final ExecutionDegree executionDegree, final Registration registration) {
        final ExecutionSemester executionSemester = getExecutionPeriod();
        final StudentCurricularPlan studentCurricularPlan =
                StudentCurricularPlan.createBolonhaStudentCurricularPlan(registration, executionDegree.getDegreeCurricularPlan(),
                        new YearMonthDay(), executionSemester);

        studentCurricularPlan.createFirstTimeStudentEnrolmentsFor(executionSemester, getCurrentUsername());
    }
View Full Code Here

        MobilityIndividualApplication candidacy = process.getCandidacy();
        Boolean restrictEnrollment;
        ErasmusBolonhaStudentEnrollmentBean bean;
        if (candidacy.getRegistration().getActiveStudentCurricularPlan() != null) {
            restrictEnrollment = true;
            ExecutionSemester semester = ExecutionSemester.readByYearMonthDay(new YearMonthDay());
            bean =
                    new ErasmusBolonhaStudentEnrollmentBean(candidacy.getRegistration().getActiveStudentCurricularPlan(),
                            semester, null, CurricularRuleLevel.ENROLMENT_NO_RULES, candidacy);
        } else {
            restrictEnrollment = false;
View Full Code Here

    public ActionForward preparePayResidenceEvent(ActionMapping mapping, ActionForm actionForm, HttpServletRequest request,
            HttpServletResponse response) throws FenixServiceException {

        ResidenceEvent residenceEvent = FenixFramework.getDomainObject(request.getParameter("event"));
        VariantBean bean = new VariantBean();
        bean.setYearMonthDay(new YearMonthDay());
        ResidenceMonth month = getResidenceMonth(request);

        request.setAttribute("month", month);
        request.setAttribute("residenceEvent", residenceEvent);
        request.setAttribute("bean", bean);
View Full Code Here

    public ActionForward payResidenceEvent(ActionMapping mapping, ActionForm actionForm, HttpServletRequest request,
            HttpServletResponse response) throws FenixServiceException {

        ResidenceEvent residenceEvent = (ResidenceEvent) FenixFramework.getDomainObject(request.getParameter("event"));
        YearMonthDay date = getRenderedObject("date");

        try {
            PayResidenceEvent.run(getLoggedPerson(request).getUser(), residenceEvent, date);
        } catch (DomainException e) {
            addErrorMessage(request, e.getMessage(), e.getMessage());
View Full Code Here

    @Override
    protected List<AccountingEventPaymentCode> createPaymentCodes() {
        final EntryDTO entryDTO = calculateEntries(new DateTime()).iterator().next();

        return Collections.singletonList(AccountingEventPaymentCode.create(PaymentCodeType.RESIDENCE_FEE, new YearMonthDay(),
                getPaymentLimitDate().toYearMonthDay(), this, entryDTO.getAmountToPay(), entryDTO.getAmountToPay(), getPerson()));
    }
View Full Code Here

    protected List<AccountingEventPaymentCode> updatePaymentCodes() {
        final EntryDTO entryDTO = calculateEntries(new DateTime()).iterator().next();
        getNonProcessedPaymentCodes()
                .iterator()
                .next()
                .update(new YearMonthDay(), getPaymentLimitDate().toYearMonthDay(), entryDTO.getAmountToPay(),
                        entryDTO.getAmountToPay());

        return getNonProcessedPaymentCodes();
    }
View Full Code Here

    public void refreshPeriodAndInstancesInSummaryCreation(YearMonthDay newBeginDate) {
        if (!wasFinished() && newBeginDate != null && newBeginDate.isAfter(getPeriod().getStartYearMonthDay())) {
            SortedSet<YearMonthDay> instanceDates =
                    getAllLessonInstancesDatesToCreate(getLessonStartDay(), newBeginDate.minusDays(1), true);
            YearMonthDay newEndDate = getPeriod().getLastOccupationPeriodOfNestedPeriods().getEndYearMonthDay();
            if (!newBeginDate.isAfter(newEndDate)) {
                refreshPeriod(newBeginDate, getPeriod().getLastOccupationPeriodOfNestedPeriods().getEndYearMonthDay());
            } else {
                OccupationPeriod period = getPeriod();
                removeLessonSpaceOccupationAndPeriod();
View Full Code Here

        return getSummaries(Summary.COMPARATOR_BY_DATE_AND_HOUR);
    }

    public boolean isTimeValidToInsertSummary(HourMinuteSecond timeToInsert, YearMonthDay summaryDate) {

        YearMonthDay currentDate = new YearMonthDay();
        if (timeToInsert == null || summaryDate == null || summaryDate.isAfter(currentDate)) {
            return false;
        }

        if (currentDate.isEqual(summaryDate)) {
            HourMinuteSecond lessonEndTime = null;
            LessonInstance lessonInstance = getLessonInstanceFor(summaryDate);
            lessonEndTime = lessonInstance != null ? lessonInstance.getEndTime() : getEndHourMinuteSecond();
            return !lessonEndTime.isAfter(timeToInsert);
        }
View Full Code Here

TOP

Related Classes of org.joda.time.YearMonthDay

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.