Inferensys

Prompt

Holiday-Aware Date Range Expansion Prompt

A practical prompt playbook for mapping holiday references, observances, and seasonal periods to explicit date ranges in production RAG and search workflows.
Developer reviewing semantic search engine results on laptop, relevance scores visible, technical search demo.
PROMPT PLAYBOOK

When to Use This Prompt

Define the job, reader, and constraints for the Holiday-Aware Date Range Expansion Prompt.

This prompt is for global RAG teams and search engineers who need to resolve holiday and observance references in user queries into explicit, machine-readable date ranges. The core job-to-be-done is converting a natural language query like 'sales during Diwali' or 'support tickets around Golden Week' into concrete ISO 8601 date boundaries that can be passed as metadata filters to a vector or keyword search index. The ideal user is a developer or platform engineer building a retrieval pipeline for a multi-locale application where document corpora and user queries span different cultural calendars. Required context includes the user's locale, a reference year, and optionally a specific region to disambiguate observances that vary by country.

Do not use this prompt when the query's temporal constraints are already explicit (e.g., 'June 1-5, 2024'), as a simpler date extraction prompt will be faster and cheaper. This prompt is also inappropriate for single-locale applications where a static lookup table of holidays is sufficient; the model's strength here is handling moveable feasts, regional variations, and multi-day observances that are impractical to hard-code. Avoid this prompt when the user's locale is unknown or ambiguous, as guessing the wrong holiday date will silently corrupt retrieval results. Instead, pair this prompt with a locale detection or clarification step upstream.

Before integrating this prompt into a production pipeline, you must define the expected output schema, validation rules, and failure modes. The prompt should return a JSON object with explicit start and end dates, the holiday name as resolved, the locale used, and a confidence flag for moveable feasts. Implement a post-generation validator that checks for logical date ranges, rejects future dates if querying a historical corpus, and flags low-confidence resolutions for human review. Start with a golden dataset of 50+ holiday queries across different locales and years to measure accuracy before deployment. The next section provides the copy-ready prompt template you can adapt.

PRACTICAL GUARDRAILS

Use Case Fit

Where the Holiday-Aware Date Range Expansion Prompt works and where it introduces risk. Use these cards to decide if this prompt belongs in your retrieval pipeline.

01

Good Fit: Global RAG with Locale-Aware Queries

Use when: users query across multiple regions and reference holidays like 'Diwali sales' or 'Golden Week travel.' The prompt maps cultural observances to explicit date ranges given a locale and year. Guardrail: always supply a locale code and reference year; never assume a default region.

02

Bad Fit: Real-Time or Sub-Second Retrieval

Avoid when: retrieval latency must stay under 100ms. LLM-based holiday resolution adds non-trivial inference time. Guardrail: precompute holiday-to-date-range mappings for known locales and cache them; only call the prompt for unknown or ambiguous holiday references.

03

Required Inputs

What to watch: the prompt fails silently when locale, year, or holiday name is missing. Guardrail: validate that [LOCALE], [REFERENCE_YEAR], and [HOLIDAY_REFERENCE] are present before calling the prompt. Reject queries with unresolvable or contradictory inputs rather than guessing.

04

Operational Risk: Moveable Feast Drift

What to watch: holidays like Easter, Lunar New Year, and Ramadan shift annually. A cached mapping from last year produces incorrect retrieval windows. Guardrail: never cache holiday-to-date mappings across years for moveable feasts. Regenerate or validate mappings per reference year.

05

Operational Risk: Multi-Day Observance Boundaries

What to watch: holidays spanning multiple days (e.g., Hanukkah, Eid, Chinese New Year) may be truncated to a single date. Guardrail: include explicit multi-day range validation in eval criteria. Test that the output includes start and end dates matching the full observance period for the given locale.

06

Operational Risk: Regional Variant Collision

What to watch: the same holiday name maps to different dates across regions (e.g., 'Labor Day' in US vs. other countries). Guardrail: require a locale code in the input. Add eval cases that verify different locales produce different date ranges for the same holiday name.

PROMPT PLAYBOOK

Copy-Ready Prompt Template

A reusable prompt that maps holiday references to explicit date ranges with locale, year, and regional-variation awareness.

