2017 © Pedro Peláez
 

library calendar

Simple PHP Calendar Library

image

carvefx/calendar

Simple PHP Calendar Library

  • Tuesday, August 16, 2016
  • by carvefx
  • Repository
  • 2 Watchers
  • 1 Stars
  • 52 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 2 Versions
  • 2 % Grown

The README.md

Code Climate SensioLabsInsight Build Status, (*1)

calendar

Calendar Library written in PHP, (*2)

Usage

require('vendor/autoload.php');

use Carvefx\Calendar\Calendar;

$calendar = new Calendar(2014, 8);

foreach($calendar->getWeeks() as $week) {
  foreach($week->getDays() as $day) {
    $day->toDateString(); // 2014-07-27
    $day->isBlankDay(); // true
  }
}

Documentation

Calendar comes with 3 main classes:, (*3)

  • Calendar: represents a display of the current month, including the blank days that belong to the previous or next months
  • Week: represents 7 days, regardless of the month it belongs to
  • Day: represents a single day and wraps around the \Carbon\Carbon class

Day API

$day = new Day(2014, 07, 01);
$day->setBlankDay(false);
$day->isBlankDay(); // returns a bool value, shows whether the current day is part of the current month

// Any of the \Carbon\Carbon methods work
$day->getDateString(); // 2014-07-01
$day->month; // 7

Week API

$first_day = new Day(2014, 07, 01);
$week = new Week($first_day); // constructor requires the day the week starts at
$week->getDays(); // will result in an array containing 7 Day objects

Calendar API

$calendar = new Calendar(2014, 8);
$calendar->setYear(2015);
$calendar->setMonth(7);
$calendar->getFirstDay(); // returns the first day of the month
$calendar->getLastDay(); // returns the last day of tyhe month
$calendar->getWeeks() // results in a number of Week objects

The Versions

16/08 2016

dev-master

9999999-dev

Simple PHP Calendar Library

  Sources   Download

MIT

The Requires

 

The Development Requires

calendar

02/08 2014

v0.1

0.1.0.0

Simple PHP Calendar Library

  Sources   Download

MIT

The Requires

 

The Development Requires

calendar