java.lang.Object
one.cafebabe.businesscalendar4j.BusinessCalendar
Java class representing business calendar
-
フィールドの概要
フィールド修飾子とタイプフィールド説明Fixed algorithm to close on Saturdays and Sundaysstatic final JapanPredefined holidays in Japanstatic final UnitedStatesPredefined holidays in the United States -
メソッドの概要
修飾子とタイプメソッド説明Dump holidays and business days in the specified periodDump holidays and business days in the specified period@NotNull LocalDateReturns the first business day after today@NotNull LocalDatefirstBusinessDay(@NotNull LocalDate date) Returns the first business day on or after a specific date@NotNull HolidayReturns the first holiday after today@NotNull HolidayfirstHoliday(@NotNull LocalDate date) Returns the first holiday on or after a specific dategetBusinessDaysBetween(@NotNull LocalDate from, @NotNull LocalDate to) Returns business days between specified period@NotNull List<BusinessHourSlot>getBusinessHourSlots(@NotNull LocalDate date) Returns a list of BusinessHourSlot on a specific date@Nullable HolidaygetHoliday(@NotNull LocalDate date) Returns a Holiday on the specified dategetHolidaysBetween(@NotNull LocalDate from, @NotNull LocalDate to) Returns holidays between specified periodbooleanTest if today is a business daybooleanisBusinessDay(@NotNull LocalDate date) Test if the specified date is a business daybooleanTest if it's during business hoursbooleanisBusinessHour(@NotNull LocalDateTime dateTime) Test if specified time is during business hoursbooleanTest if today is a holidaybooleanTest if the specified date is a holiday@NotNull LocalDateReturns the last business day by today@NotNull LocalDatelastBusinessDay(@NotNull LocalDate date) Returns the last business day by a specific date@NotNull LocalDateTimelastBusinessHourEnd(@NotNull LocalDateTime when) Returns when last business hours ended@NotNull LocalDateTimelastBusinessHourStart(@NotNull LocalDateTime when) Returns when last business hours started@NotNull HolidayReturns the last holiday by today@NotNull HolidaylastHoliday(@NotNull LocalDate date) Returns the last holiday by a specific datestatic @NotNull BusinessCalendarBuildercreates a new builder instance@NotNull LocalDateTimenextBusinessHourEnd(@NotNull LocalDateTime when) Returns when next business hours end@NotNull LocalDateTimenextBusinessHourStart(@NotNull LocalDateTime when) Returns when next business hours start
-
フィールド詳細
-
UNITED_STATES
Predefined holidays in the United States -
JAPAN
Predefined holidays in Japan -
CLOSED_ON_SATURDAYS_AND_SUNDAYS
Fixed algorithm to close on Saturdays and Sundays- 導入されたバージョン:
- 1.5
-
-
メソッドの詳細
-
newBuilder
creates a new builder instance- 戻り値:
- builder
-
isHoliday
Test if the specified date is a holiday- パラメータ:
date- date- 戻り値:
- true if the specified date is a holiday
-
isHoliday
public boolean isHoliday()Test if today is a holiday- 戻り値:
- true if the specified date is a holiday
- 導入されたバージョン:
- 1.3
-
isBusinessDay
Test if the specified date is a business day- パラメータ:
date- date- 戻り値:
- true if the specified date is a business day
-
isBusinessDay
public boolean isBusinessDay()Test if today is a business day- 戻り値:
- true if the specified date is a business day
- 導入されたバージョン:
- 1.3
-
isBusinessHour
Test if specified time is during business hours- パラメータ:
dateTime- time- 戻り値:
- true is specified time is during business hours
- 導入されたバージョン:
- 1.8
-
isBusinessHour
public boolean isBusinessHour()Test if it's during business hours- 戻り値:
- true is it's during business hours
- 導入されたバージョン:
- 1.8
-
getBusinessHourSlots
@NotNull public @NotNull List<BusinessHourSlot> getBusinessHourSlots(@NotNull @NotNull LocalDate date) Returns a list of BusinessHourSlot on a specific date- パラメータ:
date- date- 戻り値:
- list of business hour slots on a specified date, or an empty list if the specified date is a holiday
- 導入されたバージョン:
- 1.9
-
lastBusinessHourEnd
Returns when last business hours ended- パラメータ:
when- origin- 戻り値:
- the time when last business hours ended
- 導入されたバージョン:
- 1.8
-
nextBusinessHourEnd
Returns when next business hours end- パラメータ:
when- origin- 戻り値:
- the time when next business hours end
- 導入されたバージョン:
- 1.8
-
lastBusinessHourStart
Returns when last business hours started- パラメータ:
when- origin- 戻り値:
- the time when last business hours started
- 導入されたバージョン:
- 1.8
-
nextBusinessHourStart
Returns when next business hours start- パラメータ:
when- origin- 戻り値:
- the time when next business hours start
- 導入されたバージョン:
- 1.8
-
getHoliday
Returns a Holiday on the specified date- パラメータ:
date- date- 戻り値:
- Holiday
-
lastBusinessDay
Returns the last business day by a specific date- パラメータ:
date- specific date- 戻り値:
- last business day by the specified date
-
lastBusinessDay
Returns the last business day by today- 戻り値:
- last business day by the specified date
- 導入されたバージョン:
- 1.4
-
firstBusinessDay
Returns the first business day on or after a specific date- パラメータ:
date- specific date- 戻り値:
- first business day on and after the specified date
-
firstBusinessDay
Returns the first business day after today- 戻り値:
- first business day after today
- 導入されたバージョン:
- 1.4
-
lastHoliday
Returns the last holiday by a specific date- パラメータ:
date- specific date- 戻り値:
- last holiday by the specified date
-
lastHoliday
Returns the last holiday by today- 戻り値:
- last holiday by today
- 導入されたバージョン:
- 1.4
-
firstHoliday
Returns the first holiday on or after a specific date- パラメータ:
date- specific date- 戻り値:
- first holiday on or after the specified date
-
firstHoliday
Returns the first holiday after today- 戻り値:
- first holiday on or after the specified date
-
getHolidaysBetween
@NotNull public @NotNull List<Holiday> getHolidaysBetween(@NotNull @NotNull LocalDate from, @NotNull @NotNull LocalDate to) Returns holidays between specified period- パラメータ:
from- from date (inclusive)to- to date (inclusive)- 戻り値:
- List of holidays between the specified period
-
getBusinessDaysBetween
@NotNull public @NotNull List<LocalDate> getBusinessDaysBetween(@NotNull @NotNull LocalDate from, @NotNull @NotNull LocalDate to) Returns business days between specified period- パラメータ:
from- from date (inclusive)to- to date (inclusive)- 戻り値:
- List of business days between the specified period
- 導入されたバージョン:
- 1.15
-
dump
Dump holidays and business days in the specified period- パラメータ:
from- from date (inclusive)to- to date (inclusive)- 戻り値:
- dumped information about holidays and business days in the specified period
- 導入されたバージョン:
- 1.15
-
dump
public String dump(@NotNull @NotNull LocalDate from, @NotNull @NotNull LocalDate to, String dateFormat) Dump holidays and business days in the specified period- パラメータ:
from- from date (inclusive)to- to date (inclusive)dateFormat- date format pattern- 戻り値:
- dumped information about holidays and business days in the specified period
- 導入されたバージョン:
- 1.15
-