mayflower/holiday

此包已被弃用且不再维护。未建议替代包。

计算假期的库

0.7.0 2016-05-03 04:33 UTC

This package is not auto-updated.

Last update: 2020-01-24 15:25:32 UTC


README

Build Status

用于计算假期的库。

支持的国家和地区

  • 美国
  • 德国及其所有组成州
  • 瑞典
  • 荷兰

安装

composer require mayflower/holiday

用法

<?php

require_once __DIR__ . '/vendor/autoload.php';

$holidays = new Holiday\Germany();

// Returns array of Holiday objects, if any between the given dates.
$holidays->between(
     new \DateTime('01.01.2018'),
     new \DateTime('31.12.2018')
);

// isHoliday calls ->between with the given date to both parameters.
$holidays->isHoliday(new \DateTime('01.05.2018'))