PHPackages                             takuya/php-time-overlap - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. takuya/php-time-overlap

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

takuya/php-time-overlap
=======================

Check TimeInterval/Event/Calendar overlapping.

1.1(3y ago)16GPL-3.0-or-laterPHPPHP &gt;=7.4CI passing

Since Dec 23Pushed 2w ago1 watchersCompare

[ Source](https://github.com/takuya/php-timerange-overlap)[ Packagist](https://packagist.org/packages/takuya/php-time-overlap)[ RSS](/packages/takuya-php-time-overlap/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (1)Dependencies (2)Versions (2)Used By (0)

TimeRange Overlapping Checker.
==============================

[](#timerange-overlapping-checker)

[![](https://github.com/takuya/php-timerange-overlap/workflows/main/badge.svg)](https://github.com/takuya/php-timerange-overlap/workflows/main/badge.svg)

This library for checking Events/Schedule TimeRange have Overlapping.

Check has overlapping.
----------------------

[](#check-has-overlapping)

Usage
-----

[](#usage)

```
use Takuya\PhpTimeOverlap\TimeRange;
$a = new TimeRange(new DateTime( '22:22' ),new DateTime( '23:22' ));
$b = new TimeRange(new DateTime( '22:44' ),new DateTime( '23:44' ));

## check time overlap
$a->has_overlapping($b); // => true
```

Other checking like this.

```
$a->before($b);
$a->overlapped($b);
$a->during($b);
$a->overlaps($b);
$a->after($b);
$a->contains($b);
$a->same($b);
```

Supported patterns.
-------------------

[](#supported-patterns)

I named overlapping patterns like this.

[![](https://github.com/takuya/php-timerange-overlap/raw/master/docs/images/names-with-equal.png)](https://github.com/takuya/php-timerange-overlap/raw/master/docs/images/names-with-equal.png)

EQUALS(ex A.end==B.start ) patterns are excluded intentionally. If equal ex.`A->end == B->start` compared,It will be overlapping. Comparing equals "22:22-**22:25**" to "**22:25**-22:27" , do minus explicitly ( `-1 sec` before comparing) .

Installation
------------

[](#installation)

from github

```
composer config repositories.'php-timerange-overlap' \
         vcs https://github.com/takuya/php-timerange-overlap
composer require takuya/php-timerange-overlap:master
composer install
```

from packgist

```
composer require takuya/php-timerange-overlap
```

Testing
-------

[](#testing)

```
git clone https://github.com/takuya/php-timerange-overlap
cd php-timerange-overlap
composer install
vendor/bin/phpunit
```

###  Health Score

33

—

LowBetter than 72% of packages

Maintenance64

Regular maintenance activity

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity46

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

1290d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/ab28766f469b5f1770a63613c5f51d661226e01bd2abd180ad5460e537e7d4fa?d=identicon)[takuya](/maintainers/takuya)

---

Top Contributors

[![takuya](https://avatars.githubusercontent.com/u/55338?v=4)](https://github.com/takuya "takuya (313 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/takuya-php-time-overlap/health.svg)

```
[![Health](https://phpackages.com/badges/takuya-php-time-overlap/health.svg)](https://phpackages.com/packages/takuya-php-time-overlap)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
