承接 rotous/holidays-nl 相关项目开发

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

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

rotous/holidays-nl

Composer 安装命令:

composer require rotous/holidays-nl

包简介

Package to find Dutch holiday dates

README 文档

README

The HolidaysNL package is a PHP package that can be used to find the dates of the holidays in the Netherlands between the years 0 and 3000 (which is just a very arbitrary number)

The holidays that can be retrieved are the following:

  • New Year
  • Easter (1st and 2nd day)
  • Queens/Kings day
  • Ascension
  • Pentecost (1st and 2nd day)
  • Christmas (1st and nd day)

Installation

The package can be installed with composer:

composer require rotous/holidays-nl

Usage

<?php

// Make sure you use the correct path to the autoload file!
require_once 'vendor/autoload.php';

$api = new \rotous\holidays\HolidaysNL();
$holidays = $api->getHolidays(1972);
/*
array(9) {
  [0]=>
  string(10) "01-01-1972"
  [1]=>
  string(10) "02-04-1972"
  [2]=>
  string(10) "03-04-1972"
  [3]=>
  string(10) "01-05-1972"
  [4]=>
  string(10) "11-05-1972"
  [5]=>
  string(10) "21-05-1972"
  [6]=>
  string(10) "22-05-1972"
  [7]=>
  string(10) "25-12-1972"
  [8]=>
  string(10) "26-12-1972"
}
*/

$api->isHoliday('01-05-1972');  // true
$api->getEaster(1972);          // "02-04-1972"
$api->getSecondEasterDay(1972); // "03-04-1972"

All public functions have a DateTime based counterpart:

$holidays = $api->getHolidaysDateTime(1972);
/*
array(9) {
  [0]=>
  object(DateTime)#4 (3) {
    ["date"]=>
    string(26) "1972-01-01 12:00:00.000000"
    ["timezone_type"]=>
    int(3)
    ["timezone"]=>
   string(16) "Europe/Amsterdam"
  }
  [1]=>
  object(DateTime)#5 (3) {
    ["date"]=>
    string(26) "1972-04-02 12:00:00.000000"
    ["timezone_type"]=>
    int(3)
    ["timezone"]=>
    string(16) "Europe/Amsterdam"
  }
  [2]=>
  object(DateTime)#6 (3) {
    ["date"]=>
    string(26) "1972-04-03 12:00:00.000000"
    ["timezone_type"]=>
    int(3)
    ["timezone"]=>
    string(16) "Europe/Amsterdam"
  }
  [3]=>
  object(DateTime)#12 (3) {
    ["date"]=>
    string(26) "1972-05-01 12:00:00.000000"
    ["timezone_type"]=>
    int(3)
    ["timezone"]=>
    string(16) "Europe/Amsterdam"
  }
  [4]=>
  object(DateTime)#7 (3) {
    ["date"]=>
    string(26) "1972-05-11 12:00:00.000000"
    ["timezone_type"]=>
    int(3)
    ["timezone"]=>
    string(16) "Europe/Amsterdam"
  }
  [5]=>
  object(DateTime)#8 (3) {
    ["date"]=>
    string(26) "1972-05-21 12:00:00.000000"
    ["timezone_type"]=>
    int(3)
    ["timezone"]=>
    string(16) "Europe/Amsterdam"
  }
  [6]=>
  object(DateTime)#9 (3) {
    ["date"]=>
    string(26) "1972-05-22 12:00:00.000000"
    ["timezone_type"]=>
    int(3)
    ["timezone"]=>
    string(16) "Europe/Amsterdam"
  }
  [7]=>
  object(DateTime)#10 (3) {
    ["date"]=>
    string(26) "1972-12-25 12:00:00.000000"
    ["timezone_type"]=>
    int(3)
    ["timezone"]=>
    string(13) "Europe/Berlin"
  }
  [8]=>
  object(DateTime)#11 (3) {
    ["date"]=>
    string(26) "1972-12-26 12:00:00.000000"
    ["timezone_type"]=>
    int(3)
    ["timezone"]=>
    string(13) "Europe/Berlin"
  }
}
*/

$api->isHolidayDateTime(new \DateTime('1972-05-01'));  // true
$api->getEasterDateTime(1972);
/*
object(DateTime)#4 (3) {
  ["date"]=>
  string(26) "1972-04-02 12:00:00.000000"
  ["timezone_type"]=>
  int(3)
  ["timezone"]=>
  string(16) "Europe/Amsterdam"
}
*/
$api->getSecondEasterDayDateTime(1972);
/*
object(DateTime)#4 (3) {
  ["date"]=>
  string(26) "1972-04-03 12:00:00.000000"
  ["timezone_type"]=>
  int(3)
  ["timezone"]=>
  string(16) "Europe/Amsterdam"
}
*/

The complete api documentation can be found at https://rotous.github.io/holidaysNL/

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: AGPL-3.0
  • 更新时间: 2021-02-19

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固