Skip to content

Commit

Permalink
Add visualizer
Browse files Browse the repository at this point in the history
  • Loading branch information
brendt committed Dec 19, 2018
1 parent acc50ce commit 3615e43
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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'),
Expand All @@ -271,6 +272,7 @@ $visualizer->visualize([
```

And visualize will return the following string:

```
A [========]
B [==]
Expand All @@ -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]);
```
Expand Down

0 comments on commit 3615e43

Please sign in to comment.