定制 mmerlijn/helper-time-array 二次开发

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

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

mmerlijn/helper-time-array

Composer 安装命令:

composer create-project mmerlijn/helper-time-array

包简介

TimeArray helper

README 文档

README

The time array helper can handle times in array's. All times are represented as integers. Start of the day is 0 end of the day is 24*60=1440.

Example time blok

[[600,660],[720,800]]

This represent 10:00-11:00 and 12:00-13:20

If times blocks overlap each other, the blocks will be compacted to one block

Example

[[600,700],[700,800]] => [[600,800]]

Requirements

  • PHP 8.0

Installation

composer require mmerlijn/helper-time-array

Usage

#####Start time array

$t = new TimeArray();

//or with initial value

$t = new TimeArray([[500,600],[700,800]]); //multiple intervals
$t = new TimeArray([600,720]); //one interval

Or with the create method

$t = new TimeArray();
$t->create([600,700]);

#####Add times (accepts only one time interval)

$t = $t->add([600,700]); //add 10:00-11:40 

#####Substract times (accepts only one time interval)

$t = $t->substract([650,700]); //reduce the time Array

#####Get Returning the array

$t->get(); //

#####Chaning

(new TimeArray([500,600]))->add([700,800])->substract([750,800])->get();

Testing

See phpunit tests

统计信息

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

GitHub 信息

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

其他信息

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

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固