Skip to content

A PHP package to assist in retrieving a country's year holidays from Google Calendar API's.

Notifications You must be signed in to change notification settings

AddPay/google-holidays

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

No Longer Maintained

Please use PHP Google Holidays instead!

Usage

$instance = new \Google\Holidays();

$holidays = $instance->withApiKey('<your-google-calendar-api-key>')
                     ->inCountry('<country-abbreviation>')
                     ->list();

Sample Output: See https://developers.google.com/calendar/v3/reference/events/list

Additional Usage

Return only name and date

$holidays = $instance->withApiKey('<your-google-calendar-api-key>')
                     ->inCountry('US')
                     ->withMinimalOutput()
                     ->list();

Sample Output

[
  "name": "A holiday",
  "date": "2018-01-01"
],
[
  "name": "Another holiday",
  "date": "2018-02-01"
]

Return only dates

$holidays = $instance->withApiKey('<your-google-calendar-api-key>')
                     ->inCountry('UK')
                     ->withDatesOnly()
                     ->list();

Sample Output

[
  "2018-01-01",
  "2018-02-01",
  "2018-03-15"
]

About

A PHP package to assist in retrieving a country's year holidays from Google Calendar API's.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages