}
}
Period period = null;
try {
DateTime from = new DateTime(startYear + "0101T000000Z");
DateTime to = new DateTime(endYear + "1231T000000Z");;
period = new Period(from, to);
} catch (ParseException e) {
_logger.log(Level.SEVERE, "Invalid start or end year: " + startYear + ", " + endYear, e);
return holidays;
}
for (Object component : _holidayCalendar.getComponents(VEVENT)) {
Component vevent = (Component) component;
String summary = vevent.getProperty(SUMMARY).getValue();
if(summary.equals(eventSummary)) {
PeriodList list = vevent.calculateRecurrenceSet(period);
for(Object p : list) {
DateTime date = ((Period) p).getStart();
// this date is at the date of the holiday at 12 AM UTC
Calendar utcCal = CalendarSource.getCurrentCalendar();
utcCal.setTimeZone(TimeZone.getTimeZone(GMT));
utcCal.setTime(date);