/** * Applies BYMONTHDAY rules specified in this Recur instance to the specified date list. If no BYMONTHDAY rules are * specified the date list is returned unmodified. * @param dates * @return */ private DateList getMonthDayVariants(final DateList dates) { if (getMonthDayList().isEmpty()) { return dates; } final DateList monthDayDates = getDateListInstance(dates); for (final Iterator i = dates.iterator(); i.hasNext();) { final Date date = (Date) i.next(); final Calendar cal = getCalendarInstance(date, false); for (final Iterator j = getMonthDayList().iterator(); j.hasNext();) { final Integer monthDay = (Integer) j.next(); try { cal.set(Calendar.DAY_OF_MONTH, Dates.getAbsMonthDay(cal.getTime(), monthDay.intValue())); monthDayDates.add(Dates.getInstance(cal.getTime(), monthDayDates.getType())); } catch (IllegalArgumentException iae) { if (log.isTraceEnabled()) { log.trace("Invalid day of month: " + Dates.getAbsMonthDay(cal .getTime(), monthDay.intValue())); } } } } return monthDayDates; }
/** * Applies BYMONTHDAY rules specified in this Recur instance to the specified date list. If no BYMONTHDAY rules are * specified the date list is returned unmodified. * * @param dates * @return */ private DateList getMonthDayVariants(final DateList dates) { if (getMonthDayList().isEmpty()) { return dates; } final DateList monthDayDates = getDateListInstance(dates); for (final Date date : dates) { final Calendar cal = getCalendarInstance(date, false); for (final Integer monthDay : getMonthDayList()) { try { cal.set(Calendar.DAY_OF_MONTH, Dates.getAbsMonthDay(cal.getTime(), monthDay)); monthDayDates.add(Dates.getInstance(cal.getTime(), monthDayDates.getType())); } catch (IllegalArgumentException iae) { if (log.isTraceEnabled()) { log.trace("Invalid day of month: " + Dates.getAbsMonthDay(cal .getTime(), monthDay)); } } } } return monthDayDates; }
/** * Applies BYMONTHDAY rules specified in this Recur instance to the specified date list. If no BYMONTHDAY rules are * specified the date list is returned unmodified. * * @param dates * @return */ private DateList getMonthDayVariants(final DateList dates) { if (getMonthDayList().isEmpty()) { return dates; } final DateList monthDayDates = getDateListInstance(dates); for (final Date date : dates) { final Calendar cal = getCalendarInstance(date, false); for (final Integer monthDay : getMonthDayList()) { try { cal.set(Calendar.DAY_OF_MONTH, Dates.getAbsMonthDay(cal.getTime(), monthDay)); monthDayDates.add(Dates.getInstance(cal.getTime(), monthDayDates.getType())); } catch (IllegalArgumentException iae) { if (log.isTraceEnabled()) { log.trace("Invalid day of month: " + Dates.getAbsMonthDay(cal .getTime(), monthDay)); } } } } return monthDayDates; }
b.append(yearDayList); if (!getMonthDayList().isEmpty()) { b.append(';'); b.append(BYMONTHDAY);
b.append(yearDayList); if (!getMonthDayList().isEmpty()) { b.append(';'); b.append(BYMONTHDAY);
b.append(yearDayList); if (!getMonthDayList().isEmpty()) { b.append(';'); b.append(BYMONTHDAY);
for (Recur recur : recurList) { monthList.addAll(recur.getMonthList()); monthDayList.addAll(recur.getMonthDayList()); weekDayList.addAll(recur.getDayList()); hourList.addAll(recur.getHourList()); newRecur.getMonthDayList().addAll(monthDayList); newRecur.getDayList().addAll(weekDayList); newRecur.getHourList().addAll(hourList);
private Frequency deriveFilterType() { if (frequency == Frequency.DAILY || !getYearDayList().isEmpty() || !getMonthDayList().isEmpty()) { return Frequency.DAILY; } else if (frequency == Frequency.WEEKLY || !getWeekNoList().isEmpty()) { return Frequency.WEEKLY; } else if (frequency == Frequency.MONTHLY || !getMonthList().isEmpty()) { return Frequency.MONTHLY; } else if (frequency == Frequency.YEARLY) { return Frequency.YEARLY; } return null; }
private Frequency deriveFilterType() { if (frequency == Frequency.DAILY || !getYearDayList().isEmpty() || !getMonthDayList().isEmpty()) { return Frequency.DAILY; } else if (frequency == Frequency.WEEKLY || !getWeekNoList().isEmpty()) { return Frequency.WEEKLY; } else if (frequency == Frequency.MONTHLY || !getMonthList().isEmpty()) { return Frequency.MONTHLY; } else if (frequency == Frequency.YEARLY) { return Frequency.YEARLY; } return null; }
/** * Applies BYDAY rules specified in this Recur instance to the specified date list. If no BYDAY rules are specified * the date list is returned unmodified. * @param dates * @return */ private DateList getDayVariants(final DateList dates) { if (getDayList().isEmpty()) { return dates; } final DateList weekDayDates = getDateListInstance(dates); for (final Iterator i = dates.iterator(); i.hasNext();) { final Date date = (Date) i.next(); for (final Iterator j = getDayList().iterator(); j.hasNext();) { final WeekDay weekDay = (WeekDay) j.next(); // if BYYEARDAY or BYMONTHDAY is specified filter existing // list.. if (!getYearDayList().isEmpty() || !getMonthDayList().isEmpty()) { final Calendar cal = getCalendarInstance(date, true); if (weekDay.equals(WeekDay.getWeekDay(cal))) { weekDayDates.add(date); } } else { weekDayDates.addAll(getAbsWeekDays(date, dates.getType(), weekDay)); } } } return weekDayDates; }
@SuppressWarnings("unchecked") @Override public void visit(TemporalExpressions.DayOfMonthRange expr) { int startDay = expr.getStartDay(); int endDay = expr.getEndDay(); NumberList dayList = new NumberList(); dayList.add(startDay); while (startDay != endDay) { startDay++; dayList.add(startDay); } Recur recur = new Recur(Recur.DAILY, 0); recur.getMonthDayList().addAll(dayList); this.state.addRecur(recur); }
rrc.setByMonthDay(checkNumList(recur.getMonthDayList())); rrc.setByYearDay(checkNumList(recur.getYearDayList())); rrc.setByWeekNo(checkNumList(recur.getWeekNoList()));
recurrenceData.setMonthMode(RecurrenceMonthMode.NONE); boolean[] monthdays = recurrenceData.getMonthdays(); for (Integer day : recur.getMonthDayList()) { recurrenceData.setCustomized(true); recurrenceData.setMonthMode(RecurrenceMonthMode.EACH);
/** * Applies BYDAY rules specified in this Recur instance to the specified date list. If no BYDAY rules are specified * the date list is returned unmodified. * * @param dates * @return */ private DateList getDayVariants(final DateList dates) { if (getDayList().isEmpty()) { return dates; } final DateList weekDayDates = getDateListInstance(dates); for (final Date date : dates) { for (final WeekDay weekDay : getDayList()) { // if BYYEARDAY or BYMONTHDAY is specified filter existing // list.. if (!getYearDayList().isEmpty() || !getMonthDayList().isEmpty()) { final Calendar cal = getCalendarInstance(date, true); if (weekDay.equals(WeekDay.getWeekDay(cal))) { weekDayDates.add(date); } } else { weekDayDates.addAll(getAbsWeekDays(date, dates.getType(), weekDay)); } } } return weekDayDates; }
/** * Applies BYDAY rules specified in this Recur instance to the specified date list. If no BYDAY rules are specified * the date list is returned unmodified. * * @param dates * @return */ private DateList getDayVariants(final DateList dates) { if (getDayList().isEmpty()) { return dates; } final DateList weekDayDates = getDateListInstance(dates); for (final Date date : dates) { for (final WeekDay weekDay : getDayList()) { // if BYYEARDAY or BYMONTHDAY is specified filter existing // list.. if (!getYearDayList().isEmpty() || !getMonthDayList().isEmpty()) { final Calendar cal = getCalendarInstance(date, true); if (weekDay.equals(WeekDay.getWeekDay(cal))) { weekDayDates.add(date); } } else { weekDayDates.addAll(getAbsWeekDays(date, dates.getType(), weekDay)); } } } return weekDayDates; }
outField(jgen, "byweekno", r.getWeekNoList()); outField(jgen, "byyearday", r.getYearDayList()); outField(jgen, "bymonthday", r.getMonthDayList()); outField(jgen, "byday", r.getDayList()); outField(jgen, "byhour", r.getHourList());
xmlProp(xml, XcalTags.byweekno, r.getWeekNoList()); xmlProp(xml, XcalTags.byyearday, r.getYearDayList()); xmlProp(xml, XcalTags.bymonthday, r.getMonthDayList()); xmlProp(xml, XcalTags.byday, r.getDayList()); xmlProp(xml, XcalTags.byhour, r.getHourList());
for (int i = 0; i < 31; i++) { if (monthdays[i]) { recur.getMonthDayList().add(i + 1);