Jollyday is a java library to query public holidays. Currently, we support over 70 countries.
Thanks to @svendiedrichsen who started jollyday!
Jollyday is based on Java 11 and can be used directly as dependency via maven or gradle e.g. The calculation basis of the public holidays for each country is based on a xml file and will be mapped via Jakarta XML Binding. If you already use one of these libraries in your project than just use the specific jollyday dependency.
Maven (click to expand)
<dependency>
<groupId>de.focus-shift</groupId>
<artifactId>jollyday-jaxb</artifactId>
<version>${version}</version>
</dependency>
Gradle (click to expand)
implementation group: 'de.focus-shift', name: 'jollyday-jaxb', version: '${version}'
Retrieve public holidays for a year (click to expand)
Returns all german public holidays in 2022
final HolidayManager holidayManager = HolidayManager.getInstance();
final Set<Holiday> holidays = holidayManager.getHolidays(2022, "de");
Retrieve public holidays for a period of days (click to expand)
Returns all german public holidays from the 15th of april in 2022 until the 31st of may in 2023
final HolidayManager holidayManager = HolidayManager.getInstance();
final Set<Holiday> holidays = holidayManager.getHolidays(LocalDate.of(2022, 4, 15), LocalDate.of(2023, 5, 31), "de");
Check if a specific date is a public holiday (click to expand)
Returns true or false if a date is a public holidays in germany.
final HolidayManager holidayManager = HolidayManager.getInstance();
final boolean isHoliday = holidayManager.isHoliday(LocalDate.of(2022, 6, 6), "de");
Returns true or false if a date is a public holidays in Baden-Württemberg in germany.
final HolidayManager holidayManager = HolidayManager.getInstance();
final boolean isHoliday = holidayManager.isHoliday(LocalDate.of(2022, 6, 6), "de", "bw");
If you want to support us at the development on jollyday than take a look at Contributing to jollyday. If you have any kind of questions please go to Discussions and see if there are already answers and if not please open a discussion with your question. If you want to raise an issue or bug you can create a new issue
git clone [email protected]:focus-shift/jollyday.git
./mvnw clean verify
or for Windows user:
./mvnw.cmd clean verify