Span anchor = findWithin(repeaters, outerSpan, pointer, options);
return anchor;
}
public static Span dayOrTime(Calendar dayStart, List<Token> timeTokens, Options options) {
Span outerSpan = new Span(dayStart, Time.cloneAndAdd(dayStart, Calendar.DAY_OF_MONTH, 1));
if (!timeTokens.isEmpty()) {
// /** SUPER HACK MODE FOR TIMES **/
// Tag<?> dayPortionTag = null;
// Tag<?> timeTag = null;
// for (Token token : timeTokens) {
// Tag<?> tempDayPortionTag = token.getTag(RepeaterDayPortion.class);
// if (tempDayPortionTag != null) {
// dayPortionTag = tempDayPortionTag;
// }
//
// Tag<?> tempTimeTag = token.getTag(RepeaterTime.class);
// if (tempTimeTag != null) {
// timeTag = tempTimeTag;
// }
// }
//
// if (timeTag != null && dayPortionTag != null) {
// Tick tick = (Tick)timeTag.getType();
// RepeaterDayPortion.DayPortion dayPortion = (RepeaterDayPortion.DayPortion)dayPortionTag.getType();
// if (tick.intValue() <= (RepeaterDay.DAY_SECONDS / 2)) {
// if (dayPortion == RepeaterDayPortion.DayPortion.PM) {
// if (tick.intValue() == (12 * 60 * 60)) {
// Calendar exactTime = Time.cloneAndAdd(dayStart, Calendar.SECOND, tick.intValue());
// return new Span(exactTime, exactTime);
// }
// Calendar exactTime = Time.cloneAndAdd(dayStart, Calendar.SECOND, tick.intValue() + RepeaterDay.DAY_SECONDS / 2);
// return new Span(exactTime, exactTime);
// }
// else if (dayPortion == RepeaterDayPortion.DayPortion.AM) {
// if (tick.intValue() == (12 * 60 * 60)) {
// Calendar exactTime = dayStart;
// return new Span(exactTime, exactTime);
// }
// Calendar exactTime = Time.cloneAndAdd(dayStart, Calendar.SECOND, tick.intValue());
// return new Span(exactTime, exactTime);
// }
// }
// }
// /** SUPER HACK MODE FOR TIMES **/
options.setNow(outerSpan.getBeginCalendar());
Span time = getAnchor(dealiasAndDisambiguateTimes(timeTokens, options), options);
return time;
}
return outerSpan;
}