}
@Override
protected MutableInterval _thisMutableInterval(PointerType pointer) {
MutableInterval thisWeekMutableInterval;
DateTime thisWeekStart;
DateTime thisWeekEnd;
if (pointer == PointerType.FUTURE) {
thisWeekStart = Time.cloneAndAdd(Time.ymdh(getNow()), Time.HOUR, 1);
RepeaterDayName sundayRepeater = new RepeaterDayName(RepeaterDayName.DayName.SUNDAY);
sundayRepeater.setStart( new DateTime( getNow()));
MutableInterval thisSundayMutableInterval = sundayRepeater.thisMutableInterval(Pointer.PointerType.FUTURE);
thisWeekEnd = thisSundayMutableInterval.getStart();
thisWeekMutableInterval = new MutableInterval(thisWeekStart, thisWeekEnd);
}
else if (pointer == PointerType.PAST) {
thisWeekEnd = Time.ymdh(getNow());
RepeaterDayName sundayRepeater = new RepeaterDayName(RepeaterDayName.DayName.SUNDAY);
sundayRepeater.setStart( new DateTime(getNow()));
MutableInterval lastSundayMutableInterval = sundayRepeater.nextMutableInterval(Pointer.PointerType.PAST);
thisWeekStart = lastSundayMutableInterval.getStart();
thisWeekMutableInterval = new MutableInterval(thisWeekStart, thisWeekEnd);
}
else if (pointer == PointerType.NONE) {
RepeaterDayName sundayRepeater = new RepeaterDayName(RepeaterDayName.DayName.SUNDAY);
sundayRepeater.setStart(new DateTime(getNow()));
MutableInterval lastSundayMutableInterval = sundayRepeater.nextMutableInterval(Pointer.PointerType.PAST);
thisWeekStart = lastSundayMutableInterval.getStart();
thisWeekEnd = Time.cloneAndAdd(thisWeekStart, Time.DAY_OF_MONTH, RepeaterWeek.WEEK_DAYS);
thisWeekMutableInterval = new MutableInterval(thisWeekStart, thisWeekEnd);
}