Skip to content

Commit 3b1cb9e

Browse files
author
Martin Krulis
committed
Small adjustment in sis terms presentation.
1 parent c5da169 commit 3b1cb9e

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

app/V1Module/presenters/SisPresenter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ public function actionStatus() {
9494
$terms[] = [
9595
'year' => $term->getYear(),
9696
'term' => $term->getTerm(),
97-
'starting' => $term->isAdvertised($now)
97+
'isAdvertised' => $term->isAdvertised($now)
9898
];
9999
}
100100

app/model/entity/SisValidTerm.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,13 +71,11 @@ public function isAdvertised(DateTime $now): bool {
7171
}
7272

7373
$advertiseUntil = $this->advertiseUntil;
74-
7574
if ($advertiseUntil === null) {
76-
$advertiseUntil = clone $this->beginning;
77-
$advertiseUntil->modify("+30 days");
75+
$advertiseUntil = $this->end;
7876
}
7977

80-
return $now > $this->beginning && $now < $this->end && $now < $advertiseUntil;
78+
return $now >= $this->beginning && $now <= $advertiseUntil;
8179
}
8280

8381
function jsonSerialize() {

0 commit comments

Comments
 (0)