2017 © Pedro Peláez
 

library cutoff

image

sukohi/cutoff

  • Wednesday, December 9, 2015
  • by Sukohi
  • Repository
  • 1 Watchers
  • 0 Stars
  • 7 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

Cutoff

A Laravel package to manage cutoff day. (As of now, only for Laravel 4), (*1)

Installation

Add this package name in composer.json, (*2)

"require": {
  "sukohi/cutoff": "1.*"
}

Execute composer command., (*3)

composer update

Register the service provider in app.php, (*4)

'providers' => [
    ...Others...,  
    'Sukohi\Cutoff\CutoffServiceProvider',
]

Also alias, (*5)

'aliases' => [
    ...Others...,  
    'Cutoff' => 'Sukohi\Cutoff\Facades\Cutoff',
]

Usage

Next Cutoff Date, (*6)

$base_dt = new Carbon('2015-2-28');
$cutoff_day = 25;
echo Cutoff::nextDate($base_dt, $cutoff_day)->toDateString();   // 2015-03-25

Prev Cutoff Date, (*7)

$base_dt = new Carbon('2015-2-28');
$cutoff_day = 25;
echo Cutoff::prevDate($base_dt, $cutoff_day)->toDateString();   // 2015-01-25

Range, (*8)

$year = 2015;
$month = 2;
$day = 31;
Cutoff::range($year, $month, $day);  // start => 2015-02-01, end => 2015-02-28 23:59:59

License

This package is licensed under the MIT License., (*9)

Copyright 2015 Sukohi Kuhoh, (*10)

The Versions

09/12 2015

1.0.x-dev

1.0.9999999.9999999-dev

  Sources   Download

The Requires

 

by Avatar Sukohi

09/12 2015

dev-master

9999999-dev

  Sources   Download

The Requires

 

by Avatar Sukohi

09/12 2015

1.0.0

1.0.0.0

  Sources   Download

The Requires

 

by Avatar Sukohi