This template converts natural-language holiday references into machine-readable date ranges. It handles moveable feasts (Easter-based holidays), multi-day observances, regional variations (e.g., UK vs. US bank holidays), and locale-specific calendars. Use it before retrieval so your vector or keyword search receives concrete ISO 8601 boundaries instead of ambiguous holiday names.

text
You are a date-range resolver that maps holiday references to explicit ISO 8601 intervals.

Given a user query that references one or more holidays, observances, or seasonal periods, produce a JSON array of date ranges. Each range must include the holiday name, the resolved start date, the resolved end date, the locale used for resolution, and a confidence flag for moveable feasts.

## INPUT
Query: [QUERY]
Reference Year: [REFERENCE_YEAR]
Target Locale: [LOCALE]
Known Regional Overrides: [REGIONAL_OVERRIDES]

## OUTPUT SCHEMA
Return a JSON object with a "ranges" array. Each element must have:
- "holiday_reference": the phrase from the query
- "holiday_canonical": the resolved canonical holiday name
- "start_date": ISO 8601 date (YYYY-MM-DD)
- "end_date": ISO 8601 date (YYYY-MM-DD), same as start_date for single-day observances
- "locale": the locale used for resolution
- "is_moveable": boolean, true if the date depends on a moveable feast calculation
- "confidence": "high" | "medium" | "low"
- "assumptions": array of strings listing any assumptions made during resolution

## CONSTRAINTS
- For multi-day observances (e.g., Hanukkah, Diwali, Ramadan), return the full observance period for the reference year.
- For moveable feasts (e.g., Easter, Orthodox Easter, Lunar New Year), calculate the correct date for the reference year and locale.
- If a holiday has different dates across regions (e.g., Mother's Day in UK vs. US), use the target locale. If the locale does not disambiguate, return multiple candidate ranges with locale labels.
- If the reference year is missing or ambiguous, default to the current calendar year and note this in assumptions.
- If a holiday reference cannot be resolved with high confidence, set confidence to "low" and explain why in assumptions.
- Do not invent holidays. If the reference does not match a known observance, return an empty ranges array.

## EXAMPLES
Query: "sales during Christmas week 2024"
Reference Year: 2024
Locale: US
Output:
{
  "ranges": [
    {
      "holiday_reference": "Christmas week",
      "holiday_canonical": "Christmas Week (Western)",
      "start_date": "2024-12-22",
      "end_date": "2024-12-28",
      "locale": "US",
      "is_moveable": false,
      "confidence": "high",
      "assumptions": ["Christmas week defined as Sunday through Saturday containing December 25"]
    }
  ]
}

Query: "Easter orders 2025"
Reference Year: 2025
Locale: US
Output:
{
  "ranges": [
    {
      "holiday_reference": "Easter",
      "holiday_canonical": "Easter Sunday (Western)",
      "start_date": "2025-04-20",
      "end_date": "2025-04-20",
      "locale": "US",
      "is_moveable": true,
      "confidence": "high",
      "assumptions": ["Western Easter calculated via Gregorian computus"]
    }
  ]
}

Query: "Diwali promotions"
Reference Year: 2025
Locale: IN
Output:
{
  "ranges": [
    {
      "holiday_reference": "Diwali",
      "holiday_canonical": "Diwali (Deepavali)",
      "start_date": "2025-10-20",
      "end_date": "2025-10-24",
      "locale": "IN",
      "is_moveable": true,
      "confidence": "medium",
      "assumptions": ["Diwali 2025 date based on Hindu lunar calendar estimation; verify against published panchang for exact dates", "Five-day observance period assumed"]
    }
  ]
}

## RISK LEVEL
Medium. Incorrect date ranges cause retrieval misses or irrelevant results. Always log assumptions for audit. For financial or legal corpora, require human review of resolved ranges before retrieval execution.

Adapt this template by replacing the example locale with your supported region set. If your application serves multiple locales, pass the user's detected locale into [LOCALE] and maintain a [REGIONAL_OVERRIDES] map for known conflicts (e.g., Mother's Day dates per country). For production, pair this prompt with a post-processing validator that checks every returned date range against a known holiday calendar and flags discrepancies before the ranges reach your search index.

