mirror of
https://gitlab.com/openstapps/openstapps.git
synced 2026-01-22 17:42:57 +00:00
fix: catalog module semester selection
This commit is contained in:
@@ -117,8 +117,9 @@ export class CatalogComponent implements OnInit, OnDestroy {
|
|||||||
semester => semester.startDate <= today && semester.endDate > today,
|
semester => semester.startDate <= today && semester.endDate > today,
|
||||||
);
|
);
|
||||||
const currentSemesterIndex = semesters.findIndex(semester => semester.uid === currentSemester?.uid);
|
const currentSemesterIndex = semesters.findIndex(semester => semester.uid === currentSemester?.uid);
|
||||||
this.availableSemesters = semesters.slice(currentSemesterIndex - 1, currentSemesterIndex + 2).reverse();
|
this.availableSemesters = semesters
|
||||||
|
.slice(Math.max(0, currentSemesterIndex - 1), Math.min(currentSemesterIndex + 2, semesters.length))
|
||||||
|
.reverse();
|
||||||
if (typeof this.activeSemester !== 'undefined') {
|
if (typeof this.activeSemester !== 'undefined') {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -121,11 +121,11 @@ export class CatalogProvider {
|
|||||||
arguments: {
|
arguments: {
|
||||||
bounds: {
|
bounds: {
|
||||||
lowerBound: {
|
lowerBound: {
|
||||||
limit: `${new Date().setFullYear(new Date().getFullYear() - 1)}`,
|
limit: `${new Date(new Date().setFullYear(new Date().getFullYear() - 1)).toISOString}`,
|
||||||
mode: 'inclusive',
|
mode: 'inclusive',
|
||||||
},
|
},
|
||||||
upperBound: {
|
upperBound: {
|
||||||
limit: `${new Date().setFullYear(new Date().getFullYear() + 1)}`,
|
limit: `${new Date(new Date().setFullYear(new Date().getFullYear() + 1)).toISOString}`,
|
||||||
mode: 'inclusive',
|
mode: 'inclusive',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user