From 32ccac2d15aa7066158ddab4654aca0910db9a31 Mon Sep 17 00:00:00 2001 From: Hykilpikonna Date: Sat, 7 Dec 2019 11:42:40 -0500 Subject: [PATCH] [O] Find current term dynamically --- src/constants.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/constants.ts b/src/constants.ts index 435fc58..cdd3b81 100644 --- a/src/constants.ts +++ b/src/constants.ts @@ -1,6 +1,8 @@ /** * This class stores the static constants. */ +import {findLastIndex} from '@/logic/utils/general-utils'; + export default class Constants { /** Base url for api access */ @@ -64,5 +66,5 @@ export default class Constants new Date('Mar 22 2020'), new Date('Jun 05 2020'), ]; - public static CURRENT_TERM = 1; + public static CURRENT_TERM = findLastIndex(Constants.TERMS, d => d < new Date()); }