定制 springy-framework/business-days-calculator 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

springy-framework/business-days-calculator

Composer 安装命令:

composer require springy-framework/business-days-calculator

包简介

PHP class for calculate business days for given date

README 文档

README

This class can get the business days after today or a given date.

It can take as parameter a given date that will be taken as a reference.

The class can return one or more dates of the next business days after the given date considering the weekends and the regular holiday dates like Christmas, Easter, Corpus Christi, etc..

Optionally the class can also consider business days of specific countries like Brazil.

Latest Stable Version tests PHPStan Total Downloads License

Requirements

  • PHP 8.1+

Instalation

To get the latest stable version of this component use:

"require": {
    "springy-framework/business-days-calculator": "*"
}

in your composer.json file.

Usage

I suppose that the following example is all you need:

<?php

require 'vendor/autoload.php'; // If you're using Composer (recommended)

// Using dynamic mode
$today = new DateTime();
$bdCalc = new Springy\BusinessDaysCalculator($today);
$newDate = $bdCalc->addBrazilianHolidays((int) $today->format('Y'))
    ->addBrazilianHolidays((int) $today->format('Y') + 1)
    ->addBusinessDays(20)
    ->getDate();
var_dump($newDate);

if ($bdCalc->isBusinessDay()) {
    echo "Is a business day\n";
}

// Getting nth business date in 'Y-m-d' format string without create an object
echo "The 20th business day from now is "
    . Springy\BusinessDaysCalculator::getBusinessDate(20)
    . "\n";

Contributing

Please read our contributing document and thank you for doing that.

Code of Conduct

In order to ensure that our community is welcoming to all, please review and abide by the code of conduct.

License

This project is licensed under The MIT License (MIT).

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-12-05

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固