Skip to content

Commit

Permalink
Merge pull request #15 from fykosak/dev-datetime-period
Browse files Browse the repository at this point in the history
fix casing
  • Loading branch information
cevro authored Oct 28, 2024
2 parents 6197456 + a9980e6 commit 3e4c5cf
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions src/DateTime/Period.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,22 +34,22 @@ public function isOnGoing(?\DateTimeInterface $dateTime = null): bool
public function is(Phase $period, ?\DateTimeInterface $dateTime = null): bool
{
return match ($period) {
Phase::before => $this->isBefore($dateTime),
Phase::after => $this->isAfter($dateTime),
Phase::onGoing => $this->isOnGoing($dateTime)
Phase::Before => $this->isBefore($dateTime),
Phase::After => $this->isAfter($dateTime),
Phase::OnGoing => $this->isOnGoing($dateTime)
};
}

public function getPhase(?\DateTimeInterface $dateTime = null): Phase
{
if ($this->isBefore($dateTime)) {
return Phase::before;
return Phase::Before;
}
if ($this->isAfter($dateTime)) {
return Phase::after;
return Phase::After;
}
if ($this->isOnGoing($dateTime)) {
return Phase::onGoing;
return Phase::OnGoing;
}
throw new \LogicException();
}
Expand Down
2 changes: 1 addition & 1 deletion src/FrontendComponent/Components/layout.latte
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{layout dirname((new \ReflectionClass(Fykosak\Utils\BaseComponent\BaseComponent::class))->getFileName()) . '/@layout.latte'}
{layout '../../Compoents/@layout.latte'}
{varType \Nette\Utils\Html $html}
{block content}
{$html}
Expand Down

0 comments on commit 3e4c5cf

Please sign in to comment.