public interface ICalendarEvaluator
ICalendarSystem.getCalendarEvaluator(Date, IWorkdayCalendar)
and ICalendarSystem.getCalendarEvaluator(Date, IWorkdayCalendar, IWorkdayCalendar)
. Evaluator
may be created using just business workday calendar or combination of business workday calendar and
user personal calendar. If specified user personal calendar is used to define user timeoff and busy
schedule.
Only the following event types are considered in the calenar calculations: Event.EVENT_TYPE_HOLIDAY
,
Event.EVENT_TYPE_OUT_OF_THE_OFFICE
, Event.EVENT_TYPE_WORKDAY
It is important to understand that all evaluations are done in the future date ranges off the baseDate passed when creating calendar evaluator
Modifier and Type | Method and Description |
---|---|
Date |
addWorkdays(Date dateTime,
int value)
Adds number of workdays to an absolute date and returns end of the business day.
|
Date |
addWorkhours(Date dateTime,
int value)
Adds or substracts (negative value) number of workhours to the specified absolute date.
|
Date |
addWorkminutes(Date dateTime,
int value)
Adds or substracts (negative value) number of workminutes to the specified absolute date.
|
PeriodEvent |
getNextWorkday(Date dateTime)
Returns closest workday for specified dateTime.
|
PeriodEvent |
getWorkday(Date dateTime)
Returns current workday for specified dateTime.
|
List<PeriodEvent> |
queryWorkDays(Date startDate,
Date endDate)
Returns list of workday periods in the given date range
|
List<PeriodEvent> queryWorkDays(Date startDate, Date endDate)
startDate
- start date for rangeendDate
- end date for rangePeriodEvent getWorkday(Date dateTime)
For example considering 9am-5pm Mon-Fri workdays:
getWorkday(8am Mon) = 9am-5pm Mon
getWorkday(11am Mon) = 9am-5pm Mon
getWorkday(6pm Mon) = 9am-5pm Tue
dateTime
- date time to query workdayPeriodEvent getNextWorkday(Date dateTime)
For example considering 9am-5pm Mon-Fri workdays:
getWorkday(8am Mon) = 9am-5pm Mon
getWorkday(11am Mon) = 9am-5pm Tue
getWorkday(6pm Mon) = 9am-5pm Tue
dateTime
- date time to query workdayDate addWorkdays(Date dateTime, int value)
For example considering 9am-5pm Mon-Fri workdays:
8am Mon + (1 workday) = 5pm Mon
11am Mon + (1 workday) = 5pm Tue
6pm Mon + (1 workday) = 5pm Tue
dateTime
- starting dateTimevalue
- positive number of workday to addDate addWorkhours(Date dateTime, int value)
For example considering 9am-5pm Mon-Fri workdays:
8am Mon + (1 workhour) = 10am Mon
11am Mon + (1 workhour) = 12pm Mon
6pm Mon + (1 workhour) = 10am Tue
8am Tue - (1 workhour) = 4pm Mon
dateTime
- absolute date to add or subtract workhoursvalue
- number of workhours to add (may be negative)Date addWorkminutes(Date dateTime, int value)
For example considering 9am-5pm Mon-Fri workdays:
8am Mon + (15 workminutes) = 9:15am Mon
11am Mon + (15 workminutes) = 12:15pm Mon
6pm Mon + (15 workminutes) = 9:15am Tue
8am Tue - (15 workminutes) = 4:45pm Mon
dateTime
- absolute date to add or subtract workminutesvalue
- number of workminutes to add (may be negative)