Skip to content

Commit

Permalink
Updated as the logic sits a year behind
Browse files Browse the repository at this point in the history
  • Loading branch information
Dominic NEED authored and Dominic NEED committed Nov 20, 2023
1 parent 868fdc8 commit 0a2654b
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,11 @@ public static string KeyStage4DataTag(DateTime date)

public static string DetermineKeyStageDataStatus(DateTime date, KeyStages keyStage)
{
bool isItCurrentAcademicYear = (date.Month < 9 && date.Year == DateTime.Now.Year) ||
(date.Month >= 9 && date.Year == DateTime.Now.Year - 1);
StatusType statusType = isItCurrentAcademicYear ? DetermineStatusType(date, keyStage) : StatusType.Final;
bool isItCurrentOrLastAcademicYear =
(date.Month < 9 && date.Year == DateTime.Now.Year) ||
(date.Month < 9 && date.Year == DateTime.Now.Year - 1) ||
(date.Month >= 9 && date.Year == DateTime.Now.Year - 2);
StatusType statusType = isItCurrentOrLastAcademicYear ? DetermineStatusType(date, keyStage) : StatusType.Final;
return statusType.ToString();
}

Expand Down

0 comments on commit 0a2654b

Please sign in to comment.