Business Calendars API

BusinessCalendarRepository

BusinessCalendarRepository defines convenient methods to fetch business calendars configured in the system.

  • The getBusinessCalendarByCode() method returns the business calendar with the 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 is within working hours, and for arithmetic operations with date and time considering the business hours defined by the calendar:

  • isBusinessDay(LocalDate date) checks if the provided date is a business day.

  • isBusinessTime(LocalDateTime dateTime) checks if the provided date and time belong to business time.

  • plus(LocalDate date, int daysToAdd) returns a copy of the provided date with the specified number of business days added.

  • minus(LocalDate date, int daysToSubtract) returns a copy of the provided date with the specified number of business days subtracted.

  • plus(LocalDateTime dateTime, int hoursToAdd) returns a copy of the provided date and time with the specified number of business hours added.

  • minus(LocalDateTime dateTime, int hoursToSubtract) returns a copy of the provided date and time with the specified number of business hours subtracted.

  • plus(LocalDateTime dateTime, Duration duration) returns a copy of the provided date-time with the specified duration of working time added.

  • minus(LocalDateTime dateTime, Duration duration) returns a copy of the provided date-time with the specified duration of working time subtracted.