PHPackages                             hrevert/day-of-week - 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. hrevert/day-of-week

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

hrevert/day-of-week
===================

Day of week library

0.0.1(11y ago)2431MITPHPPHP &gt;=5.4

Since Jul 17Pushed 11y ago2 watchersCompare

[ Source](https://github.com/hrevert/day-of-week)[ Packagist](https://packagist.org/packages/hrevert/day-of-week)[ Docs](https://github.com/hrevert/day-of-week)[ RSS](/packages/hrevert-day-of-week/feed)WikiDiscussions master Synced today

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

day-of-week
===========

[](#day-of-week)

[![Master Branch Build Status](https://camo.githubusercontent.com/a0aa0648ab7a0d4b67a79fb4b2bf0122fdf4e3468a689ad5bf4133612b2d8ed9/68747470733a2f2f6170692e7472617669732d63692e6f72672f687265766572742f6461792d6f662d7765656b2e706e673f6272616e63683d6d6173746572)](http://travis-ci.org/hrevert/day-of-week)[![Latest Stable Version](https://camo.githubusercontent.com/a942b8e4be5e245512cafe1a5a0102e3f4d9a6e4879da104551ad2e5cd10ae84/68747470733a2f2f706f7365722e707567782e6f72672f687265766572742f6461792d6f662d7765656b2f762f737461626c652e706e67)](https://packagist.org/packages/hrevert/day-of-week)[![Total Downloads](https://camo.githubusercontent.com/4139cdd84b4e47aedeb627ef4f87f30d1d11cb295fd233fca90aa8b5e2ccb2b0/68747470733a2f2f706f7365722e707567782e6f72672f687265766572742f6461792d6f662d7765656b2f646f776e6c6f6164732e706e67)](https://packagist.org/packages/hrevert/day-of-week)

Day of week library

Usage
-----

[](#usage)

Please read the docs of [php-enum](https://github.com/marc-mabe/php-enum) first.

```
use Hrevert\Day\Day;

/** @var Day */
$day = Day::get(Day::MONDAY);
// or $day = Day::MONDAY();
// or $day = Day::getByName('MONDAY');
// or $day = Day::getByOrdinal(1);  i.e. find by ISO-8601 numeric representation of day

/** @var Day */
$today = Day::getToday();
```

```
use Hrevert\Day\Day;
use Hrevert\Day\DayCollection;

$days = new DayCollection([Day::SUNDAY(), Day::MONDAY()]);

var_dump($days->contains(Day::SUNDAY())); // bool(true)
var_dump($days->contains(Day::MONDAY())); // bool(true)

$days->remove(Day::MONDAY());
var_dump($days->contains(Day::MONDAY())); // bool(false)

$days->add(Day::MONDAY());
var_dump($days->contains(Day::MONDAY())); // bool(true)
```

Since `Hrevert\Day\DayCollection` is just an extension of [`Doctrine\Common\Collections\ArrayCollection`](https://github.com/doctrine/collections/blob/master/lib/Doctrine/Common/Collections/ArrayCollection.php), it should not be so difficult.

#### Using in &lt;select&gt; element

[](#using-in-select-element)

```
use Hrevert\Day\Day;

echo '';
foreach (Day::getOptions() as $iso => $display) {
    echo '' . $display . '';
}
echo '';

// on form submit
/** @var Hrevert\Day\Day */
$day = Hrevert\Day\Day::get((int) $_POST['day']);
```

###  Health Score

24

—

LowBetter than 31% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity48

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

4367d ago

### Community

Maintainers

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

---

Top Contributors

[![ojhaujjwal](https://avatars.githubusercontent.com/u/4995501?v=4)](https://github.com/ojhaujjwal "ojhaujjwal (9 commits)")

---

Tags

datetimedayhrevertday-of-week

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/hrevert-day-of-week/health.svg)

```
[![Health](https://phpackages.com/badges/hrevert-day-of-week/health.svg)](https://phpackages.com/packages/hrevert-day-of-week)
```

###  Alternatives

[nette/utils

🛠 Nette Utils: lightweight utilities for string &amp; array manipulation, image handling, safe JSON encoding/decoding, validation, slug or strong password generating etc.

2.1k430.4M1.7k](/packages/nette-utils)[oat-sa/tao-core

TAO core extension

66143.7k120](/packages/oat-sa-tao-core)[commerceguys/tax

Tax library with a flexible data model, predefined tax rates, powerful resolving logic.

285781.2k](/packages/commerceguys-tax)[api-platform/doctrine-common

Common files used by api-platform/doctrine-orm and api-platform/doctrine-odm

274.4M48](/packages/api-platform-doctrine-common)[sylius/promotion

Flexible promotion management for PHP applications.

28505.6k14](/packages/sylius-promotion)[netgen/layouts-core

Netgen Layouts enables you to build and manage complex web pages in a simpler way and with less coding. This is the core of Netgen Layouts, its heart and soul.

3692.1k16](/packages/netgen-layouts-core)

PHPackages © 2026

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