@Test public void testDayPeriodStartEndCode() throws ParseException { Period day = PeriodFactory.createDayPeriod(System.currentTimeMillis()); SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd"); long start = sdf.parse(String.valueOf(day.getStartCode())).getTime(); long end = sdf.parse(String.valueOf(day.getEndCode())).getTime(); assertTrue("Start code must be less than end code", start < end); }
public static Period createDayPeriod(long timestamp) { MutableDateTime mdt = new MutableDateTime(timestamp); return createPeriod(toDayStart(mdt).getMillis(), toDayEnd(mdt).getMillis()); }
PeriodFactory { public static Period createDayPeriod(long timestamp) { MutableDateTime mdt = new MutableDateTime(timestamp); return createPeriod(toDayStart(mdt).getMillis(), toDayEnd(mdt).getMillis()); } }
PeriodFactory { public static Period createDayPeriod(long timestamp) { MutableDateTime mdt = new MutableDateTime(timestamp); return createPeriod(toDayStart(mdt).getMillis(), toDayEnd(mdt).getMillis()); } PeriodFactory(); }
PeriodFactory { public static Period createDayPeriod(long timestamp) { MutableDateTime mdt = new MutableDateTime(timestamp); return createPeriod(toDayStart(mdt).getMillis(), toDayEnd(mdt).getMillis()); } PeriodFactory(); static Period createPeriod(long start, long end); static Period createPeriod(String start, String end); static Period createDayPeriod(long timestamp); static Period createDayPeriod(String date); static Period createHourPeriod(long timestamp); static Period createHourPeriod(String date); static Period createSinceHoursPeriod(int numberOfHours); static Period createSinceDaysPeriod(int numberOfDays); static Period createSinceWeeksPeriod(int numberOfWeeks); static Period createSinceMonthsPeriod(int numberOfMonths); static Period createSinceYearsPeriod(int numberOfYears); static Period getCurrentDay(); static Period createWeekPeriod(long timestamp); static Period createWeekPeriod(String date); static Period getCurrentWeek(); static Period createMonthPeriod(long timestamp); static Period createMonthPeriod(String date); static Period getCurrentMonth(); static Period createYearPeriod(long timestamp); static Period createYearPeriod(String date); static Period createMaximumPeriod(); static Period getCurrentYear(); static Period getALL_TIME(); }
PeriodFactory { public static Period createDayPeriod(long timestamp) { MutableDateTime mdt = new MutableDateTime(timestamp); return createPeriod(toDayStart(mdt).getMillis(), toDayEnd(mdt).getMillis()); } PeriodFactory(); static Period createPeriod(long start, long end); static Period createPeriod(String start, String end); static Period createDayPeriod(long timestamp); static Period createDayPeriod(String date); static Period createHourPeriod(long timestamp); static Period createHourPeriod(String date); static Period createSinceHoursPeriod(int numberOfHours); static Period createSinceDaysPeriod(int numberOfDays); static Period createSinceWeeksPeriod(int numberOfWeeks); static Period createSinceMonthsPeriod(int numberOfMonths); static Period createSinceYearsPeriod(int numberOfYears); static Period getCurrentDay(); static Period createWeekPeriod(long timestamp); static Period createWeekPeriod(String date); static Period getCurrentWeek(); static Period createMonthPeriod(long timestamp); static Period createMonthPeriod(String date); static Period getCurrentMonth(); static Period createYearPeriod(long timestamp); static Period createYearPeriod(String date); static Period createMaximumPeriod(); static Period getCurrentYear(); static Period getALL_TIME(); static final Period ALL_TIME; }