Skip to content

A PHP component to know if today is a particular event.

License

Notifications You must be signed in to change notification settings

matthieumota/today

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Today Component

Tests

The Today component provides PHP Object Oriented library to know if today is a particular day, business-day, holiday, current season...

Installation

Today uses Composer.

composer require matthieumota/today

Usage

<?php

require __DIR__.'/vendor/autoload.php';

use MatthieuMota\Component\Today\Today;

$today = new Today();
// You can back to the past to see if it was an amazing day.
// $today = new Today(new \DateTime('1985-10-21'));

$today->getHolidays(); // Return array with all holidays.
$today->isHoliday(); // True if today is holiday

$today->getSeason(); // Return current season : winter, spring, summer or autumn

Notes

This component is work in progress, it's no stable. Also, you should note that only french holidays are hardcoded because it doesn't need to support multi zone, but a PR well documented and tested can be merged.

About

A PHP component to know if today is a particular event.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages