ℹ️ Apologies for the brief "issue dump", but my time is currently limited and I wanted to report this already.Maybe I'll find time to provide details and/or PRs.
Also, thanks for this great package!
I found some bugs in the visualizer. My setup is the following:
use Spatie\Period\Visualizer;
use Spatie\Period\Period;
$v = new Visualizer(['width' => 10]);
$periods = [ /* ... */ ];
echo "\n" . $v->visualize($periods) . "\n";
1. Visualization of less than 2 periods
⚠️ max(): When only one parameter is given, it must be an array
// CASE: No periods
$periods = [];
// CASE: Only one period
$periods = [
Period::make(now(), now()->addDay())
];
2. Visualization of period spanning no more than one day
I found some bugs in the visualizer. My setup is the following:
1. Visualization of less than 2 periods
2. Visualization of period spanning no more than one day
3. Single-day periods sometimes not rendered
Single-day periods not renderd
Single-day periods rendered depending on the width
Varying the visualization
width
seems to affect the outcome.Assume the following periods:
Width: 50 (all periods rendered)
Width: 60 (one period "gone")