feat: redesign the timeline as day columns with a bar per placement
This commit is contained in:
1 parent
4e50f23558
commit
e976342c09
8 files changed
+413
-190
No files matched your search
@@ -25,6 +25,8 @@ class TimelineItem
|
||||
private ?string $jobProfile = null;
|
||||
private ?string $teamerName = null;
|
||||
private ?string $teamerUuid = null;
|
||||
private int $column = 1;
|
||||
private int $span = 1;
|
||||
|
||||
public function __construct(private readonly string $type)
|
||||
{
|
||||
@@ -196,17 +198,33 @@ class TimelineItem
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getKey(): ?string
|
||||
/**
|
||||
* The first day column of the bar, counted from 1.
|
||||
*/
|
||||
public function getColumn(): int
|
||||
{
|
||||
return $this->getDateFrom()?->format('Ymd');
|
||||
return $this->column;
|
||||
}
|
||||
|
||||
public function getNumberOfDays(): int
|
||||
public function setColumn(int $column): static
|
||||
{
|
||||
if (null === $this->getDateFrom() || null === $this->getDateTo()) {
|
||||
return 1;
|
||||
}
|
||||
$this->column = $column;
|
||||
|
||||
return $this->getDateFrom()->diff($this->getDateTo())->days + 1;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The number of day columns the bar covers.
|
||||
*/
|
||||
public function getSpan(): int
|
||||
{
|
||||
return $this->span;
|
||||
}
|
||||
|
||||
public function setSpan(int $span): static
|
||||
{
|
||||
$this->span = $span;
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user