[M] Rename to shorten getSelectGradingPEriod

This commit is contained in:
Hykilpikonna
2019-12-07 15:04:44 -05:00
parent 844eeefb4c
commit b3dfeb2add
3 changed files with 5 additions and 5 deletions
+2 -2
View File
@@ -175,13 +175,13 @@ export default class Navigation extends Vue
this.$cookies.set('va.grading-period', command, '10y'); this.$cookies.set('va.grading-period', command, '10y');
// Call event // Call event
this.$emit('select-time', this.getSelectedGradingPeriod()); this.$emit('select-time', this.getSelectedTerm());
} }
/** /**
* Get code for selected time * Get code for selected time
*/ */
public getSelectedGradingPeriod(): number public getSelectedTerm(): number
{ {
if (this.gradingPeriod == 'All Year') return -1; if (this.gradingPeriod == 'All Year') return -1;
else return +this.gradingPeriod.replace('Term ', '') - 1; else return +this.gradingPeriod.replace('Term ', '') - 1;
+1 -1
View File
@@ -183,7 +183,7 @@ export default class Course
{ {
return this.cache.get('GradingPeriods', () => return this.cache.get('GradingPeriods', () =>
{ {
let timeCode = Navigation.instance.getSelectedGradingPeriod(); let timeCode = Navigation.instance.getSelectedTerm();
return (timeCode == -1 ? [0, 1, 2, 3] : [timeCode]).filter(term => return (timeCode == -1 ? [0, 1, 2, 3] : [timeCode]).filter(term =>
this.termAssignments[term].filter(a => a.graded).length != 0); this.termAssignments[term].filter(a => a.graded).length != 0);
}) })
+2 -2
View File
@@ -72,7 +72,7 @@ export class CourseUtils
*/ */
static getTermBeginDate() static getTermBeginDate()
{ {
let selected = Navigation.instance.getSelectedGradingPeriod(); let selected = Navigation.instance.getSelectedTerm();
return selected == -1 ? Constants.TERMS[0] : Constants.TERMS[selected]; return selected == -1 ? Constants.TERMS[0] : Constants.TERMS[selected];
} }
@@ -82,7 +82,7 @@ export class CourseUtils
*/ */
static getTermEndDate() static getTermEndDate()
{ {
let selected = Navigation.instance.getSelectedGradingPeriod(); let selected = Navigation.instance.getSelectedTerm();
return selected == -1 ? Constants.TERMS[4] : Constants.TERMS[selected + 1]; return selected == -1 ? Constants.TERMS[4] : Constants.TERMS[selected + 1];
} }