定制 laracraft-tech/carbon-extensions 二次开发

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

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

laracraft-tech/carbon-extensions

最新稳定版本:v0.2.1

Composer 安装命令:

composer require laracraft-tech/carbon-extensions

包简介

Some useful extension for the carbon library!

README 文档

README

Latest Version on Packagist Tests Check & fix styling License

Here we will share some useful carbon extensions, which we need in our daily work.

Installation

You can install the package via composer:

composer require laracraft-tech/carbon-extensions

Usage

CarbonFiscalYear

The CarbonFiscalYear class helps you to work with fiscal years! It easily lets you know the fiscal years start and end of a given date.

Note: There is also a CarbonFiscalYearImmutable, class which has the same API, but it works immutable. For more information on immutables, check out the carbon docs.

// set your fiscal year start month and day 
CarbonFiscalYear::setFiscalYearStart(4, 1);

$date = CarbonFiscalYear::parse("2022-03-30");
$date->startOfYear()->format("Y-m-d"); // 2021-04-01
$date->endOfYear()->format("Y-m-d"); // 2022-03-31

$date2 = CarbonFiscalYear::parse("2022-04-02");
$date2->startOfYear()->format("Y-m-d"); // 2022-04-01
$date2->endOfYear()->format("Y-m-d"); // 2023-03-31

Testing

composer test

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

The MIT License (MIT). Please see License File for more information.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-04-01