IMPLEMENTATION TABLE

Prompt Variables

Required inputs for the Holiday-Aware Date Range Expansion Prompt. Each placeholder must be populated before the prompt is assembled and sent to the model. Missing or invalid inputs are the most common cause of incorrect date range outputs.

PlaceholderPurposeExampleValidation Notes

[HOLIDAY_REFERENCE]

The holiday or observance name as it appears in the user query, which may be informal, abbreviated, or in a non-English language

Thanksgiving, Diwali, Boxing Day, 中秋节, Memorial Day weekend

Must be a non-empty string. Check against a known holiday gazetteer for the target locale. If no match is found, the prompt should return an empty range and a clarification request rather than guessing.

[TARGET_LOCALE]

ISO 3166-1 alpha-2 country code or IETF BCP 47 language-region tag that determines which holiday calendar and regional observance rules apply

US, GB, IN, zh-CN, en-CA

Must be a valid ISO 3166-1 alpha-2 code or BCP 47 tag. Reject free-text locale names like 'America' or 'China'. Map to a supported locale list before prompt assembly. Unsupported locales should trigger a fallback or error.

[REFERENCE_YEAR]

The calendar year for which the holiday date range should be resolved, expressed as a four-digit integer

2025, 2026

Must be an integer between 2000 and 2100. Validate range before prompt injection. Null is not allowed. For queries spanning year boundaries such as 'New Year's Eve', the year determines which instance is resolved.

[OBSERVANCE_RULE_SET]

Specifies which observance rule to apply when a holiday has multiple definitions: official public holiday, religious observance, commercial observance, or school holiday

public_holiday, religious, commercial, all

Must be one of the enumerated values. Default to 'public_holiday' if not specified. The 'all' option should return multiple date ranges with labels. Invalid values must be rejected before the prompt is sent.

[INCLUDE_ADJACENT_DAYS]

Boolean flag indicating whether to include adjacent non-holiday days commonly taken as part of the holiday period, such as the Friday before a Monday holiday or the Monday after a Sunday observance

true, false

Must be a strict boolean. Default to false. When true, the prompt must include instructions to label which days are the official holiday and which are adjacent. Do not accept string values like 'yes' or 'no'.

[OUTPUT_TIMEZONE]

IANA timezone name used to anchor date boundaries and resolve midnight-to-midnight ranges in the correct zone

America/New_York, Asia/Kolkata, Europe/London

Must be a valid IANA timezone string. Reject UTC offsets like '+05:30'. Default to 'UTC' if not provided. Timezone affects day-boundary calculations for multi-day observances that cross midnight in the target locale.

[MULTI_DAY_BEHAVIOR]

Instruction for how to handle holidays that span multiple days, such as Eid al-Fitr or Lunar New Year: return the full range, the first day only, or the primary observance day

full_range, first_day, primary_day

Must be one of the enumerated values. Default to 'full_range'. For moveable feasts where the exact end date varies by region, the prompt must note uncertainty when 'full_range' is selected and the end date is not fixed.

PROMPT PLAYBOOK

Implementation Harness Notes

How to wire the Holiday-Aware Date Range Expansion Prompt into a production RAG pipeline with validation, retries, and locale-aware caching.

This prompt is designed to be called as a pre-retrieval transformation step in a RAG pipeline. Before executing a search, the application should intercept the user's query, extract any holiday references, and call this prompt to resolve them into explicit date ranges. The output is a structured JSON object containing the original query, the identified holiday, the resolved date range, and a confidence score. This structured output allows the downstream retrieval system to inject precise date filters into vector or keyword search queries without manual intervention.

To implement this, wrap the prompt in a function that accepts [QUERY], [LOCALE], and [REFERENCE_YEAR] as parameters. The application must first detect whether the query contains a holiday reference using a lightweight classifier or keyword scan to avoid unnecessary LLM calls. If a holiday is detected, call the prompt with a low-temperature setting (0.0–0.2) to maximize deterministic date resolution. Validate the output against a schema that requires start_date and end_date in ISO 8601 format (YYYY-MM-DD), a holiday_name string, and a confidence float between 0 and 1. If confidence is below a configurable threshold (e.g., 0.8), log the result for human review and fall back to a broader date range or a null filter. Implement a retry loop with a maximum of two attempts for malformed JSON responses, using a repair prompt that includes the raw output and the expected schema.

