Package org.apache.poi.ss.formula.atp
Class WorkdayCalculator
java.lang.Object
org.apache.poi.ss.formula.atp.WorkdayCalculator
A calculator for workdays, considering dates as excel representations.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionintcalculateWorkdays(double start, double end, double[] holidays) Calculate how many workdays are there between a start and an end date, as excel representations, considering a range of holidays.calculateWorkdays(double start, int workdays, double[] holidays) Calculate the workday past x workdays from a starting date, considering a range of holidays.calculateWorkdays(double start, int workdays, int weekendType, double[] holidays) Calculate the workday past x workdays from a starting date, considering a range of holidays.
-
Field Details
-
instance
-
-
Method Details
-
getValidWeekendTypes
-
calculateWorkdays
public int calculateWorkdays(double start, double end, double[] holidays) Calculate how many workdays are there between a start and an end date, as excel representations, considering a range of holidays.- Parameters:
start- start date.end- end date.holidays- an array of holidays.- Returns:
- number of workdays between start and end dates, including both dates.
-
calculateWorkdays
Calculate the workday past x workdays from a starting date, considering a range of holidays. Uses Sat/Sun weekend.- Parameters:
start- start date.workdays- number of workdays to be past from starting date.holidays- an array of holidays.- Returns:
- date past x workdays.
-
calculateWorkdays
Calculate the workday past x workdays from a starting date, considering a range of holidays.- Parameters:
start- start date.workdays- number of workdays to be past from starting date.weekendType- weekend parameter (see https://support.microsoft.com/en-us/office/workday-intl-function-a378391c-9ba7-4678-8a39-39611a9bf81d)holidays- an array of holidays.- Returns:
- date past x workdays.
-