mirror of
https://gitlab.com/openstapps/openstapps.git
synced 2026-01-03 12:02:53 +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,
|
||||
);
|
||||
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') {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -121,11 +121,11 @@ export class CatalogProvider {
|
||||
arguments: {
|
||||
bounds: {
|
||||
lowerBound: {
|
||||
limit: `${new Date().setFullYear(new Date().getFullYear() - 1)}`,
|
||||
limit: `${new Date(new Date().setFullYear(new Date().getFullYear() - 1)).toISOString}`,
|
||||
mode: 'inclusive',
|
||||
},
|
||||
upperBound: {
|
||||
limit: `${new Date().setFullYear(new Date().getFullYear() + 1)}`,
|
||||
limit: `${new Date(new Date().setFullYear(new Date().getFullYear() + 1)).toISOString}`,
|
||||
mode: 'inclusive',
|
||||
},
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user