For global applications, maintain a locale-to-calendar mapping that includes regional holiday definitions for moveable feasts (e.g., Easter), lunar-based observances, and multi-day festivals. Cache resolved date ranges per locale and year to avoid redundant LLM calls for common holidays. When a query references a holiday that spans multiple days (e.g., Diwali, Hanukkah, Ramadan), the prompt should return the full observance period, and the retrieval system should use this range as an inclusive filter. Always log the input query, resolved range, confidence score, and any fallback decisions to an observability platform for debugging and evaluation. Before deploying, test against a golden dataset of holiday queries across supported locales, including edge cases like holidays that fall on weekends with observed weekday shifts, and validate that the resolved ranges match authoritative calendar sources.

IMPLEMENTATION TABLE

Expected Output Contract

Defines the structure, types, and validation rules for the holiday-aware date range expansion output. Use this contract to parse and validate the model response before passing date ranges to downstream retrieval systems.

Field or ElementType or FormatRequiredValidation Rule

holiday_name

string

Must match or closely approximate the holiday string from [QUERY]. Non-empty.

locale

string

Must match the [LOCALE] input exactly (e.g., 'US', 'DE', 'IN'). Case-sensitive enum check.

year

integer

Must equal the [YEAR] input. Integer parse check; reject if null or non-integer.

start_date

ISO 8601 date (YYYY-MM-DD)

Must be a valid date within [YEAR]. Parse check; reject if after end_date.

end_date

ISO 8601 date (YYYY-MM-DD)

Must be a valid date within [YEAR] or [YEAR]+1 for cross-year observances. Parse check; reject if before start_date.

observance_type

enum: public_holiday | observance | seasonal_period

Must be one of the allowed enum values. Reject unknown types.

confidence

float

Must be between 0.0 and 1.0 inclusive. Numeric parse check; reject if out of range.

notes

string | null

If present, must be a string. Null allowed. Reject if non-string, non-null type.

PRACTICAL GUARDRAILS

Common Failure Modes

What breaks first when mapping holiday references to date ranges and how to guard against it.

01

Moveable Feast Miscalculation

What to watch: The model treats Easter, Ramadan, Lunar New Year, or Diwali as fixed-date holidays, producing wrong ranges every year. Guardrail: Require a locale-aware holiday library lookup or external calendar API call instead of relying on model internal knowledge. Validate generated dates against a known reference calendar for the target year.

02

Locale-Ambiguous Holiday Collisions

What to watch: A query for 'Labour Day' resolves to US Labor Day (September) when the user context is International Workers' Day (May 1). The model defaults to its training distribution rather than the requested locale. Guardrail: Always require an explicit [LOCALE] input with ISO 3166 country code. When locale is missing, return a clarification request listing candidate holidays rather than guessing.

03

Multi-Day Observance Boundary Errors

What to watch: Holidays spanning multiple days (Hanukkah, Eid al-Adha, Chinese New Year) are truncated to a single day or the wrong start/end boundaries. Guardrail: Include a holiday duration lookup table. Validate that the output range matches the expected observance length. Flag single-day outputs for known multi-day holidays as probable errors.

04

Year-Rollover Boundary Confusion

What to watch: Queries for 'Christmas break' or 'New Year holidays' that span December-January produce ranges that stop at December 31 or start January 1, missing the cross-year period. Guardrail: When a holiday is within 7 days of a year boundary, explicitly check whether the observance period crosses the year line and extend the range accordingly.

05

Regional Variation Silently Ignored

What to watch: 'Thanksgiving' resolves to US Thanksgiving (fourth Thursday of November) when the user context is Canada (second Monday of October) or Liberia (first Thursday of November). No error is raised. Guardrail: Maintain a regional holiday registry keyed by locale. When a holiday name has multiple regional variants, require locale confirmation or return all candidates with locale labels.

06

Public Holiday vs. Observance Day Confusion

