2017 © Pedro Peláez
 

library delivery-calculator

Calculate a date time by providing the start date time and a duration in hours

image

contoweb/delivery-calculator

Calculate a date time by providing the start date time and a duration in hours

  • Tuesday, March 27, 2018
  • by matthiascw
  • Repository
  • 1 Watchers
  • 4 Stars
  • 20 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

Delivery Calculator for Laravel

Calculate a DateTime by providing a start date-time and a duration in hours considering business hours, weekends and defined holidays., (*1)

Getting Started

The package is available on Packagist and GitHub: * https://packagist.org/packages/contoweb/delivery-calculator * https://github.com/contoweb/delivery-calculator, (*2)

Installing

With composer, (*3)

composer require contoweb/delivery-calculator

Migrate holidays table, (*4)

php artisan migrate

How to use

Load the class, (*5)

use Contoweb\DeliveryCalculator\DeliveryCalculator;

Initialize business hours with start (eg. 05:45) and end time (eg. 23:00), (*6)

$deliveryCalculator = new DeliveryCalculator(5, 45, 23, 0);

Function 1: Calculate a delivery DateTime by given start DateTime (Carbon date) and the delivery duration (double in hours), (*7)

$deliveryDateTime = $deliveryCalculator->getDeliveryTime(Carbon::now(), $duration); 

Function 2: Given date (Carbon) is in business time?, (*8)

$isBusinessTime = $deliveryCalculator->isBusinessTime(Carbon::now());

Define holidays

Enter a start_date (eg. 2017-12-24) and end_date (eg. 2017-12-26) into the holidays table to define holidays. For a single holiday just enter the same date for both fields., (*9)

Built With

Version

1.0, (*10)

Authors

The Versions

27/03 2018

dev-master

9999999-dev

Calculate a date time by providing the start date time and a duration in hours

  Sources   Download

MIT

The Requires

 

The Development Requires

by contoweb AG

laravel calculation delivery

03/01 2018

1.0.1

1.0.1.0

Calculate a date time by providing the start date time and a duration in hours

  Sources   Download

MIT

The Requires

 

by contoweb AG

laravel calculation delivery

03/01 2018

1.0.0

1.0.0.0

Calculate a date time by providing the start date time and a duration in hours

  Sources   Download

The Requires

 

by contoweb AG

laravel calculation delivery