定制 gtmassey/period 二次开发

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

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

gtmassey/period

最新稳定版本:v1.3.1

Composer 安装命令:

composer require gtmassey/period

包简介

Create date ranges and periods of time with ease.

README 文档

README

Latest Version on Packagist Total Downloads Tests

Create date ranges and periods of time with ease.

Installation

You can install the package via composer:

composer require gtmassey/period

Usage

All instances of Period take in Carbon instances for the startDate and endDate.

You can define a period by passing a start and end date to the static create method:

$customPeriod = Period::create(Carbon::now()->subDays(3), Carbon::now());

You can also use one of the many methods provided for you to generate pre-defined periods of time:

//days
Period::today();
Period::yesterday();
Period::lastDays(int $days); //$days = 2
Period::lastDaysExcludingToday(int $days); //$days = 2

//weeks
Period::thisWeek();
Period::thisWeekExcludingToday();
Period::lastWeek();
Period::lastWeeks(int $weeks);

//months
Period::thisMonth();
Period::thisMonthExcludingToday();
Period::lastMonth();
Period::lastMonths(int $months);

//quarters (3 months)
Period::thisQuarter();
Period::thisQuarterExcludingToday();
Period::lastQuarter();
Period::lastQuarters(int $quarters);

//years
Period::thisYear();
Period::thisYearExcludingToday();
Period::lastYear();
Period::lastYears(int $years);

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

This package was extracted from gtmassey/laravel-analytics. A special thanks goes to Plytas for their help in creating the original package this code is extracted from.

Thank you to the team at Spatie for their awesome packages and inspiration. Their laravel-analytics package was the inspiration for this project and the analytics project.

License

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

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-12-06