Package org.fenixedu.academic.util

Examples of org.fenixedu.academic.util.HourMinuteSecond


        } else {
            summaryType = SummaryType.NORMAL_SUMMARY;
        }

        DateTimeFieldType[] dateTimeFieldTypes = { DateTimeFieldType.hourOfDay(), DateTimeFieldType.minuteOfHour() };
        HourMinuteSecond time = summary.getSummaryHourHourMinuteSecond();
        int[] timeArray = { time.getHour(), time.getMinuteOfHour() };
        Partial timePartial = new Partial(dateTimeFieldTypes, timeArray);

        SummariesManagementBean bean =
                new SummariesManagementBean(summary.getTitle(), summary.getSummaryText(), summary.getStudentsNumber(),
                        summaryType, summary.getProfessorship(), summary.getTeacherName(), summary.getTeacher(),
View Full Code Here


            if (insert) {
                for (YearMonthDay lessonDate : lesson.getAllLessonDates()) {
                    if ((calendarViewType.equals(LessonCalendarViewType.ALL_LESSONS))
                            || (calendarViewType.equals(LessonCalendarViewType.PAST_LESSON) && lesson.isTimeValidToInsertSummary(
                                    new HourMinuteSecond(), lessonDate))
                            || (calendarViewType.equals(LessonCalendarViewType.PAST_LESSON_WITHOUT_SUMMARY) && lesson
                                    .getSummaryByDate(lessonDate) == null)
                            && lesson.isTimeValidToInsertSummary(new HourMinuteSecond(), lessonDate)) {

                        summariesCalendar.add(new NextPossibleSummaryLessonsAndDatesBean(lesson, lessonDate));
                    }
                }
            }
View Full Code Here

        return search(mapping, request, localDate, begin, end, dynaActionForm);
    }

    public static boolean isEvalBetweenDates(final WrittenEvaluation eval, final LocalTime begin, final LocalTime end) {
        final HourMinuteSecond bhms = eval.getBeginningDateHourMinuteSecond();
        final HourMinuteSecond ehms = eval.getEndDateHourMinuteSecond();
        return bhms.toLocalTime().isBefore(end) && ehms.toLocalTime().isAfter(begin);
    }
View Full Code Here

        return getFrequency() != null && getDiaSemana() != null;
    }

    @jvstm.cps.ConsistencyPredicate
    protected boolean checkTimeInterval() {
        final HourMinuteSecond start = getBeginHourMinuteSecond();
        final HourMinuteSecond end = getEndHourMinuteSecond();
        return start != null && end != null && start.isBefore(end);
    }
View Full Code Here

        return String.valueOf(getFim().get(Calendar.HOUR_OF_DAY));
    }

    public double hoursAfter(int hour) {

        HourMinuteSecond afterHour = new HourMinuteSecond(hour, 0, 0);

        if (!getBeginHourMinuteSecond().isBefore(afterHour)) {
            return getUnitHours().doubleValue();

        } else if (getEndHourMinuteSecond().isAfter(afterHour)) {
View Full Code Here

        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);
        }

        return true;
    }
View Full Code Here

    }

    public YearMonthDay getNextPossibleSummaryDate() {

        YearMonthDay currentDate = new YearMonthDay();
        HourMinuteSecond now = new HourMinuteSecond();
        Summary lastSummary = getLastSummary();

        if (lastSummary != null) {

            SortedSet<YearMonthDay> datesEvenToday = getAllLessonDatesUntil(currentDate);
View Full Code Here

        return null;
    }

    public SortedSet<YearMonthDay> getAllPossibleDatesToInsertSummary() {

        HourMinuteSecond now = new HourMinuteSecond();
        YearMonthDay currentDate = new YearMonthDay();
        SortedSet<YearMonthDay> datesToInsert = getAllLessonDatesUntil(currentDate);

        for (Summary summary : getAssociatedSummaries()) {
            YearMonthDay summaryDate = summary.getSummaryDateYearMonthDay();
View Full Code Here

        });
        if (!wasFinished()) {
            YearMonthDay startDateToSearch = getLessonStartDay();
            YearMonthDay endDateToSearch = getLessonEndDay();
            final HourMinuteSecond b = getBeginHourMinuteSecond();
            final HourMinuteSecond e = getEndHourMinuteSecond();
            for (final YearMonthDay yearMonthDay : getAllValidLessonDatesWithoutInstancesDates(startDateToSearch, endDateToSearch)) {
                final DateTime start =
                        new DateTime(yearMonthDay.getYear(), yearMonthDay.getMonthOfYear(), yearMonthDay.getDayOfMonth(),
                                b.getHour(), b.getMinuteOfHour(), b.getSecondOfMinute(), 0);
                final DateTime end =
                        new DateTime(yearMonthDay.getYear(), yearMonthDay.getMonthOfYear(), yearMonthDay.getDayOfMonth(),
                                e.getHour(), e.getMinuteOfHour(), e.getSecondOfMinute(), 0);
                dates.add(new Interval(start, end));
            }
        }
        return dates;
    }
View Full Code Here

        }
        final DateTime intervalEnd = interval.getEnd();
        if (intervalEnd.isBefore(startDateToSearch.toDateTimeAtMidnight())) {
            return false;
        }
        final HourMinuteSecond b = getBeginHourMinuteSecond();
        final HourMinuteSecond e = getEndHourMinuteSecond();
        for (final YearMonthDay yearMonthDay : getAllValidLessonDatesWithoutInstancesDates(startDateToSearch, endDateToSearch)) {
            final DateTime start =
                    new DateTime(yearMonthDay.getYear(), yearMonthDay.getMonthOfYear(), yearMonthDay.getDayOfMonth(),
                            b.getHour(), b.getMinuteOfHour(), b.getSecondOfMinute(), 0);
            if (start.isAfter(intervalEnd)) {
                continue;
            }
            final DateTime end =
                    new DateTime(yearMonthDay.getYear(), yearMonthDay.getMonthOfYear(), yearMonthDay.getDayOfMonth(),
                            e.getHour(), e.getMinuteOfHour(), e.getSecondOfMinute(), 0);
            if (end.isBefore(intervalStart)) {
                continue;
            }
            return true;
        }
View Full Code Here

TOP

Related Classes of org.fenixedu.academic.util.HourMinuteSecond

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.