Package org.joda.time

Examples of org.joda.time.Partial


                DateTimeFieldType.hourOfDay(),
        };
        int[] values = new int[] {2005, 12};
        List types = new ArrayList(Arrays.asList(fields));
        DateTimeFormatter f = ISODateTimeFormat.forFields(types, true, false);
        assertEquals("2005T12", f.print(new Partial(fields, values)));
        assertEquals(0, types.size());
       
        types = new ArrayList(Arrays.asList(fields));
        f = ISODateTimeFormat.forFields(types, false, false);
        assertEquals("2005T12", f.print(new Partial(fields, values)));
        assertEquals(0, types.size());
       
        types = new ArrayList(Arrays.asList(fields));
        try {
            ISODateTimeFormat.forFields(types, true, true);
View Full Code Here


                DateTimeFieldType.minuteOfHour(),
        };
        int[] values = new int[] {25, 20};
        List types = new ArrayList(Arrays.asList(fields));
        DateTimeFormatter f = ISODateTimeFormat.forFields(types, true, false);
        assertEquals("---25T-20", f.print(new Partial(fields, values)));
        assertEquals(0, types.size());
       
        types = new ArrayList(Arrays.asList(fields));
        f = ISODateTimeFormat.forFields(types, false, false);
        assertEquals("---25T-20", f.print(new Partial(fields, values)));
        assertEquals(0, types.size());
       
        types = new ArrayList(Arrays.asList(fields));
        try {
            ISODateTimeFormat.forFields(types, true, true);
View Full Code Here

      }
    }

    @Override
    public SUTime.Time resolve(SUTime.Time t, int flags) {
      Partial p = (t != null)? t.getJodaTimePartial():null;
      if (p != null) {
        if (JodaTimeUtils.hasField(p, DateTimeFieldType.year())) {
          int year = p.get(DateTimeFieldType.year());
          // TODO: If we knew location of article, can use that information to resolve holidays better
          Set<de.jollyday.Holiday> holidays = holidayManager.getHolidays(year);
          // Try to find this holiday
          for (de.jollyday.Holiday h:holidays) {
            if (h.getPropertiesKey().equals(base.getDescriptionPropertiesKey())) {
              return new SUTime.PartialTime(this, new Partial(h.getDate()));
            }
          }
        }
      }
      return this;
View Full Code Here

        assertEquals(end, start.plusMinutes(22 * 60));
        assertEquals(start, end.minusMinutes(22 * 60));
    }

    public void testPartialDayOfYearAdd() {
        Partial start = new Partial().with(DateTimeFieldType.year(), 2000).with(DateTimeFieldType.dayOfYear(), 366);
        Partial end = new Partial().with(DateTimeFieldType.year(), 2004).with(DateTimeFieldType.dayOfYear(), 366);
        assertEquals(end, start.withFieldAdded(DurationFieldType.days(), 365 + 365 + 365 + 366));
        assertEquals(start, end.withFieldAdded(DurationFieldType.days(), -(365 + 365 + 365 + 366)));
    }
View Full Code Here

public class AcademicCalendarsManagementDA extends FenixDispatchAction {
    public ActionForward prepareCreateAcademicCalendar(ActionMapping mapping, ActionForm actionForm, HttpServletRequest request,
            HttpServletResponse response) throws Exception {

        ExecutionYear currentExecutionYear = ExecutionYear.readCurrentExecutionYear();
        Partial begin;
        Partial end;
        if (currentExecutionYear != null) {
            begin = CalendarEntryBean.getPartialFromYearMonthDay(currentExecutionYear.getBeginDateYearMonthDay());
            end = CalendarEntryBean.getPartialFromYearMonthDay(currentExecutionYear.getEndDateYearMonthDay());
        } else {
            begin = CalendarEntryBean.getPartialFromYearMonthDay(new YearMonthDay());
View Full Code Here

            HttpServletResponse response) throws Exception {

        AcademicCalendarEntry academicCalendar = getAcademicCalendarEntryFromParameter(request);
        ExecutionYear currentExecutionYear = ExecutionYear.readCurrentExecutionYear();

        Partial begin = CalendarEntryBean.getPartialFromYearMonthDay(currentExecutionYear.getBeginDateYearMonthDay());
        Partial end = CalendarEntryBean.getPartialFromYearMonthDay(currentExecutionYear.getEndDateYearMonthDay());

        CalendarEntryBean bean =
                CalendarEntryBean.createCalendarEntryBeanToCreateEntry((AcademicCalendarRootEntry) academicCalendar,
                        academicCalendar, begin, end);
View Full Code Here

        YearMonthDay endDate = bean.getEndDateToDisplayInYearMonthDayFormat();

        if (beginDate.isAfter(endDate)) {
            addActionMessage(request, "error.begin.after.end");
            ExecutionYear currentExecutionYear = ExecutionYear.readCurrentExecutionYear();
            Partial begin = CalendarEntryBean.getPartialFromYearMonthDay(currentExecutionYear.getBeginDateYearMonthDay());
            Partial end = CalendarEntryBean.getPartialFromYearMonthDay(currentExecutionYear.getEndDateYearMonthDay());
            bean = CalendarEntryBean.createCalendarEntryBeanToCreateEntry(bean.getRootEntry(), bean.getRootEntry(), begin, end);
            RenderUtils.invalidateViewState("datesToDisplayID");
            return generateGanttDiagram(mapping, request, bean);
        }
View Full Code Here

            HttpServletResponse response) throws Exception {

        AcademicCalendarEntry entry = getAcademicCalendarEntryFromParameter(request);
        AcademicCalendarRootEntry rootEntry = getAcademicCalendarRootEntryFromParameter(request);

        Partial beginPartial = getBeginFromParameter(request);
        Partial endPartial = getEndFromParameter(request);

        CalendarEntryBean bean =
                CalendarEntryBean.createCalendarEntryBeanToCreateEntry(rootEntry, entry, beginPartial, endPartial);

        return generateGanttDiagram(mapping, request, bean);
View Full Code Here

            HttpServletResponse response) throws Exception {

        AcademicCalendarEntry parentEntry = getAcademicCalendarEntryFromParameter(request);
        AcademicCalendarRootEntry rootEntry = getAcademicCalendarRootEntryFromParameter(request);

        Partial beginPartial = getBeginFromParameter(request);
        Partial endPartial = getEndFromParameter(request);

        request.setAttribute("parentEntryBean",
                CalendarEntryBean.createCalendarEntryBeanToCreateEntry(rootEntry, parentEntry, beginPartial, endPartial));

        return mapping.findForward("prepareCreateCalendarEntry");
View Full Code Here

            HttpServletResponse response) throws Exception {

        AcademicCalendarEntry entry = getAcademicCalendarEntryFromParameter(request);
        AcademicCalendarRootEntry rootEntry = getAcademicCalendarRootEntryFromParameter(request);

        Partial beginPartial = getBeginFromParameter(request);
        Partial endPartial = getEndFromParameter(request);

        request.setAttribute("entryBean",
                CalendarEntryBean.createCalendarEntryBeanToEditEntry(rootEntry, entry, beginPartial, endPartial));

        return mapping.findForward("prepareCreateCalendarEntry");
View Full Code Here

TOP

Related Classes of org.joda.time.Partial

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.