Class BusinessCalendar
Date strings must be in a format that can be parsed by DateTimeUtils#parseDate
. Methods that accept strings
can be slower than methods written explicitly for Instant
, ZonedDateTime
, or LocalDate
.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
A runtime exception that is thrown when a date is invalid. -
Constructor Summary
ConstructorDescriptionBusinessCalendar
(String name, String description, ZoneId timeZone, LocalDate firstValidDate, LocalDate lastValidDate, CalendarDay<LocalTime> standardBusinessDay, Set<DayOfWeek> weekendDays, Map<LocalDate, CalendarDay<Instant>> holidays) Creates a new business calendar. -
Method Summary
Modifier and TypeMethodDescriptionString[]
businessDates
(String start, String end) Returns the business dates in a given range.String[]
businessDates
(String start, String end, boolean startInclusive, boolean endInclusive) Returns the business dates in a given range.businessDates
(Instant start, Instant end) Returns the business dates in a given range.businessDates
(Instant start, Instant end, boolean startInclusive, boolean endInclusive) Returns the business dates in a given range.businessDates
(LocalDate start, LocalDate end) Returns the business dates in a given range.businessDates
(LocalDate start, LocalDate end, boolean startInclusive, boolean endInclusive) Returns the business dates in a given range.businessDates
(ZonedDateTime start, ZonedDateTime end) Returns the business dates in a given range.businessDates
(ZonedDateTime start, ZonedDateTime end, boolean startInclusive, boolean endInclusive) Returns the business dates in a given range.Returns theCalendarDay
for a date.calendarDay
(String date) Returns theCalendarDay
for a date.calendarDay
(Instant time) Returns theCalendarDay
for a date.calendarDay
(LocalDate date) Returns theCalendarDay
for a date.calendarDay
(ZonedDateTime time) Returns theCalendarDay
for a date.double
diffBusinessDays
(Instant start, Instant end) Returns the amount of business time in standard business days between two times.double
diffBusinessDays
(ZonedDateTime start, ZonedDateTime end) Returns the amount of business time in standard business days between two times.diffBusinessDuration
(Instant start, Instant end) Returns the amount of business time between two times.diffBusinessDuration
(ZonedDateTime start, ZonedDateTime end) Returns the amount of business time between two times.long
diffBusinessNanos
(Instant start, Instant end) Returns the amount of business time in nanoseconds between two times.long
diffBusinessNanos
(ZonedDateTime start, ZonedDateTime end) Returns the amount of business time in nanoseconds between two times.double
diffBusinessYears
(Instant start, Instant end) Returns the number of business years betweenstart
andend
.double
diffBusinessYears
(ZonedDateTime start, ZonedDateTime end) Returns the number of business years betweenstart
andend
.diffNonBusinessDuration
(Instant start, Instant end) Returns the amount of non-business time between two times.diffNonBusinessDuration
(ZonedDateTime start, ZonedDateTime end) Returns the amount of non-business time between two times.long
diffNonBusinessNanos
(Instant start, Instant end) Returns the amount of non-business time in nanoseconds between two times.long
diffNonBusinessNanos
(ZonedDateTime start, ZonedDateTime end) Returns the amount of non-business time in nanoseconds between two times.Returns the first valid date for the business calendar.double
Fraction of the current business day complete.double
Fraction of the business day complete.double
Fraction of the business day complete.double
Fraction of the business day remaining.double
Fraction of the business day remaining.double
Fraction of the business day remaining.double
Returns the ratio of the business day length and the standard business day length.double
Returns the ratio of the business day length and the standard business day length.double
Returns the ratio of the business day length and the standard business day length.double
Returns the ratio of the business day length and the standard business day length.double
Returns the ratio of the business day length and the standard business day length.futureBusinessDate
(int days) Adds a specified number of business days to the current date.futureNonBusinessDate
(int days) Adds a specified number of non-business days to the current date.holidays()
Business day schedules for all holidays.boolean
Is the current day a business day? As long as the current time occurs on a business day, it is considered a business day.boolean
isBusinessDay
(String date) Is the date a business day?boolean
isBusinessDay
(DayOfWeek day) Is the day of the week a normal business day?boolean
isBusinessDay
(Instant time) Is the time on a business day?boolean
isBusinessDay
(LocalDate date) Is the date a business day?boolean
isBusinessDay
(ZonedDateTime time) Is the time on a business day?boolean
Determines if the current time according to the Deephaven system clock is a business time.boolean
isBusinessTime
(Instant time) Determines if the specified time is a business time.boolean
isBusinessTime
(ZonedDateTime time) Determines if the specified time is a business time.boolean
Is the current date the last business day of the month?boolean
Is the date the last business day of the month?boolean
Is the time on the last business day of the month?boolean
Is the time on the last business day of the month?boolean
Is the current date the last business day of the week?boolean
Is the date is last business day of the week?boolean
Is the time on the last business day of the week?boolean
Is the date the last business day of the week?boolean
Is the time on the last business day of the week?boolean
Is the current date the last business day of the year?boolean
Is the time on the last business day of the year?boolean
Is the time on the last business day of the year?Returns the last valid date for the business calendar.minusBusinessDays
(String date, int days) Subtracts a specified number of business days from an input date.minusBusinessDays
(Instant time, int days) Subtracts a specified number of business days from an input time.minusBusinessDays
(LocalDate date, int days) Subtracts a specified number of business days from an input date.minusBusinessDays
(ZonedDateTime time, int days) Subtracts a specified number of business days from an input time.minusNonBusinessDays
(String date, int days) Subtracts a specified number of non-business days to an input date.minusNonBusinessDays
(Instant time, int days) Subtracts a specified number of non-business days to an input time.minusNonBusinessDays
(LocalDate date, int days) Subtracts a specified number of non-business days to an input date.minusNonBusinessDays
(ZonedDateTime time, int days) Subtracts a specified number of non-business days to an input time.String[]
nonBusinessDates
(String start, String end) Returns the non-business dates in a given range.String[]
nonBusinessDates
(String start, String end, boolean startInclusive, boolean endInclusive) Returns the non-business dates in a given range.nonBusinessDates
(Instant start, Instant end) Returns the non-business dates in a given range.nonBusinessDates
(Instant start, Instant end, boolean startInclusive, boolean endInclusive) Returns the non-business dates in a given range.nonBusinessDates
(LocalDate start, LocalDate end) Returns the non-business dates in a given range.nonBusinessDates
(LocalDate start, LocalDate end, boolean startInclusive, boolean endInclusive) Returns the non-business dates in a given range.nonBusinessDates
(ZonedDateTime start, ZonedDateTime end) Returns the non-business dates in a given range.nonBusinessDates
(ZonedDateTime start, ZonedDateTime end, boolean startInclusive, boolean endInclusive) Returns the non-business dates in a given range.int
numberBusinessDates
(String start, String end) Returns the number of business dates in a given range.int
numberBusinessDates
(String start, String end, boolean startInclusive, boolean endInclusive) Returns the number of business dates in a given range.int
numberBusinessDates
(Instant start, Instant end) Returns the number of business dates in a given range.int
numberBusinessDates
(Instant start, Instant end, boolean startInclusive, boolean endInclusive) Returns the number of business dates in a given range.int
numberBusinessDates
(LocalDate start, LocalDate end) Returns the number of business dates in a given range.int
numberBusinessDates
(LocalDate start, LocalDate end, boolean startInclusive, boolean endInclusive) Returns the number of business dates in a given range.int
numberBusinessDates
(ZonedDateTime start, ZonedDateTime end) Returns the number of business dates in a given range.int
numberBusinessDates
(ZonedDateTime start, ZonedDateTime end, boolean startInclusive, boolean endInclusive) Returns the number of business dates in a given range.int
numberNonBusinessDates
(String start, String end) Returns the number of non-business dates in a given range.int
numberNonBusinessDates
(String start, String end, boolean startInclusive, boolean endInclusive) Returns the number of non-business dates in a given range.int
numberNonBusinessDates
(Instant start, Instant end) Returns the number of non-business dates in a given range.int
numberNonBusinessDates
(Instant start, Instant end, boolean startInclusive, boolean endInclusive) Returns the number of non-business dates in a given range.int
numberNonBusinessDates
(LocalDate start, LocalDate end) Returns the number of non-business dates in a given range.int
numberNonBusinessDates
(LocalDate start, LocalDate end, boolean startInclusive, boolean endInclusive) Returns the number of non-business dates in a given range.int
numberNonBusinessDates
(ZonedDateTime start, ZonedDateTime end) Returns the number of non-business dates in a given range.int
numberNonBusinessDates
(ZonedDateTime start, ZonedDateTime end, boolean startInclusive, boolean endInclusive) Returns the number of non-business dates in a given range.pastBusinessDate
(int days) Subtracts a specified number of business days from the current date.pastNonBusinessDate
(int days) Subtracts a specified number of non-business days to the current date.plusBusinessDays
(String date, int days) Adds a specified number of business days to an input date.plusBusinessDays
(Instant time, int days) Adds a specified number of business days to an input time.plusBusinessDays
(LocalDate date, int days) Adds a specified number of business days to an input date.plusBusinessDays
(ZonedDateTime time, int days) Adds a specified number of business days to an input time.plusNonBusinessDays
(String date, int days) Adds a specified number of non-business days to an input date.plusNonBusinessDays
(Instant time, int days) Adds a specified number of non-business days to an input time.plusNonBusinessDays
(LocalDate date, int days) Adds a specified number of non-business days to an input date.plusNonBusinessDays
(ZonedDateTime time, int days) Adds a specified number of non-business days to an input time.Business day schedule for a standard business day.Length of a standard business day.long
Length of a standard business day in nanoseconds.Returns the days that make up a weekend.Methods inherited from class io.deephaven.time.calendar.Calendar
calendarDate, calendarDates, calendarDates, calendarDates, calendarDates, calendarDates, calendarDates, calendarDates, calendarDates, dayOfWeek, dayOfWeek, dayOfWeek, dayOfWeek, dayOfWeek, dayOfWeekValue, dayOfWeekValue, dayOfWeekValue, dayOfWeekValue, dayOfWeekValue, description, futureDate, minusDays, minusDays, minusDays, minusDays, name, numberCalendarDates, numberCalendarDates, numberCalendarDates, numberCalendarDates, numberCalendarDates, numberCalendarDates, numberCalendarDates, numberCalendarDates, pastDate, plusDays, plusDays, plusDays, plusDays, timeZone, toString
-
Constructor Details
-
BusinessCalendar
public BusinessCalendar(String name, String description, ZoneId timeZone, LocalDate firstValidDate, LocalDate lastValidDate, CalendarDay<LocalTime> standardBusinessDay, Set<DayOfWeek> weekendDays, Map<LocalDate, CalendarDay<Instant>> holidays) Creates a new business calendar.- Parameters:
name
- calendar name.description
- calendar description.timeZone
- calendar time zone.firstValidDate
- first valid date for the business calendar.lastValidDate
- last valid date for the business calendar.standardBusinessDay
- business day schedule for a standard business dayweekendDays
- weekend daysholidays
- holidays. Business day schedules for all holidays. A holiday is a date that has a schedule that is different from the schedule for a standard business day or weekend.- Throws:
RequirementFailure
- if any argument is null.
-
-
Method Details
-
firstValidDate
Returns the first valid date for the business calendar.- Returns:
- first valid date for the business calendar.
-
lastValidDate
Returns the last valid date for the business calendar.- Returns:
- last valid date for the business calendar.
-
weekendDays
Returns the days that make up a weekend.- Returns:
- days that make up a weekend.
-
standardBusinessDay
Business day schedule for a standard business day.- Returns:
- business day schedule for a standard business day.
-
standardBusinessNanos
public long standardBusinessNanos()Length of a standard business day in nanoseconds.- Returns:
- length of a standard business day in nanoseconds
-
standardBusinessDuration
Length of a standard business day.- Returns:
- length of a standard business day
-
holidays
Business day schedules for all holidays. A holiday is a date that has a schedule that is different from the schedule for a standard business day or weekend.- Returns:
- a map of holiday dates and their calendar days
-
calendarDay
Returns theCalendarDay
for a date.- Parameters:
date
- date- Returns:
- the corresponding
CalendarDay
ofdate
.null
if the input isnull
. - Throws:
BusinessCalendar.InvalidDateException
- if the date is not in the valid range
-
calendarDay
Returns theCalendarDay
for a date.- Parameters:
time
- time- Returns:
- the corresponding
CalendarDay
ofdate
.null
if the input isnull
. - Throws:
BusinessCalendar.InvalidDateException
- if the date is not in the valid range
-
calendarDay
Returns theCalendarDay
for a date.- Parameters:
time
- time- Returns:
- the corresponding
CalendarDay
ofdate
.null
if the input isnull
. - Throws:
BusinessCalendar.InvalidDateException
- if the date is not in the valid range
-
calendarDay
Returns theCalendarDay
for a date.- Parameters:
date
- date- Returns:
- the corresponding
CalendarDay
ofdate
.null
if the input isnull
. - Throws:
BusinessCalendar.InvalidDateException
- if the date is not in the valid rangeDateTimeUtils.DateTimeParseException
- if the string cannot be parsed
-
calendarDay
Returns theCalendarDay
for a date.- Returns:
- today's business day schedule
- Throws:
BusinessCalendar.InvalidDateException
- if the date is not in the valid range
-
isBusinessDay
Is the date a business day?- Parameters:
date
- date- Returns:
- true if the date is a business day; false otherwise. False if the input is
null
. - Throws:
BusinessCalendar.InvalidDateException
- if the date is not in the valid range
-
isBusinessDay
Is the date a business day?- Parameters:
date
- date- Returns:
- true if the date is a business day; false otherwise. False if the input is
null
. - Throws:
BusinessCalendar.InvalidDateException
- if the date is not in the valid rangeDateTimeUtils.DateTimeParseException
- if the string cannot be parsed
-
isBusinessDay
Is the time on a business day?As long as the time occurs on a business day, it is considered a business day. The time does not have to be within the business day schedule. To determine if a time is within the business day schedule, use
isBusinessTime(ZonedDateTime)
.- Parameters:
time
- time- Returns:
- true if the date is a business day; false otherwise. False if the input is
null
. - Throws:
BusinessCalendar.InvalidDateException
- if the date is not in the valid range
-
isBusinessDay
Is the time on a business day?As long as the time occurs on a business day, it is considered a business day. The time does not have to be within the business day schedule. To determine if a time is within the business day schedule, use
isBusinessTime(Instant)
.- Parameters:
time
- time- Returns:
- true if the date is a business day; false otherwise. False if the input is
null
. - Throws:
BusinessCalendar.InvalidDateException
- if the date is not in the valid range
-
isBusinessDay
Is the day of the week a normal business day?- Parameters:
day
- a day of the week- Returns:
- true if the day is a business day; false otherwise. False if the input is
null
.
-
isBusinessDay
public boolean isBusinessDay()Is the current day a business day? As long as the current time occurs on a business day, it is considered a business day. The time does not have to be within the business day schedule.- Returns:
- true if the current day is a business day; false otherwise
-
isLastBusinessDayOfMonth
Is the time on the last business day of the month?As long as the time occurs on a business day, it is considered a business day. The time does not have to be within the business day schedule.
- Parameters:
time
- time- Returns:
- true if
time
is on the last business day of the month; false otherwise. False if the input isnull
. - Throws:
BusinessCalendar.InvalidDateException
- if the date is not in the valid range
-
isLastBusinessDayOfMonth
Is the time on the last business day of the month?As long as the time occurs on a business day, it is considered a business day. The time does not have to be within the business day schedule.
- Parameters:
time
- time- Returns:
- true if
time
is on the last business day of the month; false otherwise. False if the input isnull
. - Throws:
BusinessCalendar.InvalidDateException
- if the date is not in the valid range
-
isLastBusinessDayOfMonth
Is the date the last business day of the month?- Parameters:
date
- date- Returns:
- true if
time
is on the last business day of the month; false otherwise. False if the input isnull
. - Throws:
BusinessCalendar.InvalidDateException
- if the date is not in the valid rangeDateTimeUtils.DateTimeParseException
- if the string cannot be parsed
-
isLastBusinessDayOfMonth
public boolean isLastBusinessDayOfMonth()Is the current date the last business day of the month?- Returns:
- true if the current date is the last business day of the month; false otherwise.
-
isLastBusinessDayOfWeek
Is the date the last business day of the week?- Parameters:
date
- date- Returns:
- true if
date
is on the last business day of the week; false otherwise. False if the input isnull
. - Throws:
BusinessCalendar.InvalidDateException
- if the date is not in the valid range
-
isLastBusinessDayOfWeek
Is the time on the last business day of the week?As long as the time occurs on a business day, it is considered a business day. The time does not have to be within the business day schedule.
- Parameters:
time
- time- Returns:
- true if
time
is on the last business day of the week; false otherwise. False if the input isnull
. - Throws:
BusinessCalendar.InvalidDateException
- if the date is not in the valid range
-
isLastBusinessDayOfWeek
Is the time on the last business day of the week?As long as the time occurs on a business day, it is considered a business day. The time does not have to be within the business day schedule.
- Parameters:
time
- time- Returns:
- true if
time
is on the last business day of the week; false otherwise. False if the input isnull
. - Throws:
BusinessCalendar.InvalidDateException
- if the date is not in the valid range
-
isLastBusinessDayOfWeek
Is the date is last business day of the week?- Parameters:
date
- date- Returns:
- true if
date
is the last business day of the week; false otherwise. False if the input isnull
. - Throws:
BusinessCalendar.InvalidDateException
- if the date is not in the valid rangeDateTimeUtils.DateTimeParseException
- if the string cannot be parsed
-
isLastBusinessDayOfWeek
public boolean isLastBusinessDayOfWeek()Is the current date the last business day of the week?- Returns:
- true if the current date is the last business day of the week; false otherwise.
-
isLastBusinessDayOfYear
Is the time on the last business day of the year?As long as the time occurs on a business day, it is considered a business day. The time does not have to be within the business day schedule.
- Parameters:
time
- time- Returns:
- true if
time
is on the last business day of the year; false otherwise. False if the input isnull
. - Throws:
BusinessCalendar.InvalidDateException
- if the date is not in the valid range
-
isLastBusinessDayOfYear
Is the time on the last business day of the year?As long as the time occurs on a business day, it is considered a business day. The time does not have to be within the business day schedule.
- Parameters:
time
- time- Returns:
- true if
time
is on the last business day of the year; false otherwise. False if the input isnull
. - Throws:
BusinessCalendar.InvalidDateException
- if the date is not in the valid range
-
isLastBusinessDayOfYear
public boolean isLastBusinessDayOfYear()Is the current date the last business day of the year?As long as the current time occurs on a business day, it is considered a business day. The time does not have to be within the business day schedule.
- Returns:
- true if the current date is the last business day of the year; false otherwise.
-
isBusinessTime
Determines if the specified time is a business time. Business times fall within business time ranges of the day's business schedule.- Parameters:
time
- time- Returns:
- true if the specified time is a business time; otherwise, false. False if the input is
null
. - Throws:
BusinessCalendar.InvalidDateException
- if the date is not in the valid range
-
isBusinessTime
Determines if the specified time is a business time. Business times fall within business time ranges of the day's business schedule.- Parameters:
time
- time- Returns:
- true if the specified time is a business time; otherwise, false. False if the input is
null
. - Throws:
BusinessCalendar.InvalidDateException
- if the date is not in the valid range
-
isBusinessTime
public boolean isBusinessTime()Determines if the current time according to the Deephaven system clock is a business time. Business times fall within business time ranges of the day's business schedule.- Returns:
- true if the specified time is a business time; otherwise, false.
- Throws:
BusinessCalendar.InvalidDateException
- if the date is not in the valid range
-
fractionStandardBusinessDay
Returns the ratio of the business day length and the standard business day length. For example, a holiday has zero business time and will therefore return 0.0. A normal business day will be of the standard length and will therefore return 1.0. A NYSE half day holiday will return 0.538 (3.5 hours open, over a standard 6.5 hour day).- Parameters:
date
- date- Returns:
- ratio of the business day length and the standard business day length for the date.
QueryConstants.NULL_DOUBLE
if the input isnull
. - Throws:
BusinessCalendar.InvalidDateException
- if the date is not in the valid range
-
fractionStandardBusinessDay
Returns the ratio of the business day length and the standard business day length. For example, a holiday has zero business time and will therefore return 0.0. A normal business day will be of the standard length and will therefore return 1.0. A half day holiday will return 0.5.- Parameters:
date
- date- Returns:
- ratio of the business day length and the standard business day length for the date.
QueryConstants.NULL_DOUBLE
if the input isnull
. - Throws:
BusinessCalendar.InvalidDateException
- if the date is not in the valid rangeDateTimeUtils.DateTimeParseException
- if the string cannot be parsed
-
fractionStandardBusinessDay
Returns the ratio of the business day length and the standard business day length. For example, a holiday has zero business time and will therefore return 0.0. A normal business day will be of the standard length and will therefore return 1.0. A half day holiday will return 0.5.- Parameters:
time
- time- Returns:
- ratio of the business day length and the standard business day length for the date.
QueryConstants.NULL_DOUBLE
if the input isnull
. - Throws:
BusinessCalendar.InvalidDateException
- if the date is not in the valid range
-
fractionStandardBusinessDay
Returns the ratio of the business day length and the standard business day length. For example, a holiday has zero business time and will therefore return 0.0. A normal business day will be of the standard length and will therefore return 1.0. A half day holiday will return 0.5.- Parameters:
time
- time- Returns:
- ratio of the business day length and the standard business day length for the date.
QueryConstants.NULL_DOUBLE
if the input isnull
. - Throws:
BusinessCalendar.InvalidDateException
- if the date is not in the valid range
-
fractionStandardBusinessDay
public double fractionStandardBusinessDay()Returns the ratio of the business day length and the standard business day length. For example, a holiday has zero business time and will therefore return 0.0. A normal business day will be of the standard length and will therefore return 1.0. A half day holiday will return 0.5.- Returns:
- ratio of the business day length and the standard business day length for the date
- Throws:
BusinessCalendar.InvalidDateException
- if the date is not in the valid range
-
fractionBusinessDayComplete
Fraction of the business day complete.- Parameters:
time
- time- Returns:
- the fraction of the business day complete, or 1.0 if the day is not a business day.
QueryConstants.NULL_DOUBLE
if the input isnull
. - Throws:
BusinessCalendar.InvalidDateException
- if the date is not in the valid range
-
fractionBusinessDayComplete
Fraction of the business day complete.- Parameters:
time
- time- Returns:
- the fraction of the business day complete, or 1.0 if the day is not a business day.
QueryConstants.NULL_DOUBLE
if the input isnull
. - Throws:
BusinessCalendar.InvalidDateException
- if the date is not in the valid range
-
fractionBusinessDayComplete
public double fractionBusinessDayComplete()Fraction of the current business day complete.- Returns:
- the fraction of the business day complete, or 1.0 if the day is not a business day
- Throws:
BusinessCalendar.InvalidDateException
- if the date is not in the valid range
-
fractionBusinessDayRemaining
Fraction of the business day remaining.- Parameters:
time
- time- Returns:
- the fraction of the business day complete, or 0.0 if the day is not a business
day.
QueryConstants.NULL_DOUBLE
if the input isnull
. - Throws:
BusinessCalendar.InvalidDateException
- if the date is not in the valid range
-
fractionBusinessDayRemaining
Fraction of the business day remaining.- Parameters:
time
- time- Returns:
- the fraction of the business day complete, or 0.0 if the day is not a business day.
QueryConstants.NULL_DOUBLE
if the input isnull
. - Throws:
BusinessCalendar.InvalidDateException
- if the date is not in the valid range
-
fractionBusinessDayRemaining
public double fractionBusinessDayRemaining()Fraction of the business day remaining.- Returns:
- the fraction of the business day complete, or 0.0 if the day is not a business day
- Throws:
BusinessCalendar.InvalidDateException
- if the date is not in the valid range
-
numberBusinessDates
public int numberBusinessDates(LocalDate start, LocalDate end, boolean startInclusive, boolean endInclusive) Returns the number of business dates in a given range.- Parameters:
start
- start of a time rangeend
- end of a time rangestartInclusive
- true to includestart
in the result; false to excludestart
endInclusive
- true to includeend
in the result; false to excludeend
- Returns:
- number of business dates between
start
andend
.QueryConstants.NULL_INT
if any input isnull
. - Throws:
BusinessCalendar.InvalidDateException
- if the dates are not in the valid range
-
numberBusinessDates
public int numberBusinessDates(String start, String end, boolean startInclusive, boolean endInclusive) Returns the number of business dates in a given range.- Parameters:
start
- start of a time rangeend
- end of a time rangestartInclusive
- true to includestart
in the result; false to excludestart
endInclusive
- true to includeend
in the result; false to excludeend
- Returns:
- number of business dates between
start
andend
.QueryConstants.NULL_INT
if any input isnull
. - Throws:
BusinessCalendar.InvalidDateException
- if the dates are not in the valid rangeDateTimeUtils.DateTimeParseException
- if the string cannot be parsed
-
numberBusinessDates
public int numberBusinessDates(ZonedDateTime start, ZonedDateTime end, boolean startInclusive, boolean endInclusive) Returns the number of business dates in a given range.- Parameters:
start
- start of a time rangeend
- end of a time rangestartInclusive
- true to includestart
in the result; false to excludestart
endInclusive
- true to includeend
in the result; false to excludeend
- Returns:
- number of business dates between
start
andend
.QueryConstants.NULL_INT
if any input isnull
. - Throws:
BusinessCalendar.InvalidDateException
- if the dates are not in the valid range
-
numberBusinessDates
public int numberBusinessDates(Instant start, Instant end, boolean startInclusive, boolean endInclusive) Returns the number of business dates in a given range.- Parameters:
start
- start of a time rangeend
- end of a time rangestartInclusive
- true to includestart
in the result; false to excludestart
endInclusive
- true to includeend
in the result; false to excludeend
- Returns:
- number of business dates between
start
andend
.QueryConstants.NULL_INT
if any input isnull
. - Throws:
BusinessCalendar.InvalidDateException
- if the dates are not in the valid range
-
numberBusinessDates
Returns the number of business dates in a given range.- Parameters:
start
- start of a time rangeend
- end of a time range- Returns:
- number of business dates between
start
andend
; includingstart
andend
.QueryConstants.NULL_INT
if any input isnull
. - Throws:
BusinessCalendar.InvalidDateException
- if the dates are not in the valid range
-
numberBusinessDates
Returns the number of business dates in a given range.- Parameters:
start
- start of a time rangeend
- end of a time range- Returns:
- number of business dates between
start
andend
; includingstart
andend
.QueryConstants.NULL_INT
if any input isnull
. - Throws:
BusinessCalendar.InvalidDateException
- if the dates are not in the valid rangeDateTimeUtils.DateTimeParseException
- if the string cannot be parsed
-
numberBusinessDates
Returns the number of business dates in a given range.- Parameters:
start
- start of a time rangeend
- end of a time range- Returns:
- number of business dates between
start
andend
; includingstart
andend
.QueryConstants.NULL_INT
if any input isnull
. - Throws:
BusinessCalendar.InvalidDateException
- if the dates are not in the valid range
-
numberBusinessDates
Returns the number of business dates in a given range.- Parameters:
start
- start of a time rangeend
- end of a time range- Returns:
- number of business dates between
start
andend
; includingstart
andend
.QueryConstants.NULL_INT
if any input isnull
. - Throws:
BusinessCalendar.InvalidDateException
- if the dates are not in the valid range
-
numberNonBusinessDates
public int numberNonBusinessDates(LocalDate start, LocalDate end, boolean startInclusive, boolean endInclusive) Returns the number of non-business dates in a given range.- Parameters:
start
- start of a time rangeend
- end of a time rangestartInclusive
- true to includestart
in the result; false to excludestart
endInclusive
- true to includeend
in the result; false to excludeend
- Returns:
- number of non-business dates between
start
andend
.QueryConstants.NULL_INT
if any input isnull
. - Throws:
BusinessCalendar.InvalidDateException
- if the dates are not in the valid range
-
numberNonBusinessDates
public int numberNonBusinessDates(String start, String end, boolean startInclusive, boolean endInclusive) Returns the number of non-business dates in a given range.- Parameters:
start
- start of a time rangeend
- end of a time rangestartInclusive
- true to includestart
in the result; false to excludestart
endInclusive
- true to includeend
in the result; false to excludeend
- Returns:
- number of non-business dates between
start
andend
.QueryConstants.NULL_INT
if any input isnull
. - Throws:
BusinessCalendar.InvalidDateException
- if the dates are not in the valid rangeDateTimeUtils.DateTimeParseException
- if the string cannot be parsed
-
numberNonBusinessDates
public int numberNonBusinessDates(ZonedDateTime start, ZonedDateTime end, boolean startInclusive, boolean endInclusive) Returns the number of non-business dates in a given range.- Parameters:
start
- start of a time rangeend
- end of a time rangestartInclusive
- true to includestart
in the result; false to excludestart
endInclusive
- true to includeend
in the result; false to excludeend
- Returns:
- number of non-business dates between
start
andend
.QueryConstants.NULL_INT
if any input isnull
. - Throws:
BusinessCalendar.InvalidDateException
- if the dates are not in the valid range
-
numberNonBusinessDates
public int numberNonBusinessDates(Instant start, Instant end, boolean startInclusive, boolean endInclusive) Returns the number of non-business dates in a given range.- Parameters:
start
- start of a time rangeend
- end of a time rangestartInclusive
- true to includestart
in the result; false to excludestart
endInclusive
- true to includeend
in the result; false to excludeend
- Returns:
- number of non-business dates between
start
andend
.QueryConstants.NULL_INT
if any input isnull
. - Throws:
BusinessCalendar.InvalidDateException
- if the dates are not in the valid range
-
numberNonBusinessDates
Returns the number of non-business dates in a given range.- Parameters:
start
- start of a time rangeend
- end of a time range- Returns:
- number of non-business dates between
start
andend
; includingstart
andend
.QueryConstants.NULL_INT
if any input isnull
. - Throws:
BusinessCalendar.InvalidDateException
- if the dates are not in the valid range
-
numberNonBusinessDates
Returns the number of non-business dates in a given range.- Parameters:
start
- start of a time rangeend
- end of a time range- Returns:
- number of non-business dates between
start
andend
; includingstart
andend
.QueryConstants.NULL_INT
if any input isnull
. - Throws:
BusinessCalendar.InvalidDateException
- if the dates are not in the valid rangeDateTimeUtils.DateTimeParseException
- if the string cannot be parsed
-
numberNonBusinessDates
Returns the number of non-business dates in a given range.- Parameters:
start
- start of a time rangeend
- end of a time range- Returns:
- number of non-business dates between
start
andend
; includingstart
andend
.QueryConstants.NULL_INT
if any input isnull
. - Throws:
BusinessCalendar.InvalidDateException
- if the dates are not in the valid range
-
numberNonBusinessDates
Returns the number of non-business dates in a given range.- Parameters:
start
- start of a time rangeend
- end of a time range- Returns:
- number of non-business dates between
start
andend
; includingstart
andend
.QueryConstants.NULL_INT
if any input isnull
. - Throws:
BusinessCalendar.InvalidDateException
- if the dates are not in the valid range
-
businessDates
public LocalDate[] businessDates(LocalDate start, LocalDate end, boolean startInclusive, boolean endInclusive) Returns the business dates in a given range.- Parameters:
start
- start of a time rangeend
- end of a time rangestartInclusive
- true to includestart
in the result; false to excludestart
endInclusive
- true to includeend
in the result; false to excludeend
- Returns:
- business dates between
start
andend
.null
if any input isnull
. - Throws:
BusinessCalendar.InvalidDateException
- if the dates are not in the valid range
-
businessDates
public String[] businessDates(String start, String end, boolean startInclusive, boolean endInclusive) Returns the business dates in a given range.- Parameters:
start
- start of a time rangeend
- end of a time rangestartInclusive
- true to includestart
in the result; false to excludestart
endInclusive
- true to includeend
in the result; false to excludeend
- Returns:
- business dates between
start
andend
.null
if any input isnull
. - Throws:
BusinessCalendar.InvalidDateException
- if the dates are not in the valid rangeDateTimeUtils.DateTimeParseException
- if the string cannot be parsed
-
businessDates
public LocalDate[] businessDates(ZonedDateTime start, ZonedDateTime end, boolean startInclusive, boolean endInclusive) Returns the business dates in a given range.- Parameters:
start
- start of a time rangeend
- end of a time rangestartInclusive
- true to includestart
in the result; false to excludestart
endInclusive
- true to includeend
in the result; false to excludeend
- Returns:
- business dates between
start
andend
.null
if any input isnull
. - Throws:
BusinessCalendar.InvalidDateException
- if the dates are not in the valid range
-
businessDates
public LocalDate[] businessDates(Instant start, Instant end, boolean startInclusive, boolean endInclusive) Returns the business dates in a given range.- Parameters:
start
- start of a time rangeend
- end of a time rangestartInclusive
- true to includestart
in the result; false to excludestart
endInclusive
- true to includeend
in the result; false to excludeend
- Returns:
- business dates between
start
andend
.null
if any input isnull
. - Throws:
BusinessCalendar.InvalidDateException
- if the dates are not in the valid range
-
businessDates
Returns the business dates in a given range.- Parameters:
start
- start of a time rangeend
- end of a time range- Returns:
- business dates between
start
andend
; includingstart
andend
.null
if any input isnull
. - Throws:
BusinessCalendar.InvalidDateException
- if the dates are not in the valid range
-
businessDates
Returns the business dates in a given range.- Parameters:
start
- start of a time rangeend
- end of a time range- Returns:
- business dates between
start
andend
; includingstart
andend
.null
if any input isnull
. - Throws:
BusinessCalendar.InvalidDateException
- if the dates are not in the valid rangeDateTimeUtils.DateTimeParseException
- if the string cannot be parsed
-
businessDates
Returns the business dates in a given range.- Parameters:
start
- start of a time rangeend
- end of a time range- Returns:
- business dates between
start
andend
; includingstart
andend
.null
if any input isnull
. - Throws:
BusinessCalendar.InvalidDateException
- if the dates are not in the valid range
-
businessDates
Returns the business dates in a given range.- Parameters:
start
- start of a time rangeend
- end of a time range- Returns:
- business dates between
start
andend
; includingstart
andend
.null
if any input isnull
. - Throws:
BusinessCalendar.InvalidDateException
- if the dates are not in the valid range
-
nonBusinessDates
public LocalDate[] nonBusinessDates(LocalDate start, LocalDate end, boolean startInclusive, boolean endInclusive) Returns the non-business dates in a given range.- Parameters:
start
- start of a time rangeend
- end of a time rangestartInclusive
- true to includestart
in the result; false to excludestart
endInclusive
- true to includeend
in the result; false to excludeend
- Returns:
- non-business dates between
start
andend
.null
if any input isnull
. - Throws:
BusinessCalendar.InvalidDateException
- if the dates are not in the valid range
-
nonBusinessDates
public String[] nonBusinessDates(String start, String end, boolean startInclusive, boolean endInclusive) Returns the non-business dates in a given range.- Parameters:
start
- start of a time rangeend
- end of a time rangestartInclusive
- true to includestart
in the result; false to excludestart
endInclusive
- true to includeend
in the result; false to excludeend
- Returns:
- non-business dates between
start
andend
.null
if any input isnull
. - Throws:
BusinessCalendar.InvalidDateException
- if the dates are not in the valid rangeDateTimeUtils.DateTimeParseException
- if the string cannot be parsed
-
nonBusinessDates
public LocalDate[] nonBusinessDates(ZonedDateTime start, ZonedDateTime end, boolean startInclusive, boolean endInclusive) Returns the non-business dates in a given range.- Parameters:
start
- start of a time rangeend
- end of a time rangestartInclusive
- true to includestart
in the result; false to excludestart
endInclusive
- true to includeend
in the result; false to excludeend
- Returns:
- non-business dates between
start
andend
.null
if any input isnull
. - Throws:
BusinessCalendar.InvalidDateException
- if the dates are not in the valid range
-
nonBusinessDates
public LocalDate[] nonBusinessDates(Instant start, Instant end, boolean startInclusive, boolean endInclusive) Returns the non-business dates in a given range.- Parameters:
start
- start of a time rangeend
- end of a time rangestartInclusive
- true to includestart
in the result; false to excludestart
endInclusive
- true to includeend
in the result; false to excludeend
- Returns:
- non-business dates between
start
andend
.null
if any input isnull
. - Throws:
BusinessCalendar.InvalidDateException
- if the dates are not in the valid range
-
nonBusinessDates
Returns the non-business dates in a given range.- Parameters:
start
- start of a time rangeend
- end of a time range- Returns:
- non-business dates between
start
andend
; includingstart
andend
.null
if any input isnull
. - Throws:
BusinessCalendar.InvalidDateException
- if the dates are not in the valid range
-
nonBusinessDates
Returns the non-business dates in a given range.- Parameters:
start
- start of a time rangeend
- end of a time range- Returns:
- non-business dates between
start
andend
; includingstart
andend
.null
if any input isnull
. - Throws:
BusinessCalendar.InvalidDateException
- if the dates are not in the valid rangeDateTimeUtils.DateTimeParseException
- if the string cannot be parsed
-
nonBusinessDates
Returns the non-business dates in a given range.- Parameters:
start
- start of a time rangeend
- end of a time range- Returns:
- non-business dates between
start
andend
; includingstart
andend
.null
if any input isnull
. - Throws:
BusinessCalendar.InvalidDateException
- if the dates are not in the valid range
-
nonBusinessDates
Returns the non-business dates in a given range.- Parameters:
start
- start of a time rangeend
- end of a time range- Returns:
- non-business dates between
start
andend
; includingstart
andend
.null
if any input isnull
. - Throws:
BusinessCalendar.InvalidDateException
- if the dates are not in the valid range
-
diffBusinessNanos
Returns the amount of business time in nanoseconds between two times.- Parameters:
start
- start of a time rangeend
- end of a time range- Returns:
- the amount of business time in nanoseconds between
start
andend
.QueryConstants.NULL_LONG
if any input isnull
. - Throws:
BusinessCalendar.InvalidDateException
- if the dates are not in the valid range
-
diffBusinessNanos
Returns the amount of business time in nanoseconds between two times.- Parameters:
start
- start of a time rangeend
- end of a time range- Returns:
- the amount of business time in nanoseconds between
start
andend
.QueryConstants.NULL_LONG
if any input isnull
. - Throws:
BusinessCalendar.InvalidDateException
- if the dates are not in the valid range
-
diffNonBusinessNanos
Returns the amount of non-business time in nanoseconds between two times.- Parameters:
start
- start of a time rangeend
- end of a time range- Returns:
- the amount of nonbusiness time in nanoseconds between
start
andend
.QueryConstants.NULL_LONG
if any input isnull
. - Throws:
BusinessCalendar.InvalidDateException
- if the dates are not in the valid range
-
diffNonBusinessNanos
Returns the amount of non-business time in nanoseconds between two times.- Parameters:
start
- start of a time rangeend
- end of a time range- Returns:
- the amount of non-business time in nanoseconds between
start
andend
.QueryConstants.NULL_LONG
if any input isnull
. - Throws:
BusinessCalendar.InvalidDateException
- if the dates are not in the valid range
-
diffBusinessDuration
Returns the amount of business time between two times.- Parameters:
start
- start of a time rangeend
- end of a time range- Returns:
- the amount of business time between
start
andend
.null
if any input isnull
. - Throws:
BusinessCalendar.InvalidDateException
- if the dates are not in the valid range
-
diffBusinessDuration
Returns the amount of business time between two times.- Parameters:
start
- start of a time rangeend
- end of a time range- Returns:
- the amount of business time between
start
andend
.null
if any input isnull
. - Throws:
BusinessCalendar.InvalidDateException
- if the dates are not in the valid range
-
diffNonBusinessDuration
Returns the amount of non-business time between two times.- Parameters:
start
- start of a time rangeend
- end of a time range- Returns:
- the amount of non-business time between
start
andend
.null
if any input isnull
. - Throws:
BusinessCalendar.InvalidDateException
- if the dates are not in the valid range
-
diffNonBusinessDuration
Returns the amount of non-business time between two times.- Parameters:
start
- start of a time rangeend
- end of a time range- Returns:
- the amount of non-business time between
start
andend
.null
if any input isnull
. - Throws:
BusinessCalendar.InvalidDateException
- if the dates are not in the valid range
-
diffBusinessDays
Returns the amount of business time in standard business days between two times.- Parameters:
start
- start of a time rangeend
- end of a time range- Returns:
- the amount of business time in standard business days between
start
andend
.QueryConstants.NULL_DOUBLE
if any input isnull
. - Throws:
BusinessCalendar.InvalidDateException
- if the dates are not in the valid range
-
diffBusinessDays
Returns the amount of business time in standard business days between two times.- Parameters:
start
- start of a time rangeend
- end of a time range- Returns:
- the amount of business time in standard business days between
start
andend
.QueryConstants.NULL_DOUBLE
if any input isnull
. - Throws:
BusinessCalendar.InvalidDateException
- if the dates are not in the valid range
-
diffBusinessYears
Returns the number of business years betweenstart
andend
.- Parameters:
start
- start; if null, return nullend
- end; if null, return null- Returns:
- the amount of business time in business years between the
start
andend
.QueryConstants.NULL_DOUBLE
if any input isnull
. - Throws:
BusinessCalendar.InvalidDateException
- if the dates are not in the valid range
-
diffBusinessYears
Returns the number of business years betweenstart
andend
.- Parameters:
start
- start; if null, return nullend
- end; if null, return null- Returns:
- the amount of business time in business years between the
start
andend
.QueryConstants.NULL_DOUBLE
if any input isnull
. - Throws:
BusinessCalendar.InvalidDateException
- if the dates are not in the valid range
-
plusBusinessDays
Adds a specified number of business days to an input date. Adding negative days is equivalent to subtracting days.- Parameters:
date
- datedays
- number of days to add.- Returns:
days
business days afterdate
. null} ifdate
is not a business day anddays
is zero.null
if inputs arenull
orQueryConstants.NULL_INT
.- Throws:
BusinessCalendar.InvalidDateException
- if the date is not in the valid range
-
plusBusinessDays
Adds a specified number of business days to an input date. Adding negative days is equivalent to subtracting days.- Parameters:
date
- datedays
- number of days to add.- Returns:
days
business days afterdate
.null
ifdate
is not a business day anddays
is zero.null
if inputs arenull
orQueryConstants.NULL_INT
.- Throws:
BusinessCalendar.InvalidDateException
- if the date is not in the valid rangeDateTimeUtils.DateTimeParseException
- if the string cannot be parsed
-
plusBusinessDays
Adds a specified number of business days to an input time. Adding negative days is equivalent to subtracting days.Day additions are not always 24 hours. The resultant time will have the same local time as the input time, as determined by the calendar's time zone. This accounts for Daylight Savings Time. For example, 2023-11-05 has a daylight savings time adjustment, so '2023-11-04T14:00 ET' plus 1 day will result in '2023-11-05T15:00 ET', which is a 25-hour difference.
- Parameters:
time
- timedays
- number of days to add.- Returns:
days
business days aftertime
.null
iftime
is not a business day anddays
is zero.null
if inputs arenull
orQueryConstants.NULL_INT
.- Throws:
BusinessCalendar.InvalidDateException
- if the date is not in the valid range
-
plusBusinessDays
Adds a specified number of business days to an input time. Adding negative days is equivalent to subtracting days.Day additions are not always 24 hours. The resultant time will have the same local time as the input time, as determined by the calendar's time zone. This accounts for Daylight Savings Time. For example, 2023-11-05 has a daylight savings time adjustment, so '2023-11-04T14:00 ET' plus 1 day will result in '2023-11-05T15:00 ET', which is a 25-hour difference.
The resultant time will have the same time zone as the calendar. This could be different than the time zone of the input
ZonedDateTime
.- Parameters:
time
- timedays
- number of days to add.- Returns:
days
business days aftertime
.null
iftime
is not a business day anddays
is zero.null
if inputs arenull
orQueryConstants.NULL_INT
.- Throws:
BusinessCalendar.InvalidDateException
- if the date is not in the valid range
-
minusBusinessDays
Subtracts a specified number of business days from an input date. Subtracting negative days is equivalent to adding days.- Parameters:
date
- datedays
- number of days to add.- Returns:
days
business days beforedate
.null
ifdate
is not a business day anddays
is zero.null
if inputs arenull
orQueryConstants.NULL_INT
.- Throws:
BusinessCalendar.InvalidDateException
- if the date is not in the valid range
-
minusBusinessDays
Subtracts a specified number of business days from an input date. Subtracting negative days is equivalent to adding days.- Parameters:
date
- datedays
- number of days to add.- Returns:
days
business days beforedate
.null
ifdate
is not a business day anddays
is zero.null
if inputs arenull
orQueryConstants.NULL_INT
.- Throws:
BusinessCalendar.InvalidDateException
- if the date is not in the valid rangeDateTimeUtils.DateTimeParseException
- if the string cannot be parsed
-
minusBusinessDays
Subtracts a specified number of business days from an input time. Subtracting negative days is equivalent to adding days.Day subtractions are not always 24 hours. The resultant time will have the same local time as the input time, as determined by the calendar's time zone. This accounts for Daylight Savings Time. For example, 2023-11-05 has a daylight savings time adjustment, so '2023-11-04T14:00 ET' plus 1 day will result in '2023-11-05T15:00 ET', which is a 25-hour difference.
- Parameters:
time
- timedays
- number of days to add.- Returns:
days
business days beforetime
.null
iftime
is not a business day anddays
is zero.null
if inputs arenull
orQueryConstants.NULL_INT
.- Throws:
BusinessCalendar.InvalidDateException
- if the date is not in the valid range
-
minusBusinessDays
Subtracts a specified number of business days from an input time. Subtracting negative days is equivalent to adding days.Day subtraction are not always 24 hours. The resultant time will have the same local time as the input time, as determined by the calendar's time zone. This accounts for Daylight Savings Time. For example, 2023-11-05 has a daylight savings time adjustment, so '2023-11-04T14:00 ET' plus 1 day will result in '2023-11-05T15:00 ET', which is a 25-hour difference.
The resultant time will have the same time zone as the calendar. This could be different than the time zone of the input
ZonedDateTime
.- Parameters:
time
- timedays
- number of days to add.- Returns:
days
business days beforetime
.null
iftime
is not a business day anddays
is zero.null
if inputs arenull
orQueryConstants.NULL_INT
.- Throws:
BusinessCalendar.InvalidDateException
- if the date is not in the valid range
-
plusNonBusinessDays
Adds a specified number of non-business days to an input date. Adding negative days is equivalent to subtracting days.- Parameters:
date
- datedays
- number of days to add.- Returns:
days
non-business days afterdate
.null
ifdate
is not a business day anddays
is zero.null
if inputs arenull
orQueryConstants.NULL_INT
.- Throws:
BusinessCalendar.InvalidDateException
- if the date is not in the valid range
-
plusNonBusinessDays
Adds a specified number of non-business days to an input date. Adding negative days is equivalent to subtracting days.- Parameters:
date
- datedays
- number of days to add.- Returns:
days
non-business days afterdate
.null
ifdate
is not a business day anddays
is zero.null
if inputs arenull
orQueryConstants.NULL_INT
.- Throws:
BusinessCalendar.InvalidDateException
- if the date is not in the valid rangeDateTimeUtils.DateTimeParseException
- if the string cannot be parsed
-
plusNonBusinessDays
Adds a specified number of non-business days to an input time. Adding negative days is equivalent to subtracting days.Day additions are not always 24 hours. The resultant time will have the same local time as the input time, as determined by the calendar's time zone. This accounts for Daylight Savings Time. For example, 2023-11-05 has a daylight savings time adjustment, so '2023-11-04T14:00 ET' plus 1 day will result in '2023-11-05T15:00 ET', which is a 25-hour difference.
The resultant time will have the same time zone as the calendar. This could be different than the time zone of the input
ZonedDateTime
.- Parameters:
time
- timedays
- number of days to add.- Returns:
days
non-business days aftertime
.null
iftime
is not a business day anddays
is zero.null
if inputs arenull
orQueryConstants.NULL_INT
.- Throws:
BusinessCalendar.InvalidDateException
- if the date is not in the valid range
-
plusNonBusinessDays
Adds a specified number of non-business days to an input time. Adding negative days is equivalent to subtracting days.Day additions are not always 24 hours. The resultant time will have the same local time as the input time, as determined by the calendar's time zone. This accounts for Daylight Savings Time. For example, 2023-11-05 has a daylight savings time adjustment, so '2023-11-04T14:00 ET' plus 1 day will result in '2023-11-05T15:00 ET', which is a 25-hour difference.
The resultant time will have the same time zone as the calendar. This could be different than the time zone of the input
ZonedDateTime
.- Parameters:
time
- timedays
- number of days to add.- Returns:
days
non-business days aftertime
.null
iftime
is not a business day anddays
is zero.null
if inputs arenull
orQueryConstants.NULL_INT
.- Throws:
BusinessCalendar.InvalidDateException
- if the date is not in the valid range
-
minusNonBusinessDays
Subtracts a specified number of non-business days to an input date. Subtracting negative days is equivalent to adding days.- Parameters:
date
- datedays
- number of days to add.- Returns:
days
non-business days beforedate
.null
ifdate
is a business day anddays
is zero.null
if inputs arenull
orQueryConstants.NULL_INT
.- Throws:
BusinessCalendar.InvalidDateException
- if the date is not in the valid range
-
minusNonBusinessDays
Subtracts a specified number of non-business days to an input date. Subtracting negative days is equivalent to adding days.- Parameters:
date
- datedays
- number of days to add.- Returns:
days
non-business days beforedate
.null
ifdate
is a business day anddays
is zero.- Throws:
BusinessCalendar.InvalidDateException
- if the date is not in the valid rangeDateTimeUtils.DateTimeParseException
- if the string cannot be parsed
-
minusNonBusinessDays
Subtracts a specified number of non-business days to an input time. Subtracting negative days is equivalent to adding days.Day subtractions are not always 24 hours. The resultant time will have the same local time as the input time, as determined by the calendar's time zone. This accounts for Daylight Savings Time. For example, 2023-11-05 has a daylight savings time adjustment, so '2023-11-04T14:00 ET' plus 1 day will result in '2023-11-05T15:00 ET', which is a 25-hour difference.
- Parameters:
time
- timedays
- number of days to add.- Returns:
days
non-business days beforetime
.null
iftime
is a business day anddays
is zero.null
if inputs arenull
orQueryConstants.NULL_INT
.- Throws:
BusinessCalendar.InvalidDateException
- if the date is not in the valid range
-
minusNonBusinessDays
Subtracts a specified number of non-business days to an input time. Subtracting negative days is equivalent to adding days.Day subtractions are not always 24 hours. The resultant time will have the same local time as the input time, as determined by the calendar's time zone. This accounts for Daylight Savings Time. For example, 2023-11-05 has a daylight savings time adjustment, so '2023-11-04T14:00 ET' plus 1 day will result in '2023-11-05T15:00 ET', which is a 25-hour difference.
The resultant time will have the same time zone as the calendar. This could be different than the time zone of the input
ZonedDateTime
.- Parameters:
time
- timedays
- number of days to add.- Returns:
days
non-business days beforetime
.null
iftime
is a business day anddays
is zero.null
if inputs arenull
orQueryConstants.NULL_INT
.- Throws:
BusinessCalendar.InvalidDateException
- if the date is not in the valid range
-
futureBusinessDate
Adds a specified number of business days to the current date. Adding negative days is equivalent to subtracting days.- Parameters:
days
- number of days to add.- Returns:
days
business days after the current date.null
if the current date is not a business day anddays
is zero.null
if input isQueryConstants.NULL_INT
.- Throws:
BusinessCalendar.InvalidDateException
- if the date is not in the valid range
-
pastBusinessDate
Subtracts a specified number of business days from the current date. Subtracting negative days is equivalent to adding days.- Parameters:
days
- number of days to subtract.- Returns:
days
business days before the current date.null
if the current date is not a business day anddays
is zero.null
if input isQueryConstants.NULL_INT
.- Throws:
BusinessCalendar.InvalidDateException
- if the date is not in the valid range
-
futureNonBusinessDate
Adds a specified number of non-business days to the current date. Adding negative days is equivalent to subtracting days.- Parameters:
days
- number of days to add.- Returns:
days
non-business days after the current date.null
if the current date is a business day anddays
is zero.null
if input isQueryConstants.NULL_INT
.- Throws:
BusinessCalendar.InvalidDateException
- if the date is not in the valid range
-
pastNonBusinessDate
Subtracts a specified number of non-business days to the current date. Subtracting negative days is equivalent to adding days.- Parameters:
days
- number of days to subtract.- Returns:
days
non-business days before the current date.null
if the current date is a business day anddays
is zero.null
if input isQueryConstants.NULL_INT
.- Throws:
BusinessCalendar.InvalidDateException
- if the date is not in the valid range
-