Holiday Management
This guide covers managing holidays across companies, including the admin calendar holiday controls, company creation auto-seeding, and bulk import operations.
Overview
System Admin Holiday Capabilities
As a System Admin, you can manage holidays for any company on the platform:
| Action | Description |
|---|---|
| View holidays | See all holidays for any company |
| Create holidays | Add bank holidays, closures, or custom dates |
| Import UK bank holidays | Bulk import from the UK Government API |
| Delete holidays | Remove holidays from any company |
How Holidays Work
Holidays are company-specific. Each company has its own holiday list, which affects:
- Leave balance calculations (holidays excluded like weekends)
- Calendar day and week view markers
- Shift creation warnings
- Copy-week and bulk scheduling tools
Accessing Holiday Management
From the Admin Calendar Page
- Navigate to the Admin section
- Select a company
- Open the company's Calendar page
- Click the Calendar & Holidays button
- The Holiday Management panel opens
From Company Settings
- Navigate to the Admin section
- Select a company
- Go to Settings → Holidays tab
Both routes open the same Holiday Management component.
Auto-Seeding on Company Creation
When you create a new company through the Company Creation Wizard, Shyfts automatically:
- Fetches UK bank holidays for the current year and next year
- Inserts them into the
company_holidaystable with typebank_holiday - If the UK Government API is unavailable, falls back to hardcoded holiday data (2025-2028)
What Gets Seeded
| Holiday | Included |
|---|---|
| New Year's Day | Yes |
| Good Friday | Yes |
| Easter Monday | Yes |
| Early May Bank Holiday | Yes |
| Spring Bank Holiday | Yes |
| Summer Bank Holiday | Yes |
| Christmas Day | Yes |
| Boxing Day | Yes |
| Substitute days (weekend holidays) | Yes |
Rollback Behaviour
If company creation fails after holidays have been inserted, the cleanup process removes the seeded holidays along with other company data.
Importing UK Bank Holidays
For an Existing Company
- Open the Holiday Management panel for the target company
- Click Import UK Bank Holidays
- Select the year (2025-2028 supported)
- Click Import
Import Details
| Aspect | Behaviour |
|---|---|
| Source | UK Government API (gov.uk/bank-holidays) |
| Region | England and Wales |
| Caching | API response cached for 24 hours |
| Fallback | Hardcoded data used if API unavailable |
| Idempotent | Running twice skips existing holidays |
| Response | Shows count of imported, skipped, and total |
Example Response
After importing:
Imported 8 bank holidays for 2026.
Skipped 0 (already existed).
Total holidays for 2026: 8
Managing Holidays Across Companies
Holiday Types
| Type | Use Case | Badge |
|---|---|---|
| Bank Holiday | Official UK public holidays | Amber |
| Company Closure | Planned closures (annual shutdown, refurbishment) | Red |
| Custom | Training days, special events | Blue |
Creating Company-Specific Closures
Different companies may have different closure dates. For example:
- A GP practice might close for an annual training day
- A restaurant might close for refurbishment
- An office might have a company away day
Create these as Company Closure type holidays for the specific company.
Bulk Operations
Currently, holidays are managed per-company. To add the same custom holiday to multiple companies, you need to add it to each company individually.
Holiday Impact on Operations
Leave Balance
When a holiday falls within a leave request date range, that day is not counted as a leave day. This matches the treatment of weekends.
Example: If Boxing Day (26 December) is a bank holiday and a staff member requests 23-27 December off, only the non-holiday weekdays are deducted.
Calendar Display
| View | Holiday Indicator |
|---|---|
| Day view | Amber badge in header + closed-day message with building icon |
| Week view | Holiday name under date + amber column tint |
Shift Scheduling
| Tool | Holiday Behaviour |
|---|---|
| Create shift | Warning displayed when creating a shift on a holiday |
| Copy week | Response includes target_week_holidays listing holidays in the target week |
| Bulk scheduling | Toast warning when holidays exist in the target week |
Troubleshooting
Common Issues
| Issue | Cause | Solution |
|---|---|---|
| Holidays not showing after import | Year mismatch | Ensure you imported the correct year |
| Duplicate import attempt | Already imported | Import is idempotent — duplicates are skipped |
| API import fails | Network or API issue | Hardcoded fallback data is used automatically |
| Holiday not affecting leave balance | Holiday added after leave was approved | Existing approved leave is not retroactively recalculated |
Related Documentation
- Creating Companies - Company creation with auto-seeded holidays
- Managing Holidays (Manager Guide) - Company Manager holiday management
- Leave Balance - How holidays affect staff leave
Source Files:
src/components/holidays/HolidayManagement.tsx- Holiday management UIsrc/lib/utils/bank-holidays.ts- UK Government API integration and fallback datasrc/lib/utils/company-holidays.ts- Shared holiday query utilitiessrc/app/api/companies/create-with-manager/route.ts- Company creation with holiday seedingsrc/app/api/companies/[companyId]/holidays/import-bank-holidays/route.ts- Bulk import endpoint