previous_business_day
Find the most recent business day before a given date, skipping weekends and public holidays. Specify country and optional subdivision for accurate results.
Instructions
Return the previous business day on/before (inclusive) or strictly before date.
Use this to move backward to the most recent working day — skipping weekends and public holidays.
Args:
date: ISO 8601 date string (YYYY-MM-DD) to start from.
country: ISO 3166-1 alpha-2 code (case-insensitive, normalized to upper).
inclusive: When True, date itself qualifies if it is a business day.
When False (default), the search starts the day before date.
subdiv: Optional country-specific subdivision code (case-sensitive; see
get_supported_countries). When omitted, only nation-wide holidays are
considered.
Returns: dict with keys: input_date, previous_business_day, country, subdiv (only if provided), skipped_days.
Raises: ValueError: on invalid date, unknown country/subdiv, or if no business day is found within ~10 years.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| date | Yes | ||
| country | Yes | ||
| inclusive | No | ||
| subdiv | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||