Date convertedDate = calendar.getTime();
String weekday = _dayMap.get(calendar.get(Calendar.DAY_OF_WEEK));
if (_getInvalidDaysOfWeek().contains(weekday))
{
throw new ValidatorException(
_getWrongWeekDayMessage(context, component, value, weekday));
}
String month = _monthMap.get(calendar.get(Calendar.MONTH));
if ( _getInvalidMonths().contains(month))
{
throw new ValidatorException(
_getWrongMonthMessage(context, component, value, month));
}
DateListProvider dlp = getInvalidDays();
List<Date> dates = null;
if (dlp != null)
{
dates = dlp.getDateList(context, calendar, calendar.getTime(), calendar.getTime());
}
if(dates!=null)
{
for (Date date : dates)
{
//range is only one submitted day...
if(!date.before(convertedDate) && !date.after(convertedDate))
{
throw new ValidatorException(
_getWrongDayMessage(context, component, value, date));
}
}
}
}