Skip to content

Commit

Permalink
Merge pull request #485 from bcgov/develop/alex-GRAD2-2799
Browse files Browse the repository at this point in the history
Develop/alex grad2 2799
  • Loading branch information
githubmamatha authored Jun 27, 2024
2 parents 884eda0 + afa8a5b commit ed8952f
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,13 @@
public abstract class BaseRule implements Rule {

Date toLastDayOfMonth(Date date) {
Calendar cal = Calendar.getInstance();
cal.setTime(date);
cal.set(Calendar.DAY_OF_MONTH, cal.getActualMaximum(Calendar.DAY_OF_MONTH));
return cal.getTime();
if(date != null) {
Calendar cal = Calendar.getInstance();
cal.setTime(date);
cal.set(Calendar.DAY_OF_MONTH, cal.getActualMaximum(Calendar.DAY_OF_MONTH));
return cal.getTime();
}
return null;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -181,10 +181,13 @@ public static boolean isCompletedCourse(String finalGrade, Double finalPercentag
return false;
}

private static Date toLastDayOfMonth(Date date) {
Calendar cal = Calendar.getInstance();
cal.setTime(date);
cal.set(Calendar.DAY_OF_MONTH, cal.getActualMaximum(Calendar.DAY_OF_MONTH));
return cal.getTime();
static Date toLastDayOfMonth(Date date) {
if(date != null) {
Calendar cal = Calendar.getInstance();
cal.setTime(date);
cal.set(Calendar.DAY_OF_MONTH, cal.getActualMaximum(Calendar.DAY_OF_MONTH));
return cal.getTime();
}
return null;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -196,10 +196,13 @@ public static void updateCourseLevelForCLC(List<StudentCourse> studentCourses, S
});
}

private static Date toLastDayOfMonth(Date date) {
Calendar cal = Calendar.getInstance();
cal.setTime(date);
cal.set(Calendar.DAY_OF_MONTH, cal.getActualMaximum(Calendar.DAY_OF_MONTH));
return cal.getTime();
static Date toLastDayOfMonth(Date date) {
if(date != null) {
Calendar cal = Calendar.getInstance();
cal.setTime(date);
cal.set(Calendar.DAY_OF_MONTH, cal.getActualMaximum(Calendar.DAY_OF_MONTH));
return cal.getTime();
}
return null;
}
}

0 comments on commit ed8952f

Please sign in to comment.