Skip to content

A comprehensive WordPress plugin for HR teams to manage holiday calendars with multi-country support, CSV import/export, and responsive frontend displays

Notifications You must be signed in to change notification settings

nadimtuhin/wp-hr-holiday-calendar

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pathao Holiday Calendar Plugin

A comprehensive WordPress plugin for managing holiday calendars with multi-country support, designed specifically for HR teams to easily manage and display company holidays.

Features

Core Features

  • Multi-country Support - Manage holidays for multiple countries (Bangladesh, Nepal, and extensible for more)
  • Dual View Modes - Calendar view and List view for flexible holiday display
  • HR-Friendly CSV Import/Export - Bulk import/export holidays with downloadable templates
  • Admin Interface - Complete management system for countries and holidays
  • Frontend Shortcodes - Easy integration with any WordPress theme
  • Responsive Design - Mobile-friendly calendar and list views

Admin Features

  • Intuitive dashboard with holiday statistics
  • Country management with timezone support
  • Individual holiday CRUD operations
  • CSV template download for easy imports
  • Bulk import/export with validation and error reporting
  • Advanced filtering and search capabilities

Frontend Features

  • Beautiful calendar grid with holiday highlighting
  • Detailed list view with search and filtering
  • View switching with user preference persistence
  • Country and holiday type filtering
  • Responsive design for all devices
  • Print-friendly layouts

Installation

  1. Upload the plugin files to /wp-content/plugins/wp-holiday-calendar/
  2. Activate the plugin through the 'Plugins' screen in WordPress
  3. Navigate to 'Holidays' in the admin menu to configure
  4. Add your countries and holidays
  5. Use shortcodes to display calendars on your website

Requirements

  • WordPress 5.0 or higher
  • PHP 7.4 or higher
  • MySQL 5.6 or higher

Usage

Admin Usage

Adding Countries

  1. Go to Holidays > Countries
  2. Click Add New Country
  3. Enter country code (2 letters), name, and timezone
  4. Save the country

Managing Holidays

  1. Go to Holidays > Manage Holidays
  2. Add holidays individually or use CSV import
  3. Set holiday name, date, country, type, and description
  4. Choose if the holiday is recurring (annual/lunar)

CSV Import/Export

  1. Go to Holidays > Import/Export
  2. Download the CSV template
  3. Fill the template with your holiday data
  4. Upload and import the CSV file
  5. Export existing holidays for backup or sharing

Frontend Usage

Basic Shortcodes

// Display calendar view
[pathao_calendar]

// Display list view
[pathao_calendar view="list"]

// Filter by country
[pathao_calendar country="BD"]

// Filter by type
[pathao_calendar type="national"]

// Combined filters
[pathao_calendar view="list" country="NP" year="2024"]

Shortcode Parameters

  • view - "calendar" or "list" (default: calendar)
  • country - Country code (BD, NP, etc.) or "all" (default: all)
  • month - Specific month in YYYY-MM format
  • year - Specific year (YYYY format)
  • type - Holiday type: "national", "religious", "cultural", "company", or "all"

CSV Format

Import Template

Holiday Name,Date,Country Code,Type,Description,Recurring
"Independence Day","2024-03-26","BD","National","Bangladesh Independence Day","Annual"
"New Year","2024-01-01","NP","National","Nepali New Year","Annual"
"Eid ul-Fitr","2024-04-10","BD","Religious","End of Ramadan","Lunar"

Field Requirements

  • Holiday Name: Required text field
  • Date: Required in YYYY-MM-DD format
  • Country Code: Required 2-letter ISO code
  • Type: Required - "national", "religious", "cultural", or "company"
  • Description: Optional text description
  • Recurring: Required - "none", "annual", or "lunar"

Database Schema

Countries Table (wp_holiday_countries)

  • id - Primary key
  • code - 2-letter country code (unique)
  • name - Country name
  • timezone - Timezone identifier
  • created_at - Creation timestamp
  • updated_at - Last update timestamp

Holidays Table (wp_holiday_events)

  • id - Primary key
  • country_id - Foreign key to countries table
  • name - Holiday name
  • date - Holiday date
  • type - Holiday type (enum)
  • description - Optional description
  • recurring - Recurrence type (enum)
  • created_at - Creation timestamp
  • updated_at - Last update timestamp

REST API

Endpoints

Get Countries

GET /wp-json/pathao-calendar/v1/countries

Get Holidays

GET /wp-json/pathao-calendar/v1/holidays
Parameters: country, month, year, type, start_date, end_date

Export Holidays

GET /wp-json/pathao-calendar/v1/holidays/export
Parameters: country, year, type

Hooks and Filters

Filters

// Filter holidays before display
add_filter('pathao_calendar_holidays', 'custom_holiday_filter');

// Modify calendar display
add_filter('pathao_calendar_display', 'custom_calendar_display');

Actions

// Hook into holiday import
add_action('pathao_calendar_holiday_imported', 'after_holiday_import');

// Hook into country creation
add_action('pathao_calendar_country_created', 'after_country_created');

Customization

Custom Templates

Create custom templates in your theme:

  • pathao-calendar/calendar-view.php
  • pathao-calendar/list-view.php

CSS Customization

Override plugin styles in your theme:

.pathao-holiday-calendar {
    /* Your custom styles */
}

.holiday-national {
    background: your-color;
}

Localization

The plugin is translation-ready. Language files are located in the /languages/ directory.

Supported Timezones

  • Asia/Dhaka (Bangladesh)
  • Asia/Kathmandu (Nepal)
  • And all standard PHP timezones

Troubleshooting

Common Issues

  1. CSV Import Fails

    • Check date format (YYYY-MM-DD)
    • Verify country codes exist
    • Ensure file size is under 5MB
  2. Calendar Not Displaying

    • Verify shortcode parameters
    • Check that countries and holidays exist
    • Ensure theme compatibility
  3. Timezone Issues

    • Verify country timezone settings
    • Check WordPress timezone configuration

Debug Mode

Enable WordPress debug mode for detailed error logs:

define('WP_DEBUG', true);
define('WP_DEBUG_LOG', true);

Support

For support, feature requests, or bug reports:

Contributing

We welcome contributions! Please see our contributing guidelines in the repository.

Development Setup

  1. Clone the repository
  2. Install dependencies
  3. Follow WordPress coding standards
  4. Submit pull requests

License

This plugin is licensed under GPL v2 or later.

Changelog

Version 1.0.0

  • Initial release
  • Multi-country holiday support
  • Calendar and list views
  • CSV import/export functionality
  • Admin management interface
  • REST API endpoints
  • Responsive design
  • Localization support

Roadmap

Future Features

  • Holiday approval workflow
  • Email notifications for upcoming holidays
  • Google Calendar sync
  • Holiday templates by industry
  • Multi-year planning
  • Advanced reporting

Developed by Nadim Tuhin - Making holiday management simple and efficient for HR teams worldwide.

About

A comprehensive WordPress plugin for HR teams to manage holiday calendars with multi-country support, CSV import/export, and responsive frontend displays

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •