diff --git a/src/core/courses/providers/helper.ts b/src/core/courses/providers/helper.ts index 1fa52078f..6ff3ba5cf 100644 --- a/src/core/courses/providers/helper.ts +++ b/src/core/courses/providers/helper.ts @@ -137,12 +137,12 @@ export class CoreCoursesHelperProvider { break; case 'lastaccess': courses.sort((a, b) => { - return b.lastaccess - b.lastaccess; + return b.lastaccess - a.lastaccess; }); break; case 'timemodified': courses.sort((a, b) => { - return b.timemodified - b.timemodified; + return b.timemodified - a.timemodified; }); break; default: