- Pulled Course Home specific components into `course-home` - Created a courseHome reducer (and all necessary data files - api, thunks, slice) - Removed Course Home logic from Courseware's data files (api, thunks, slice, etc.) - Renamed Outline Tab URL to end in `/home` rather than `/outline` again (per Product) Co-authored-by: Carla Duarte <cduarte@edx.org>
17 lines
545 B
JavaScript
17 lines
545 B
JavaScript
function daycmp(a, b) {
|
|
if (a.getFullYear() < b.getFullYear()) { return -1; }
|
|
if (a.getFullYear() > b.getFullYear()) { return 1; }
|
|
if (a.getMonth() < b.getMonth()) { return -1; }
|
|
if (a.getMonth() > b.getMonth()) { return 1; }
|
|
if (a.getDate() < b.getDate()) { return -1; }
|
|
if (a.getDate() > b.getDate()) { return 1; }
|
|
return 0;
|
|
}
|
|
|
|
// item is a date block returned from the API
|
|
function isLearnerAssignment(item) {
|
|
return item.learnerHasAccess && item.dateType === 'assignment-due-date';
|
|
}
|
|
|
|
export { daycmp, isLearnerAssignment };
|