PHPackages                             jeronimos/php-time-manage - 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. jeronimos/php-time-manage

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

jeronimos/php-time-manage
=========================

Manage time periods, occurrences after events (work hours after event), schedule

137PHP

Since Jan 24Pushed 10y ago1 watchersCompare

[ Source](https://github.com/jeronimos/php-time-manage)[ Packagist](https://packagist.org/packages/jeronimos/php-time-manage)[ RSS](/packages/jeronimos-php-time-manage/feed)WikiDiscussions master Synced 4w ago

READMEChangelogDependenciesVersions (1)Used By (0)

PHP time manage
===============

[](#php-time-manage)

Manage time periods, occurrences after events (work hours after event), schedule, etc.

Please, note that package stability is dev.

\###Composer installation

```
    "require": {
        "jeronimos/php-time-manage": "@dev"
    }
```

or you may execute

`composer require jeronimos/php-time-manage`

\###Occurrences module

It allow to calculate time periods according to work schedule.

E.g., your work day start at 10am and finish at 7pm. Event occur at 6pm on Friday. And you want to calculate when will occur 2 and 5 work hours after event. If Saturday and Sunday is not work weekends, and Friday has usual timing, and Monday is not holiday, occurrences dates will be Monday, 11am and 2pm.

As result it return dates and can resolve it to labels, allowing to backlight (by setting class name) this event in different colors depend on wich period is occured now (e.g., yellow, red).

You just should create three table in DB - holidays, work weekends and not normal days (shorter or longer that normal). Fil it depend on your neeeds, so script can consider it. You can find alter script [here](docs/schedule/schedule.sql). Example of extended schedule model [here](docs/schedule/ExtendedModelExample.md). Example of save holidays [here](docs/schedule/ExampleSave.md). Other types is under development, but you can add it directly to DB.

```
    $orderId = 55145;
    $incomeDate = "2015-08-07 18:00:00";

    $handlingOccurrences = new \AdjutantHandlers\Time\Occurrences\HandlingOccurrences();

    $occurrencesInitData = new \AdjutantHandlers\Time\Occurrences\Inventory\OccurrencesInitData();

    $eventData = new \AdjutantHandlers\Time\Occurrences\Inventory\EventData();
    $eventData->setEventId((int)$orderId);
    $eventData->setEventDate(new \DateTimeImmutable($incomeDate));

    $periodsKeeper = new \AdjutantHandlers\Time\Occurrences\Inventory\PeriodsKeeper();

    $periodOne = 2;
    $periodTwo = 5;
    $labelValues = [
        $periodOne => \AdjutantHandlers\Time\Occurrences\Inventory\OccurrencesConsts::MIN_PERIOD_LABEL,
        $periodTwo => \AdjutantHandlers\Time\Occurrences\Inventory\OccurrencesConsts::OLDER_PERIOD_LABEL
    ];

    $periods = [$periodOne, $periodTwo];
    $periodsKeeper->setPeriods($handlingOccurrences->initPeriods($periods));

    $occurrencesInitData->setEvent($eventData);
    $occurrencesInitData->setPeriods($periodsKeeper);

    //your model, that has connection to your db, and that extends from OccurrencesModel (contain queries)
    $model = new \Models\ExtendedOccurrencesModel();
    $occurrencesInitData->setModel($model);

    try {
        $occurrencesDates = $handlingOccurrences->initCalculation($occurrencesInitData);
        $resultLabel = $handlingOccurrences->resolveOccurrences($occurrencesDates, $labelValues);

    } catch (\AdjutantHandlers\Time\Occurrences\Inventory\Exceptions\OccurrencesException $e) {
    }

    return $resultLabel;
```

Model, connected to DB can look like this [one](docs/occurrences/ExtendedOccurrencesModel.md)

###  Health Score

21

—

LowBetter than 18% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 66.7% 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.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/16856547?v=4)[jeronimos](/maintainers/jeronimos)[@jeronimos](https://github.com/jeronimos)

---

Top Contributors

[![cbrcrtx](https://avatars.githubusercontent.com/u/13406665?v=4)](https://github.com/cbrcrtx "cbrcrtx (2 commits)")[![jeronimos](https://avatars.githubusercontent.com/u/16856547?v=4)](https://github.com/jeronimos "jeronimos (1 commits)")

### Embed Badge

![Health badge](/badges/jeronimos-php-time-manage/health.svg)

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

PHPackages © 2026

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