Skip to content

Commit

Permalink
fix: variant based assignment bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
brobro10000 committed Sep 17, 2024
1 parent b2a91d6 commit 03d2ba9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
5 changes: 3 additions & 2 deletions src/components/course/course-header/CourseImportantDates.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,9 @@ const CourseImportantDates = () => {
const soonestExpiringAllocatedAssignment = courseMetadata.availableCourseRuns.find(
(courseRun) => courseRun.key === soonestExpiringAssignment?.contentKey,
);
soonestExpiringAllocatedAssignmentCourseStartDate = soonestExpiringAllocatedAssignment
&& getNormalizedStartDate(soonestExpiringAllocatedAssignment);
if (soonestExpiringAllocatedAssignment) {
soonestExpiringAllocatedAssignmentCourseStartDate = getNormalizedStartDate(soonestExpiringAllocatedAssignment);
}
}
// Parse logic of date existence and labels
const enrollByDate = soonestExpirationDate ?? null;
Expand Down
3 changes: 1 addition & 2 deletions src/components/course/data/utils.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -91,12 +91,11 @@ export const getNormalizedStartDate = ({
return todayToIso;
}
const startDateIso = dayjs(start).toISOString();
if (isCourseSelfPaced({ pacingType })) {
if (isCourseSelfPaced(pacingType)) {
if (hasTimeToComplete({ end, weeksToComplete }) || isWithinMinimumStartDateThreshold({ start })) {
// always today's date (incentives enrollment)
return todayToIso;
}
return startDateIso;
}
return startDateIso;
};
Expand Down

0 comments on commit 03d2ba9

Please sign in to comment.