Package org.joda.time

Examples of org.joda.time.Partial$Property


    }

    public static Partial getPartialFromString(String date) {
        Integer month = Integer.valueOf(date.substring(0, 2));
        Integer year = Integer.valueOf(date.substring(2));
        return new Partial(new DateTimeFieldType[] { DateTimeFieldType.year(), DateTimeFieldType.monthOfYear() }, new int[] {
                year.intValue(), month.intValue() });
    }
View Full Code Here


        return new Partial(new DateTimeFieldType[] { DateTimeFieldType.year(), DateTimeFieldType.monthOfYear() }, new int[] {
                year.intValue(), month.intValue() });
    }

    public static Partial getPartialFromYearMonthDay(YearMonthDay day) {
        return new Partial(new DateTimeFieldType[] { DateTimeFieldType.year(), DateTimeFieldType.monthOfYear() }, new int[] {
                day.getYear(), day.getMonthOfYear() });
    }
View Full Code Here

    public ViewEventSpaceOccupationsBean(YearMonthDay day, Space allocatableSpace) {

        setAllocatableSpace(allocatableSpace);

        if (day != null) {
            setYear(new Partial(DateTimeFieldType.year(), day.getYear()));
            setMonth(new Partial(DateTimeFieldType.monthOfYear(), day.getMonthOfYear()));

            YearMonthDay monday = day.toDateTimeAtMidnight().withDayOfWeek(MONDAY_IN_JODA_TIME).toYearMonthDay();
            if ((monday.getMonthOfYear() < day.getMonthOfYear()) || (monday.getYear() < day.getYear())) {
                monday = monday.plusDays(Lesson.NUMBER_OF_DAYS_IN_WEEK);
            }
View Full Code Here

        if (firstExecutionYear != null) {
            ExecutionYear currentExecutionYear = ExecutionYear.readCurrentExecutionYear();
            int firstYear = firstExecutionYear.getBeginDateYearMonthDay().getYear();
            int lastYear = currentExecutionYear.getEndDateYearMonthDay().getYear();
            while (firstYear <= lastYear) {
                result.add(new Partial(DateTimeFieldType.year(), firstYear));
                firstYear++;
            }
        }

        return result;
View Full Code Here

            setMonth(Month.values()[getNumberOfMonth() - 2]);
        }
    }

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

        super.setActivityInterval(interval);
    }

    public Partial getStart() {
        DateTime start = getActivityInterval().getStart();
        return new Partial().with(DateTimeFieldType.year(), start.getYear()).with(DateTimeFieldType.monthOfYear(),
                start.getMonthOfYear());
    }
View Full Code Here

        setActivityInterval(new Interval(start.toDateTime(new DateTime(0)), getActivityInterval().getEnd()));
    }

    public Partial getEnd() {
        DateTime end = getActivityInterval().getEnd();
        return new Partial().with(DateTimeFieldType.year(), end.getYear()).with(DateTimeFieldType.monthOfYear(),
                end.getMonthOfYear());
    }
View Full Code Here

  @Override
  protected Partial getValue(Line line) {
    DateTime time = (DateTime) line.getValue(WideFinderConstants.DATE);

    Partial range = JodaUtil.buildPartial(time, types);

    return range;
  }
View Full Code Here

    for (int i = 0; i < types.length; i++) {
      values[i] = time.get(types[i]);
    }

    Partial range = new Partial(types, values);
    return range;
  }
View Full Code Here

    validator = new FutureValidatorForReadablePartial();
  }

  @Test
  public void testIsValidForPartial() {
    Partial future = new Partial( new LocalDate().plusYears( 1 ) );
    Partial past = new Partial( new LocalDate().minusYears( 1 ) );

    Assert.assertTrue( validator.isValid( null, null ) );
    Assert.assertTrue( validator.isValid( future, null ) );
    Assert.assertFalse( validator.isValid( past, null ) );
  }
View Full Code Here

TOP

Related Classes of org.joda.time.Partial$Property

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.