return new Span(_currentWeekStart, Calendar.DAY_OF_MONTH, RepeaterWeek.WEEK_DAYS);
}
@Override
protected Span _thisSpan(PointerType pointer) {
Span thisWeekSpan;
Calendar thisWeekStart;
Calendar thisWeekEnd;
if (pointer == PointerType.FUTURE) {
thisWeekStart = Time.cloneAndAdd(Time.ymdh(getNow()), Calendar.HOUR, 1);
RepeaterDayName sundayRepeater = new RepeaterDayName(RepeaterDayName.DayName.SUNDAY);
sundayRepeater.setStart((Calendar) getNow().clone());
Span thisSundaySpan = sundayRepeater.thisSpan(Pointer.PointerType.FUTURE);
thisWeekEnd = thisSundaySpan.getBeginCalendar();
thisWeekSpan = new Span(thisWeekStart, thisWeekEnd);
}
else if (pointer == PointerType.PAST) {
thisWeekEnd = Time.ymdh(getNow());
RepeaterDayName sundayRepeater = new RepeaterDayName(RepeaterDayName.DayName.SUNDAY);
sundayRepeater.setStart((Calendar) getNow().clone());
Span lastSundaySpan = sundayRepeater.nextSpan(Pointer.PointerType.PAST);
thisWeekStart = lastSundaySpan.getBeginCalendar();
thisWeekSpan = new Span(thisWeekStart, thisWeekEnd);
}
else if (pointer == PointerType.NONE) {
RepeaterDayName sundayRepeater = new RepeaterDayName(RepeaterDayName.DayName.SUNDAY);
sundayRepeater.setStart((Calendar) getNow().clone());
Span lastSundaySpan = sundayRepeater.nextSpan(Pointer.PointerType.PAST);
thisWeekStart = lastSundaySpan.getBeginCalendar();
thisWeekEnd = Time.cloneAndAdd(thisWeekStart, Calendar.DAY_OF_MONTH, RepeaterWeek.WEEK_DAYS);
thisWeekSpan = new Span(thisWeekStart, thisWeekEnd);
}
else {
throw new IllegalArgumentException("Unable to handle pointer " + pointer + ".");
}
return thisWeekSpan;