Skip to content

This helps with public holiday info using google calendar api

Notifications You must be signed in to change notification settings

olotintemitope/publicholiday

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Public Holiday

This package uses the Google Calendar API to fetch public holidays. The data always comes with 3 years data; the previous year, the current year and next year.

How to use

Sample Usage

<?php
require_once 'vendor/autoload.php';

use LazHoliday\PublicHoliday;

try {
    $holiday = new PublicHoliday();
    var_dump($holiday->fetch('usa')->getDataForYear(2021));
} catch (Exception $e) {
    var_dump($e->getMessage());
}

Available methods

  • fetch(string $country): PublicHoliday - Get all the calendar data when a country is passed
  • getData(): array - Return all the 3 years calendar data with some info
  • getItems(): array - Return all the 3 years calendar data
  • getDataForYear(int $year): array - Filter holiday data by year
  • getSummary(): array - Get the summary and dates of the holidays

Country codes

https://gist.github.com/seanblanchfield/4df78d73c85b149133615c7953894076

License


This project uses the MIT License feel free to contribute.

About

This helps with public holiday info using google calendar api

Resources

Stars

Watchers

Forks

Packages

 
 
 

Languages