PHPackages                             jupitern/scheduler - 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. jupitern/scheduler

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

jupitern/scheduler
==================

php event schedule

1.4.1(1y ago)23116MITPHPPHP &gt;=8.0

Since Jul 15Pushed today2 watchersCompare

[ Source](https://github.com/jupitern/Scheduler)[ Packagist](https://packagist.org/packages/jupitern/scheduler)[ Docs](https://github.com/jupitern/scheduler)[ RSS](/packages/jupitern-scheduler/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)DependenciesVersions (18)Used By (0)

[![Build Status](https://camo.githubusercontent.com/6c5cc75e32922c1d363fb3c2bef6651696e278a8b64180ba659c416865fb1225/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6a7570697465726e2f5363686564756c65722f6261646765732f6275696c642e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/jupitern/Scheduler/build-status/master)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/32e859ac36c180c1c6472b13f65fa11e9dd620c81e8b3fcf1926c67ad70e183a/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6a7570697465726e2f5363686564756c65722f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/jupitern/Scheduler/?branch=master)[![Latest Stable Version](https://camo.githubusercontent.com/1c5dc1df6ce3b07f9cc6707a56f31360b1801d82a652cf3c4f74edda23807f84/68747470733a2f2f706f7365722e707567782e6f72672f6a7570697465726e2f7363686564756c65722f762f737461626c65)](https://packagist.org/packages/jupitern/scheduler)[![Latest Unstable Version](https://camo.githubusercontent.com/056d1a79cf264b41859d0ad8e89cd2d313dfdddc421b5eb62ad36058a57b1dd3/68747470733a2f2f706f7365722e707567782e6f72672f6a7570697465726e2f7363686564756c65722f762f756e737461626c65)](https://packagist.org/packages/jupitern/scheduler)[![License](https://camo.githubusercontent.com/64516db85f1216fd81e4c524b3e0d44092ef0bb32923b10748bba2739d0c096a/68747470733a2f2f706f7365722e707567782e6f72672f6a7570697465726e2f7363686564756c65722f6c6963656e7365)](https://packagist.org/packages/jupitern/scheduler)

jupitern/scheduler
==================

[](#jupiternscheduler)

#### PHP Scheduler.

[](#php-scheduler)

add one time event dates or recurring event dates get next event date or next X event dates from a given date

Requirements
------------

[](#requirements)

PHP 8.3 or higher.

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

[](#installation)

Include jupitern/scheduler in your project, by adding it to your composer.json file.

```
composer require jupitern/scheduler
```

Usage
-----

[](#usage)

```
// instance Scheduler
$schedules = \Jupitern\Scheduler\Scheduler::instance()

// limit events from 08.00 am to 17.00
->setTimeFrame('08:00', '17:00')

// add a one time event date
// accepts any string compatible with php DateTime object
->add('2020-01-01 12:35')

// add another one time event date
// accepts any string compatible with php DateTime object
->add('2020-01-01 17:50')

// add a recurring date
// accepts any string compatible with php DateTime object
->addRecurring('+ 8 hours')

// get next schedule starting at 2020-01-01
->getNextSchedule('2020-01-01 00:00:00', 10);

// get next 5 schedules starting at 2020-01-01
->getNextSchedules('2020-01-01 00:00:00', 10);

// display schedules
foreach ($schedules as $schedule) {
    echo $schedule->format('Y-m-d H:i')."";
}
```

Examples
--------

[](#examples)

```
$schedules = \Jupitern\Scheduler\Scheduler::instance()
    ->add('2030-01-01 12:35')
    ->add('2030-01-01 14:50')
    ->addRecurring('+2 hours')
    ->getNextSchedules('2030-01-01 00:00:00', 10);

foreach ($schedules as $schedule) {
    echo $schedule->format('Y-m-d H:i').'';
}

/*
output:
2030-01-01 00:00
2030-01-01 02:00
2030-01-01 04:00
2030-01-01 06:00
2030-01-01 08:00
2030-01-01 10:00
2030-01-01 12:00
2030-01-01 12:35
2030-01-01 14:00
2030-01-01 14:50
*/

$schedules = \Jupitern\Scheduler\Scheduler::instance()
    ->setTimeFrame('08:00', '17:00')
    ->add('2030-01-01 12:35')
    ->add('2030-01-01 14:50')
    ->addRecurring('+2 hours')
    ->getNextSchedules('2030-01-01 00:00:00', 10);

foreach ($schedules as $schedule) {
    echo $schedule->format('Y-m-d H:i').'';
}

/*
output:
2030-01-01 08:00
2030-01-01 10:00
2030-01-01 12:00
2030-01-01 12:35
2030-01-01 14:00
2030-01-01 14:50
2030-01-01 16:00
2030-01-02 08:00
2030-01-02 10:00
2030-01-02 12:00
*/

$schedules = \Jupitern\Scheduler\Scheduler::instance()
    ->setTimeFrame('08:30', '19:00')
    ->add('+10 minutes')
    ->add('+30 minutes')	// outside time frame. will not produce any schedule
    ->add('next day 08:30')
    ->getNextSchedules('2000-12-16 18:40');

foreach ($schedules as $schedule) {
    echo $schedule->format('Y-m-d H:i')."";
}

/*
output:
2000-12-16 18:50
2000-12-17 08:30
*/
```

ChangeLog
---------

[](#changelog)

v1.5

- min php version updated to 8.3

v1.4

- min php version updated to 8.0
- code refactor for php 8
- bug fix to avoid duplicate dates when calculated dates from different schedules match

v1.3

- Changed method add to allow relative one time events like "+1 hour" or "next day 17:00"
- relative events added with method add() are relative to $fromStartDate and obey time frame if set

Contributing
------------

[](#contributing)

- welcome to discuss a bugs, features and ideas.

License
-------

[](#license)

jupitern/scheduler is release under the MIT license.

You are free to use, modify and distribute this software

###  Health Score

48

↑

FairBetter than 95% of packages

Maintenance73

Regular maintenance activity

Popularity18

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity77

Established project with proven stability

 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

Every ~214 days

Recently: every ~735 days

Total

17

Last Release

529d ago

Major Versions

0.1.4 → 1.0.02016-02-15

PHP version history (2 changes)0.1.1PHP &gt;=5.4

1.4.0PHP &gt;=8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/8205aca1dd2a7d1f98452950c3754b7430d16bcfe53494bfdf5c20d277d7776c?d=identicon)[jupitern](/maintainers/jupitern)

---

Top Contributors

[![jupitern](https://avatars.githubusercontent.com/u/4422374?v=4)](https://github.com/jupitern "jupitern (5 commits)")

---

Tags

phprecurring-eventsscheduleeventscheduler

### Embed Badge

![Health badge](/badges/jupitern-scheduler/health.svg)

```
[![Health](https://phpackages.com/badges/jupitern-scheduler/health.svg)](https://phpackages.com/packages/jupitern-scheduler)
```

###  Alternatives

[doctrine/event-manager

The Doctrine Event Manager is a simple PHP event system that was built to be used with the various Doctrine projects.

6.1k501.1M115](/packages/doctrine-event-manager)[league/event

Event package

1.6k141.6M184](/packages/league-event)[laminas/laminas-eventmanager

Trigger and listen to events within a PHP application

1.0k69.8M225](/packages/laminas-laminas-eventmanager)[winzou/state-machine

A very lightweight yet powerful PHP state machine

52113.7M18](/packages/winzou-state-machine)[spatie/laravel-event-sourcing

The easiest way to get started with event sourcing in Laravel

9003.7M26](/packages/spatie-laravel-event-sourcing)[spatie/laravel-google-calendar

Manage events on a Google Calendar

1.4k1.5M21](/packages/spatie-laravel-google-calendar)

PHPackages © 2026

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