What to watch: The model treats a cultural or religious observance (Good Friday, Yom Kippur) as a public holiday with business closure implications when the query context is business-day calculation. Guardrail: Tag each resolved holiday with a type classification (public_holiday, religious_observance, cultural_observance, school_holiday). Let downstream logic decide whether to include it based on the use case.

IMPLEMENTATION TABLE

Evaluation Rubric

Use this rubric to test the Holiday-Aware Date Range Expansion Prompt before deploying it in a retrieval pipeline. Each criterion targets a known failure mode for locale-sensitive holiday resolution.

CriterionPass StandardFailure SignalTest Method

Fixed-Date Holiday Resolution

Output contains the correct ISO 8601 date range for a fixed-date holiday in the specified [LOCALE] and [YEAR].

Date range is off by one day, or the holiday is mapped to the wrong month.

Unit test with a static input: locale='US', year=2025, holiday='Independence Day'. Assert output range equals '2025-07-04/2025-07-04'.

Moveable Feast Calculation

Output correctly calculates the date for a moveable feast (e.g., Easter) based on the [YEAR] and Western or Orthodox [LOCALE] rules.

Easter date is calculated using the wrong computus (e.g., Julian instead of Gregorian) or is off by a week.

Unit test with locale='US', year=2025, holiday='Easter Sunday'. Assert output range equals '2025-04-20/2025-04-20'.

Multi-Day Observance Expansion

Output expands a multi-day holiday into a range spanning all days of the observance, not just the start date.

Output returns a single date for a known multi-day holiday like Hanukkah or Diwali.

Unit test with locale='IN', year=2025, holiday='Diwali'. Assert output range spans at least 5 days and includes the main festival date.

Regional Variation Handling

Output selects the correct date for a holiday that varies by region within a country, based on the provided [LOCALE] code.

Output returns a date for the wrong region (e.g., a state-specific public holiday for the wrong state).

Unit test with locale='DE-BY', year=2025, holiday='Epiphany'. Assert output range equals '2025-01-06/2025-01-06'. Test with locale='DE-BE' and assert the holiday is not found or returns an empty list.

Ambiguous Holiday Disambiguation

For an ambiguous holiday name, the output returns multiple candidate ranges with confidence scores or asks for clarification.

Output silently picks one interpretation without noting the ambiguity (e.g., 'Labor Day' in US vs. international contexts).

Unit test with locale='US', year=2025, holiday='Labor Day'. Assert output contains a single range. Test with locale='INTL' and assert output contains multiple candidates or a clarification request.

Year-Boundary Spanning

Output correctly handles a holiday that spans across the new year boundary, returning a range with different years for start and end.

Output returns an invalid date range (e.g., end date before start date) or truncates the range to a single year.

Unit test with locale='US', year=2025, holiday='New Year's Eve'. Assert output range is '2024-12-31/2025-01-01'.

Holiday Not Found Handling

Output returns an empty list or a specific 'not found' indicator when a holiday string does not match any known observance in the [LOCALE].

Output hallucinates a date for a non-existent or misspelled holiday.

Unit test with locale='US', year=2025, holiday='Fake Holiday'. Assert output is an empty list or a structured null/not-found object.

Output Schema Compliance

Output is a valid JSON array of objects, each with 'holiday', 'locale', 'date_range', and 'confidence' fields.

Output is a plain text string, or the JSON schema is missing required fields or has incorrect types.

Automated schema validation check after each test run. Assert all items in the array have string 'holiday', string 'locale', string 'date_range', and number 'confidence' fields.

ADAPTATION OPTIONS

Adapt This Prompt

How to adapt

Start with the base prompt and a single locale-year pair. Use a lightweight JSON schema for the output but skip strict enum validation on holiday names. Hardcode the locale and year as constants rather than building a full parameterized harness.

code
[LOCALE] = "en-US"
[YEAR] = 2025

Watch for

  • Moveable feasts (Easter, Ramadan) returning wrong dates if the model uses a fixed calendar assumption
  • Regional variants ("Bank Holiday" in UK vs. US) collapsing into a single definition
  • Multi-day observances truncated to a single date
Prasad Kumkar

About the author

Prasad Kumkar

CEO & MD, Inference Systems

Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.

His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.