[M] Rename to shorten getSelectGradingPEriod
This commit is contained in:
@@ -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
@@ -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);
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -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];
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user