@Test public void testParseIntervalExpressionRelativeToToday() { PointInTime today = PointInTime.today(); IntervalOfTime dateRange = IntervalOfTimeFormat.parse("T-9..T"); assertThat(dateRange.getLow(), is(today.subtractDays(9).promote().getLow())); assertThat(dateRange.getHigh(), is(today.toPointInTimeAtMidnight().subtractMilliseconds(1))); assertThat(dateRange.isLowClosed(), is(true)); assertThat(dateRange.isHighClosed(), is(true)); dateRange = IntervalOfTimeFormat.parse("T-9"); assertThat(dateRange.getLow(), is(today.subtractDays(9).promote().getLow())); assertThat(dateRange.getHigh(), is(today.toPointInTimeAtMidnight().subtractMilliseconds(1))); dateRange = IntervalOfTimeFormat.parse("NOW-9d"); assertThat(dateRange.getLow(), is(mockNow.subtractDays(9))); assertThat(dateRange.getHigh(), is(today.promote().toClosed().getHigh())); dateRange = IntervalOfTimeFormat.parse("-1d"); assertThat(dateRange.getLow(), is(today.subtractDays(1).promote().getLow())); assertThat(dateRange.getHigh(), is(today.promote().toClosed().getHigh())); dateRange = IntervalOfTimeFormat.parse("T-1d"); assertThat(dateRange.getLow(), is(today.subtractDays(1).promote().getLow())); assertThat(dateRange.getHigh(), is(today.promote().toClosed().getHigh())); }
public static IntervalOfTime parse(String text) { return getDefault().parseInterval(text); }
IntervalOfTimeFormat { public static IntervalOfTime parse(String text) { return getDefault().parseInterval(text); } }
IntervalOfTimeFormat { public static IntervalOfTime parse(String text) { return getDefault().parseInterval(text); }  }
IntervalOfTimeFormat { public static IntervalOfTime parse(String text) { return getDefault().parseInterval(text); }  static IntervalOfTimeFormatter getDefault(); static IntervalOfTimeFormatter intervalForm(); static IntervalOfTime parse(String text); static IntervalOfTime parseIntervalForm(String text); static String print(IntervalOfTime text); static String printIntervalForm(IntervalOfTime text); static String toString(IntervalOfTime text); }
IntervalOfTimeFormat { public static IntervalOfTime parse(String text) { return getDefault().parseInterval(text); }  static IntervalOfTimeFormatter getDefault(); static IntervalOfTimeFormatter intervalForm(); static IntervalOfTime parse(String text); static IntervalOfTime parseIntervalForm(String text); static String print(IntervalOfTime text); static String printIntervalForm(IntervalOfTime text); static String toString(IntervalOfTime text);  }