com.michaelbaranov.microba.calendar
Interface HolidayPolicy
- Policy
public interface HolidayPolicy
extends Policy
This interface is used by CalendarPane and DatePicker to
provide means to define hollidays and optionally provide descriptions to
them.
String | getHollidayName(Object source, Calendar date)- This method is used to query a description for a holliday date.
|
boolean | isHolliday(Object source, Calendar date)- This method is used to check if a date is a holliday.
|
boolean | isWeekend(Object source, Calendar date)- This method is used to check if a date is a weekend date.
|
getHollidayName
public String getHollidayName(Object source,
Calendar date) This method is used to query a description for a holliday date. Note,
that implementation may return localized results based on the locale
passed with the date.
source - a control calling this methoddate - a holliday date to get the description for
- a localized name (a description) for a holliday
isHolliday
public boolean isHolliday(Object source,
Calendar date) This method is used to check if a date is a holliday. Holliday dates are
displayed by contols in a special way.
source - a control calling this methoddate - a date to check
true if given date is a holliday
false otherwise
isWeekend
public boolean isWeekend(Object source,
Calendar date) This method is used to check if a date is a weekend date. Implementation
should only check day of week component of the date.
source - a control calling this methoddate - a date to check
true if given date is weekend date
false otherwise