Interface IBusinessCalendar
- All Known Subinterfaces:
IDefaultBusinessCalendar
public interface IBusinessCalendar
The IBusinessCalendar
supports time calculations in business hours and days.
Instead of using 24 hours a day and 7 days a week
the IBusinessCalendar
uses a set of predefined free days and working hours
for time calculations.
The Server Guide describes how these free days and working hours can be configured for your application.
- API:
- This is a public API.
-
Method Summary
Modifier and TypeMethodDescriptiongetBusinessDuration
(DateTime start, DateTime end) Calculates the amount of working time between a period of time.getBusinessTimeIn
(BusinessDuration businessDuration) Calculates the date and time after a period of working time is over.getBusinessTimeIn
(DateTime startDateTime, BusinessDuration businessDuration) Calculates the date and time after a period of working time is over.getFirstWorkDayOfMonth
(Number relativeMonths) Calculates the first working day of a month relative to the current month.getFirstWorkDayOfWeek
(Number relativeWeeks) Calculates the first working day of a week relative to the current week.getFirstWorkDayOfYear
(Number relativeYears) Calculates the first working day of a year relative to the current year.getLastWorkDayOfMonth
(Number relativeMonths) Calculates the last working date of a month relative to the current month.getLastWorkDayOfWeek
(Number relativeWeeks) Calculates the last working date of a week relative to the current week.getLastWorkDayOfYear
(Number relativeYears) Calculates the last working date of a year relative to the current year.getName()
Gets the name of the business calendargetWorkDayIn
(Date startDate, Number relativeWorkDays) Calculates the working day date after the relative amount of working days are over.getWorkDayIn
(Date startDate, Number relativeWorkDays, Time dayTime) Calculates the working day date after the relative amount of working days are over.getWorkDayIn
(DateTime startDateTime, Number relativeWorkDays) Calculates the working day date after the relative amount of working days are over.getWorkDayIn
(Number relativeWorkDays) Calculates the working day date after the relative amount of working days are over.
SeegetWorkDayIn(Date, Number)
for more information.getWorkDayIn
(Number relativeWorkDays, Time dayTime) Calculates the working day date after the relative amount of working days are over.boolean
Checks whether a date is a working day or not.boolean
isWorkTime
(DateTime dateTime) Checks whether a date time is a working time or not.
-
Method Details
-
getName
String getName()Gets the name of the business calendar- Returns:
- the name of the business calendar
- API:
- This public API is available in Java.
-
getWorkDayIn
Calculates the working day date after the relative amount of working days are over.
SeegetWorkDayIn(Date, Number)
for more information.- Parameters:
relativeWorkDays
- Amount of work days relative to the current day.- Returns:
- Work day date.
- See Also:
- API:
- This public API is available in Java.
-
getWorkDayIn
Calculates the working day date after the relative amount of working days are over. A free day is part of next work day.
Example: All days of the week are working days except the Sunday is a day off.
------------------------------------
| FR | SA | SU (day off) | MO | TU |
------------------------------------
getWorkDayIn(SA, 0) -> SA
getWorkDayIn(SA, 1) -> MO
getWorkDayIn(SA, -1) -> FR
getWorkDayIn(SU, 0) -> MO
getWorkDayIn(SU, 1) -> TU
getWorkDayIn(SU, -1) -> SA
getWorkDayIn(MO, 0) -> MO
getWorkDayIn(MO, 1) -> DI
getWorkDayIn(MO, -1) -> SA
- Parameters:
startDate
- Date from where the calculation starts.relativeWorkDays
- Amount of work days relative to the start date.- Returns:
- Work day date.
- API:
- This public API is available in Java.
-
getWorkDayIn
Calculates the working day date after the relative amount of working days are over. The returned date time represents the calculated working day at the time of the start.
SeegetWorkDayIn(Date, Number)
for more information.- Parameters:
startDateTime
- Date and time from where the calculation starts.relativeWorkDays
- Amount of work days relative to the start date.- Returns:
- Work day date and time.
- See Also:
- API:
- This public API is available in Java.
-
getWorkDayIn
Calculates the working day date after the relative amount of working days are over. The returned date time represents the calculated working day at the parameterized time. SeegetWorkDayIn(Date, Number)
for more information.- Parameters:
relativeWorkDays
- Amount of work days relative to the current day.dayTime
- Time in the work day.- Returns:
- Work day date and time.
- See Also:
- API:
- This public API is available in Java.
-
getWorkDayIn
Calculates the working day date after the relative amount of working days are over. The returned date time represents the calculated working day at the parameterized time. SeegetWorkDayIn(Date, Number)
for more information.- Parameters:
startDate
- Date from where the calculation starts.relativeWorkDays
- Amount of work days relative to the start date.dayTime
- Time in the work day.- Returns:
- Work day date and time.
- See Also:
- API:
- This public API is available in Java.
-
getFirstWorkDayOfWeek
Calculates the first working day of a week relative to the current week.- Parameters:
relativeWeeks
- Amount of weeks relative to the current week.- Returns:
- The first working date of the specified week.
- API:
- This public API is available in Java.
-
getFirstWorkDayOfMonth
Calculates the first working day of a month relative to the current month.- Parameters:
relativeMonths
- Amount of months relative to the current month.- Returns:
- The first working date of the specified month.
- API:
- This public API is available in Java.
-
getFirstWorkDayOfYear
Calculates the first working day of a year relative to the current year.- Parameters:
relativeYears
- Amount of years relative to the current year.- Returns:
- The first working date of the specified year.
- API:
- This public API is available in Java.
-
getLastWorkDayOfWeek
Calculates the last working date of a week relative to the current week.- Parameters:
relativeWeeks
- Amount of weeks relative to the current week.- Returns:
- The last working date of the specified week.
- API:
- This public API is available in Java.
-
getLastWorkDayOfMonth
Calculates the last working date of a month relative to the current month.- Parameters:
relativeMonths
- Amount of months relative to the current month.- Returns:
- The last working date of the specified month.
- API:
- This public API is available in Java.
-
getLastWorkDayOfYear
Calculates the last working date of a year relative to the current year.- Parameters:
relativeYears
- Amount of years relative to the current year.- Returns:
- The last working date of the specified year.
- API:
- This public API is available in Java.
-
getBusinessTimeIn
Calculates the date and time after a period of working time is over.- Parameters:
businessDuration
- Working time relative to the current time.- Returns:
- Date and time when the working period is over.
- API:
- This public API is available in Java.
-
getBusinessTimeIn
Calculates the date and time after a period of working time is over.- Parameters:
startDateTime
- Date and time from where the calculation starts.businessDuration
- Working time relative to the start date.- Returns:
- Date and time when the working period is over.
- API:
- This public API is available in Java.
-
getBusinessDuration
Calculates the amount of working time between a period of time.- Parameters:
start
- Period start date and timeend
- Period end date and time- Returns:
- Working time between the given period.
- API:
- This public API is available in Java.
-
isWorkDay
Checks whether a date is a working day or not.- Parameters:
date
- Date to check- Returns:
- True if the date is defined as a working day.
- API:
- This public API is available in Java.
-
isWorkTime
Checks whether a date time is a working time or not.- Parameters:
dateTime
- Date and time to check- Returns:
- True if the time at the specified date is defined as working time.
- API:
- This public API is available in Java.
-