[+] Encapsulate method to get begin date of a term

This commit is contained in:
Hykilpikonna
2019-11-09 15:28:21 -05:00
parent 2b7026c4ce
commit 3a8899507f
+12
View File
@@ -1,4 +1,6 @@
import Course from '@/logic/course';
import Navigation from '@/components/navigation/navigation';
import Constants from '@/constants';
const LEVEL_AP = {level: 'AP', scaleUp: 1};
const LEVEL_H = {level: 'H', scaleUp: 0.75};
@@ -64,4 +66,14 @@ export class CourseUtils
// Really unknown
return undefined;
}
/**
* Get the begin date of the selected term
*/
static getTermBeginDate()
{
let selected = Navigation.instance.getSelectedGradingPeriod();
return selected == -1 ? Constants.TERMS[0] : Constants.TERMS[selected];
}
}