Skip to content

Java library for determining whether a given day is a banking holiday

License

Notifications You must be signed in to change notification settings

lodenrogue/bank-holidays

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Bank Holidays

Java library for determining whether a given day is a bank holiday

Usage

LocalDate newYears = LocalDate.of(2022, 1, 1);
Bank bank = USBankFactory.createBank();
boolean isHoliday = bank.isHoliday(newYears);

Using an Existing Bank

// This bank comes packaged with the Federal Reserve Bank holidays 
Bank bank = USBankFactory.createBank();

Creating a Holiday

The Holiday interface can be used to create a new Holiday

class NewHoliday implements Holiday {
    
    @Override
    public boolean isHoliday(LocalDate day) {
        // Your logic for determining if 
        // the given day is a holiday goes here
        // ...
    }
}

Creating a New Bank

List<Holiday> holidays = List.of(aHoliday, anotherHoliday);
Bank bank = new Bank(holidays);

Existing Holidays

  • USChristmas
  • USColumbusDay
  • USIndependenceDay
  • USJuneteenth
  • USLaborDay
  • USMartinLutherKingDay
  • USMemorialDay
  • USNewYearsDay
  • USPresidentsDay
  • USThanksgiving
  • USVeteransDay

Contributing

Please feel free to submit a pull request with new holidays and banks

About

Java library for determining whether a given day is a banking holiday

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages