📅 Libera.Date.Api Documentation
🚀 Why Choose Libera.Date.Api?
Time is money, but calculating it correctly is harder than it looks. Libera.Date.Api is the ultimate solution for developers building HR systems, logistics platforms, and financial applications.
Stop wrestling with leap years, timezone anomalies, and shifting public holidays. Powered by the industry-standard NodaTime engine and our proprietary Working Days System, this API delivers:
- Global Awareness: Built-in support for major economies (US, UK, DE, PL, FR) with accurate holiday calendars.
- Business Logic Ready: Instantly calculate SLAs and delivery dates by excluding weekends and holidays.
- Precision Engineering: Get exact durations down to the minute, or broad calendar period differences (Years/Months/Days).
- Smart Fallbacks: Automatically find the next available working day when deadlines hit a holiday.
PL Jeśli jesteś zainteresowany(a) użyciem API, skontaktuj się proszę przez formularz kontaktowy: https://wroclawprogramowanie/contact-form/
EN If you’re interested in using the API, please contact us via the contact form: https://wroclawprogramowanie/contact-form/
🔐 Authentication
All requests must be authenticated. You can use either an API Key or a Bearer Token.
| Method | Header Name | Value Format |
|---|---|---|
| API Key | X-Api-Key | YOUR_API_KEY |
| Bearer Token | Authorization | Bearer YOUR_JWT_TOKEN |
📡 Endpoints Overview
Base URL: http://localhost:8080 (adjust to your deployment)
1. Date Calculator
🔹 Calculate Period Between Dates
Calculates the calendar difference (Years, Months, Days).
- URL:
/date-calculator/period/date - Method:
GET - Parameters:
Start(query, required): Start date (ISO 8601, e.g.,2024-01-01)End(query, required): End date (ISO 8601, e.g.,2025-03-15)
Request:
curl -X GET "http://localhost:8080/date-calculator/period/date?Start=2024-01-01&End=2025-03-15" \
-H "X-Secret: TEST_SECRET"
Response (200 OK):
{
"years": 1,
"months": 2,
"days": 14,
"description": "1 year, 2 months, 14 days"
}
🔹 Calculate Time Duration
Calculates the duration in total days, hours, and minutes.
URL:
/date-calculator/period/timeMethod:
GETParameters:
Start (query): 2024-01-01T12:00:00
End (query): 2024-01-05T18:30:00
Request:
curl -X GET "<http://localhost:8080/date-calculator/period/time?Start=2024-01-01T12:00:00&End=2024-01-05T18:30:00>" \
-H "X-Secret: TEST_SECRET"
Response (200 OK):
{
"totalDays": 4,
"hours": 102,
"minutes": 6150
}
2. Working Days & Holidays
Advanced logic for business days, weekends, and public holidays.
Path Parameter: {countryCode} (e.g., PL, US, DE, UK).
🔹 Check Working Day & Find Nearest
Checks if a specific date is a working day. If it is not (due to weekend or holiday), it returns the date of the next immediate working day.
- URL:
GET /workingdays/{countryCode}/is-working-day - Parameters:
Date(required, YYYY-MM-DD)
Example Request (Checking Christmas Day in US):
bash curl -X GET "http://localhost:8080/workingdays/US/is-working-day?Date=2025-12-25"
Response (200 OK):
json{ "date": "2025-12-25T00:00:00", "isWorkingDay": false, "nearestWorkingDay": "2025-12-26T00:00:00" }
🔹 Get Detailed Non-Working Info
Returns detailed metadata about why a day is not a working day. It distinguishes between weekends (specifying if it’s the 1st or 2nd day of the weekend) and public holidays.
- URL:
GET /workingdays/{countryCode}/non-working-info - Parameters:
Date(required, YYYY-MM-DD)
Example Request:
bash curl -X GET "http://localhost:8080/workingdays/PL/non-working-info?Date=2024-05-01"
Response (200 OK):
json{ "date": "2024-05-01T00:00:00", "isNonWorkingDay": true, "type": "holiday", "weekendDayNumber": null, "holiday": { "englishName": "Labor Day", "localName": "Święto Pracy" } }
🔹 Analyze Range (Working vs. Non-Working)
Generates a comprehensive breakdown of a date range, splitting all dates into “Working” and “Non-Working” lists. Ideal for rendering calendars or Gantt charts.
- URL:
GET /workingdays/{countryCode}/range - Parameters:
Start(required): Range start.End(required): Range end.- Note: Max range is limited by server configuration (default 366 days).
Example Request:
bash curl -X GET "http://localhost:8080/workingdays/US/range?Start=2024-07-03&End=2024-07-05"
Response (200 OK):
json{ "start": "2024-07-03T00:00:00", "end": "2024-07-05T00:00:00", "workingDays": [ { "date": "2024-07-03T00:00:00" }, { "date": "2024-07-05T00:00:00" } ], "nonWorkingDays": [ { "date": "2024-07-04T00:00:00", "type": "holiday", "englishName": "Independence Day", "localName": "Independence Day" } ] }
🔹 Count Working Days
Calculates the number of business days between two dates. (excluding weekends and holidays).
URL:
/workingdays/{countryCode}/countMethod:
GETParameters:
Start (query): 2024-05-01
End (query): 2024-05-10
Request:
curl -X GET "<http://localhost:8080/workingdays/PL/count?Start=2024-05-01&End=2024-05-10>" \
-H "X-Secret: TEST_SECRET"
Response (200 OK):
{
"totalDays": 366,
"workingDays": 253
}
🔹 Get Off-Days Count
Returns the count of non-working days (weekends + holidays).
URL:
/workingdays/{countryCode}/off-daysMethod:
GET
Request:
curl -X GET "<http://localhost:8080/workingdays/PL/off-days?Start=2024-05-01&End=2024-05-10>" \
-H "X-Secret: TEST_SECRET"
Response (200 OK):
{
"totalDays": 366,
"offDays": 113
}
🔹 List Public Holidays
Returns a list of public holidays in the given range.
URL:
/workingdays/{countryCode}/holidaysMethod:
GET
Request:
curl -X GET "<http://localhost:8080/workingdays/PL/holidays?Start=2024-01-01&End=2024-01-10>" \
-H "X-Secret: TEST_SECRET"
Response (200 OK):
[
{
"date": "2024-01-01",
"name": "New Year's Day",
"localName": "Nowy Rok"
},
{
"date": "2024-01-06",
"name": "Epiphany",
"localName": "Święto Trzech Króli"
}
]
🔹 Get Weekends Count
Returns the number of weekend days (Saturdays and Sundays).
URL:
/workingdays/{countryCode}/weekendsMethod:
GET
Request:
curl -X GET "<http://localhost:8080/workingdays/PL/weekends?Start=2024-05-01&End=2024-05-10>" \
-H "X-Secret: TEST_SECRET"
Response (200 OK):
{
"totalDays": 91,
"weekendDaysCount": 26
}
Supported countries
| Code (ISO 3166-1 ALPHA-2) | Country |
|---|---|
| AD | Andorra |
| AE | United Arab Emirates |
| AF | Afghanistan |
| AG | Antigua and Barbuda |
| AI | Anguilla |
| AL | Albania |
| AM | Armenia |
| AO | Angola |
| AQ | Antarctica |
| AR | Argentina |
| AS | American Samoa |
| AT | Austria |
| AU | Australia |
| AW | Aruba |
| AX | Åland Islands |
| AZ | Azerbaijan |
| BA | Bosnia and Herzegovina |
| BB | Barbados |
| BD | Bangladesh |
| BE | Belgium |
| BF | Burkina Faso |
| BG | Bulgaria |
| BH | Bahrain |
| BI | Burundi |
| BJ | Benin |
| BL | Saint Barthélemy |
| BM | Bermuda |
| BN | Brunei Darussalam |
| BO | Bolivia (Plurinational State of) |
| BQ | Bonaire, Sint Eustatius and Saba |
| BR | Brazil |
| BS | Bahamas |
| BT | Bhutan |
| BV | Bouvet Island |
| BW | Botswana |
| BY | Belarus |
| BZ | Belize |
| CA | Canada |
| CC | Cocos (Keeling) Islands |
| CD | Congo (Democratic Republic of the) |
| CF | Central African Republic |
| CG | Congo |
| CH | Switzerland |
| CI | Côte d’Ivoire |
| CK | Cook Islands |
| CL | Chile |
| CM | Cameroon |
| CN | China |
| CO | Colombia |
| CR | Costa Rica |
| CU | Cuba |
| CV | Cabo Verde |
| CW | Curaçao |
| CX | Christmas Island |
| CY | Cyprus |
| CZ | Czech Republic |
| DE | Germany |
| DJ | Djibouti |
| DK | Denmark |
| DM | Dominica |
| DO | Dominican Republic |
| DZ | Algeria |
| EC | Ecuador |
| EE | Estonia |
| EG | Egypt |
| EH | Western Sahara |
| ER | Eritrea |
| ES | Spain |
| ET | Ethiopia |
| FI | Finland |
| FJ | Fiji |
| FK | Falkland Islands (Malvinas) |
| FM | Micronesia (Federated States of) |
| FO | Faroe Islands |
| FR | France |
| GA | Gabon |
| GB | United Kingdom of Great Britain and Northern Ireland |
| GD | Grenada |
| GE | Georgia |
| GF | French Guiana |
| GG | Guernsey |
| GH | Ghana |
| GI | Gibraltar |
| G | Greenland |
| GM | Gambia |
| GN | Guinea |
| GP | Gua deloupe |
| GQ | Equatorial Guinea |
| GR | Greece |
| GS | South Georgia and the South Sandwich Islands |
| GT | Guatemala |
| GU | Guam |
| GW | Guinea -Bissau |
| GY | Guyana |
| HK | Hong Kong |
| HM | Heard Island and McDonald Islands |
| HN | Honduras |
| HR | Croatia |
| HT | Haiti |
| HU | Hungary |
| ID | Indonesia |
| IE | Ireland |
| IL | Israel |
| IM | Isle of Man |
| IN | India |
| IO | British Indian Ocean Territory |
| IQ | Iraq |
| IR | Iran (Islamic Republic of) |
| IS | Iceland |
| IT | Italy |
| JE | Jersey |
| JM | Jamaica |
| JO | Jordan |
| JP | Japan |
| KE | Kenya |
| KG | Kyrgyzstan |
| KH | Cambodia |
| KI | Kiribati |
| KM | Comoros |
| KN | Saint Kitts and Nevis |
| KP | North Korea |
| KR | South Korea |
| KW | Kuwait |
| KY | Cayman Islands |
| KZ | Kazakhstan |
| LA | Laos |
| LB | Lebanon |
| LC | Saint Lucia |
| LI | Liechtenstein |
| LK | Sri Lanka |
| LR | Liberia |
| LS | Lesotho |
| LT | Lithuania |
| LU | Luxembourg |
| LV | Latvia |
| LY | Libya |
| MA | Morocco |
| MC | Monaco |
| MD | Moldova |
| ME | Montenegro |
| MF | Saint Martin (French part) |
| MG | Madagascar |
| MH | Marshall Islands |
| MK | Macedonia |
| ML | Mali |
| MM | Myanmar |
| MN | Mongolia |
| MO | Macao |
| MP | Northern Mariana Islands |
| MQ | Martinique |
| MR | Mauritania |
| MS | Montserrat |
| MT | Malta |
| MU | Mauritius |
| MV | Maldives |
| MW | Malawi |
| MX | Mexico |
| MY | Malaysia |
| MZ | Mozambique |
| NA | Namibia |
| NC | New Caledonia |
| NE | Niger |
| NF | Norfolk Island |
| NG | Nigeria |
| NI | Nicaragua |
| NL | Netherlands |
| NO | Norway |
| NP | Nepal |
| NR | Nauru |
| NU | Niue |
| NZ | New Zealand |
| OM | Oman |
| PA | Panama |
| PE | Peru |
| PF | French Polynesia |
| PG | Papua New Guinea |
| PH | Philippines |
| PK | Pakistan |
| PL | Poland |
| PM | Saint Pierre and Miquelon |
| PN | Pitcairn |
| PR | Puerto Rico |
| PS | Palestine |
| PT | Portugal |
| PW | Palau |
| PY | Paraguay |
| QA | Qatar |
| RE | Réunion |
| RO | Romania |
| RS | Serbia |
| RU | Russian Federation |
| RW | Rwanda |
| SA | Saudi Arabia |
| SB | Solomon Islands |
| SC | Seychelles |
| SD | Sudan |
| SE | Sweden |
| SG | Singapore |
| SH | Saint Helena, Ascension and Tristan da Cunha |
| SI | Slovenia |
| SJ | Svalbard and Jan Mayen |
| SK | Slovakia |
| SL | Sierra Leone |
| SM | San Marino |
| SN | Senegal |
| SO | Somalia |
| SR | Surina me |
| SS | South Sudan |
| ST | Sao Tome and Principe |
| SV | El Salvador |
| SX | Sint Maarten (Dutch part) |
| SY | Syrian Arab Republic |
| SZ | Swaziland |
| TC | Turks and Caicos Islands |
| TD | Chad |
| TF | French Southern Territories |
| TG | Togo |
| TH | Thailand |
| TJ | Tajikistan |
| TK | Tokelau |
| TL | East Timor |
| TM | Turkmenistan |
| TN | Tunisia |
| TO | Tonga |
| TR | Turkey |
| TT | Trinidad and Tobago |
| TV | Tuvalu |
| TW | Taiwan |
| TZ | Tanzania, United Republic of |
| UA | Ukraine |
| UG | Uganda |
| UM | United States Minor Outlying Islands |
| US | United States of America |
| UY | Uruguay |
| UZ | Uzbekistan |
| VA | Vatican City Holy See |
| VC | Saint Vincent and the Grenadines |
| VE | Venezuela |
| VG | Virgin Islands (British) |
| VI | Virgin Islands (U.S.) |
| VN | Viet Nam |
| VU | Vanuatu |
| WF | Wallis and Futuna |
| WS | Samoa |
| YE | Yemen |
| YT | Mayotte |
| ZA | South Africa |
| Z | Zambia |
| ZW | Zimbabwe |