From 3615e43fca80c1632cefa109b8ed0e666fb2e5a1 Mon Sep 17 00:00:00 2001 From: Brent Roose Date: Wed, 19 Dec 2018 14:04:11 +0100 Subject: [PATCH] Add visualizer --- CHANGELOG.md | 4 ++++ README.md | 3 +++ 2 files changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 94de611..ebbc4aa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,10 @@ All notable changes to `period` will be documented in this file - initial release +## 0.4.0 - 2018-12-19 + +- Add visualizer + ## 0.3.3 - 2018-12-18 - Support edge case for two period diffs diff --git a/README.md b/README.md index 3354baa..f671948 100644 --- a/README.md +++ b/README.md @@ -257,6 +257,7 @@ objects to see how they related to one another: ```php $visualizer = new Visualizer(["width" => 27]); + $visualizer->visualize([ "A" => Period::make('2018-01-01', '2018-01-31'), "B" => Period::make('2018-02-10', '2018-02-20'), @@ -271,6 +272,7 @@ $visualizer->visualize([ ``` And visualize will return the following string: + ``` A [========] B [==] @@ -281,6 +283,7 @@ OVERLAP [===] [==] [==] The visualizer has a configurable width provided upon creation which will control the bounds of the displayed periods: + ```php $visualizer = new Visualizer(["width" => 10]); ```