PHPackages                             chinleung/php-weekday - 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. [Localization &amp; i18n](/categories/localization)
4. /
5. chinleung/php-weekday

ActiveLibrary[Localization &amp; i18n](/categories/localization)

chinleung/php-weekday
=====================

Easily get name of weekday and value from name between different languages.

v2.0.0(6y ago)18.7k[1 issues](https://github.com/chinleung/php-weekday/issues)1MITPHPPHP ^7.1CI failing

Since Jul 31Pushed 6y ago1 watchersCompare

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

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

PHP Weekday
===========

[](#php-weekday)

[![Latest Version on Packagist](https://camo.githubusercontent.com/50dc5a768c195b18337e115d4de7bca1d93c3225dbe5d74a4037a94e0b08052f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6368696e6c65756e672f7068702d7765656b6461792e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/chinleung/php-weekday)[![Build Status](https://camo.githubusercontent.com/df27ee7d68ba4fb37cc904e57baa4f9333fb90320e7ed3a76c3dd9a14a9b8b5e/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f6368696e6c65756e672f7068702d7765656b6461792f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/chinleung/php-weekday)[![Quality Score](https://camo.githubusercontent.com/8f999cde7bfd9bede952d47e3c4020773de277a6e21fda55352a59413d6aaebf/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f6368696e6c65756e672f7068702d7765656b6461792e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/chinleung/php-weekday)[![Total Downloads](https://camo.githubusercontent.com/d3a1985cd7c7de034e009f7bb621d5841a71f94e950cf3dbf7e076e30f566101/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6368696e6c65756e672f7068702d7765656b6461792e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/chinleung/php-weekday)

Easily get name of weekday and value from name between different languages.

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

[](#installation)

You can install the package via composer:

```
composer require chinleung/php-weekday
```

Usage
-----

[](#usage)

### Retrieve a name from a value

[](#retrieve-a-name-from-a-value)

```
Weekday::getNameFromValue(0, 'en'); // Sunday
(new Weekday(0, 'en'))->getName(); // Sunday
```

### Retrieving a name from a value for a different locale

[](#retrieving-a-name-from-a-value-for-a-different-locale)

```
Weekday::getNameFromValue(0, 'fr'); // Dimanche
(new Weekday(0, 'en'))->getName('fr'); // Dimanche
```

### Retrieving a value from the name

[](#retrieving-a-value-from-the-name)

```
Weekday::getValueFromName('Sunday', 'en'); // 0
Weekday::getValueFromName('Lundi', 'fr'); // 1
(new Weekday('wednesday', 'en'))->getName(); // 3
```

### Retrieving all names for a locale

[](#retrieving-all-names-for-a-locale)

```
Weekday::getNames('en'); // ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday']
```

### Changing the locale of an instance

[](#changing-the-locale-of-an-instance)

```
(new Weekday(1, 'en'))->setLocale('fr')->getName(); // Lundi
```

### Testing

[](#testing)

```
composer test
```

### Changelog

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.

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

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

### Security

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [Chin Leung](https://github.com/chinleung)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

PHP Package Boilerplate
-----------------------

[](#php-package-boilerplate)

This package was generated using the [PHP Package Boilerplate](https://laravelpackageboilerplate.com).

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance0

Infrequent updates — may be unmaintained

Popularity23

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity56

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

Every ~135 days

Total

3

Last Release

2212d ago

Major Versions

v1.1.0 → v2.0.02020-04-27

### Community

Maintainers

![](https://www.gravatar.com/avatar/40590fe8b8c82dfac2530c6f0c0c39dd1dded4c3ad136e15ef2cf3bb20304dad?d=identicon)[ChinLeung](/maintainers/ChinLeung)

---

Top Contributors

[![chinleung](https://avatars.githubusercontent.com/u/19669331?v=4)](https://github.com/chinleung "chinleung (19 commits)")

---

Tags

localizationphptranslationweekdaychinleungphp-weekday

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/chinleung-php-weekday/health.svg)

```
[![Health](https://phpackages.com/badges/chinleung-php-weekday/health.svg)](https://phpackages.com/packages/chinleung-php-weekday)
```

###  Alternatives

[symfony/translation

Provides tools to internationalize your application

6.6k836.5M2.1k](/packages/symfony-translation)[nesbot/carbon

An API extension for DateTime that supports 281 different languages.

169661.4M4.8k](/packages/nesbot-carbon)[chinleung/laravel-multilingual-routes

A package to register multilingual routes.

442195.4k2](/packages/chinleung-laravel-multilingual-routes)[joedixon/laravel-translation

A tool for managing all of your Laravel translations

717911.4k11](/packages/joedixon-laravel-translation)[illuminate/translation

The Illuminate Translation package.

6936.4M495](/packages/illuminate-translation)[lajax/yii2-translate-manager

Translation management extension for Yii 2

227578.8k13](/packages/lajax-yii2-translate-manager)

PHPackages © 2026

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