Ther's an error in one of the rules for harvesting "at a date": when inserting both an occurrence AND a day of the week, the rule appears for example as:
Every 2 FRIDAY at 6.30
The class DayOfTheWeekInTheMonthEvent.java has a calculation error:
public Date getNextEventDate(Date lastHarvestDate) { Calendar req = Calendar.getInstance(); req.set(Calendar.DAY_OF_WEEK_IN_MONTH, (7*dayOfTheMonth)+dayOfTheWeek.getCalendarDay()); req.set(Calendar.HOUR_OF_DAY, timeOfTheDay.getHours()); req.set(Calendar.MINUTE, timeOfTheDay.getMinutes()); req.set(Calendar.SECOND, 0); req.set(Calendar.MILLISECOND, 0);
Will not create the required date.
The lines should be:
public Date getNextEventDate(Date lastHarvestDate) { Calendar req = Calendar.getInstance(); req.set(Calendar.DAY_OF_MONTH, dayOfTheMonth); req.set(Calendar.DAY_OF_WEEK, dayOfTheWeek.getCalendarDay()); req.set(Calendar.HOUR_OF_DAY, timeOfTheDay.getHours()); req.set(Calendar.MINUTE, timeOfTheDay.getMinutes()); req.set(Calendar.SECOND, 0); req.set(Calendar.MILLISECOND, 0);
In addition it would be useful to insert soem check on the page to avoid inconsisent inputs, like for example the 100 day of the month or similar
Ther's an error in one of the rules for harvesting "at a date": when inserting both an occurrence AND a day of the week, the rule appears for example as: Every 2 FRIDAY at 6.30 The class DayOfTheWeekInTheMonthEvent.java has a calculation error:
public Date getNextEventDate(Date lastHarvestDate) { Calendar req = Calendar.getInstance(); req.set(Calendar.DAY_OF_WEEK_IN_MONTH, (7*dayOfTheMonth)+dayOfTheWeek.getCalendarDay()); req.set(Calendar.HOUR_OF_DAY, timeOfTheDay.getHours()); req.set(Calendar.MINUTE, timeOfTheDay.getMinutes()); req.set(Calendar.SECOND, 0); req.set(Calendar.MILLISECOND, 0);
Will not create the required date. The lines should be:
public Date getNextEventDate(Date lastHarvestDate) { Calendar req = Calendar.getInstance(); req.set(Calendar.DAY_OF_MONTH, dayOfTheMonth); req.set(Calendar.DAY_OF_WEEK, dayOfTheWeek.getCalendarDay()); req.set(Calendar.HOUR_OF_DAY, timeOfTheDay.getHours()); req.set(Calendar.MINUTE, timeOfTheDay.getMinutes()); req.set(Calendar.SECOND, 0); req.set(Calendar.MILLISECOND, 0);
In addition it would be useful to insert soem check on the page to avoid inconsisent inputs, like for example the 100 day of the month or similar