承接 topaz/holidays 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

topaz/holidays

最新稳定版本:v1.01

Composer 安装命令:

composer require topaz/holidays

包简介

Fetches Google calendar public holidays

README 文档

README

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.

统计信息

  • 总下载量: 2.82k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 6
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 5
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2021-08-16