Business Calendars API
BusinessCalendarRepository
BusinessCalendarRepository
defines convenient methods to fetch business calendars configured in the system.
-
The
getBusinessCalendarByCode()
method returns the business calendar with provided code. -
The
getAllBusinessCalendars()
method returns all business calendars configured in the system.
BusinessCalendar
BusinessCalendar
provides methods for checking if a given date and time are working hours, and for arithmetic operations with date and time considering the business hours defined by the calendar:
-
The
isBusinessDay(LocalDate date)
method checks if provided date belongs to business days. -
The
isBusinessTime(LocalDateTime dateTime)
method checks if provided date and time belongs to business time. -
The
plus(LocalDate date, int daysToAdd)
method calculates date as a given date plusdaysToAdd
working days. -
The
minus(LocalDate date, int daysToSubtract)
method calculates date as a given date minusdaysToSubtract
working days. -
The
plus(LocalDateTime dateTime, int hoursToAdd)
method calculates date and time as givendateTime
plus provided working hours. -
The
minus(LocalDateTime dateTime, int hoursToSubtract)
method calculates date and time as givendateTime
minus provided working hours. -
The
plus(LocalDateTime dateTime, Duration duration)
method calculates date and time as given date and time plus some duration. -
The
minus(LocalDateTime dateTime, Duration duration)
method calculates date and time as given date and time minus some duration.